summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-dce.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-dce.cpp')
-rw-r--r--source/slang/slang-ir-dce.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/source/slang/slang-ir-dce.cpp b/source/slang/slang-ir-dce.cpp
index 9c82715d4..5e1f2eb21 100644
--- a/source/slang/slang-ir-dce.cpp
+++ b/source/slang/slang-ir-dce.cpp
@@ -582,8 +582,11 @@ bool shouldInstBeLiveIfParentIsLive(IRInst* inst, IRDeadCodeEliminationOptions o
{
switch (decor->getOp())
{
- case kIROp_ExportDecoration: return true;
- case kIROp_ImportDecoration: isImported = true; break;
+ case kIROp_ExportDecoration:
+ return true;
+ case kIROp_ImportDecoration:
+ isImported = true;
+ break;
}
}
for (auto decor : innerInst->getDecorations())
@@ -592,7 +595,9 @@ bool shouldInstBeLiveIfParentIsLive(IRInst* inst, IRDeadCodeEliminationOptions o
{
case kIROp_ForwardDerivativeDecoration:
case kIROp_UserDefinedBackwardDerivativeDecoration:
- case kIROp_PrimalSubstituteDecoration: shouldKeptAliveIfImported = true; break;
+ case kIROp_PrimalSubstituteDecoration:
+ shouldKeptAliveIfImported = true;
+ break;
}
}
if (isImported && shouldKeptAliveIfImported)
@@ -643,10 +648,13 @@ bool shouldInstBeLiveIfParentIsLive(IRInst* inst, IRDeadCodeEliminationOptions o
// this problem.
//
case kIROp_StructField:
- case kIROp_WitnessTableEntry: return true;
+ case kIROp_WitnessTableEntry:
+ return true;
- case kIROp_GlobalParam: return options.keepGlobalParamsAlive;
- default: break;
+ case kIROp_GlobalParam:
+ return options.keepGlobalParamsAlive;
+ default:
+ break;
}
// If none of the explicit cases above matched, then we will consider
@@ -673,7 +681,8 @@ bool isWeakReferenceOperand(IRInst* inst, UInt operandIndex)
// Ignore all operands of SpecializationDictionaryItem.
// This inst is used as a cache and shouldn't hold anything alive.
return true;
- default: break;
+ default:
+ break;
}
return false;
}