summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-inline.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-11-06 01:47:26 +0800
committerGitHub <noreply@github.com>2024-11-05 09:47:26 -0800
commitb118451e301d734e3e783b3acdf871f3f6ea851c (patch)
tree277f160d31e2c442f724bc6a2d3c09fabff403ca /source/slang/slang-ir-inline.cpp
parent53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 (diff)
Move switch statement bodies to their own lines (#5493)
* Move switch statement bodies to their own lines * format --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-ir-inline.cpp')
-rw-r--r--source/slang/slang-ir-inline.cpp35
1 files changed, 25 insertions, 10 deletions
diff --git a/source/slang/slang-ir-inline.cpp b/source/slang/slang-ir-inline.cpp
index 1490446d5..73cf6eb39 100644
--- a/source/slang/slang-ir-inline.cpp
+++ b/source/slang/slang-ir-inline.cpp
@@ -256,7 +256,8 @@ struct InliningPassBase
{
switch (decor->getOp())
{
- case kIROp_IntrinsicOpDecoration: return true;
+ case kIROp_IntrinsicOpDecoration:
+ return true;
}
}
@@ -766,7 +767,8 @@ struct TypeInliningPass : InliningPassBase
{
return true;
}
- default: break;
+ default:
+ break;
}
return false;
@@ -885,10 +887,15 @@ struct PreAutoDiffForceInliningPass : InliningPassBase
switch (decor->getOp())
{
case kIROp_UnsafeForceInlineEarlyDecoration:
- case kIROp_IntrinsicOpDecoration: return true;
- case kIROp_ForceInlineDecoration: hasForceInline = true; break;
+ case kIROp_IntrinsicOpDecoration:
+ return true;
+ case kIROp_ForceInlineDecoration:
+ hasForceInline = true;
+ break;
case kIROp_UserDefinedBackwardDerivativeDecoration:
- case kIROp_ForwardDerivativeDecoration: hasUserDefinedDerivative = true; break;
+ case kIROp_ForwardDerivativeDecoration:
+ hasUserDefinedDerivative = true;
+ break;
}
}
if (!hasForceInline || hasUserDefinedDerivative)
@@ -908,10 +915,14 @@ struct PreAutoDiffForceInliningPass : InliningPassBase
case kIROp_ForwardDifferentiate:
case kIROp_BackwardDifferentiate:
case kIROp_BackwardDifferentiatePrimal:
- case kIROp_BackwardDifferentiatePropagate: canInline = false; goto end;
+ case kIROp_BackwardDifferentiatePropagate:
+ canInline = false;
+ goto end;
// Also avoid inlining functions with inline-asm instructions.
- case kIROp_SPIRVAsm: canInline = false; goto end;
+ case kIROp_SPIRVAsm:
+ canInline = false;
+ goto end;
}
}
}
@@ -1008,11 +1019,15 @@ struct IntrinsicFunctionInliningPass : InliningPassBase
switch (inst->getOp())
{
case kIROp_SPIRVAsmOperandInst:
- case kIROp_SPIRVAsm: hasSpvAsm = true; continue;
+ case kIROp_SPIRVAsm:
+ hasSpvAsm = true;
+ continue;
case kIROp_Load:
case kIROp_swizzle:
- case kIROp_Store: continue;
- default: return false;
+ case kIROp_Store:
+ continue;
+ default:
+ return false;
}
}
return hasSpvAsm;