diff options
Diffstat (limited to 'source/slang/slang-ir-dce.cpp')
| -rw-r--r-- | source/slang/slang-ir-dce.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/source/slang/slang-ir-dce.cpp b/source/slang/slang-ir-dce.cpp index 364abe68c..1b0ecf521 100644 --- a/source/slang/slang-ir-dce.cpp +++ b/source/slang/slang-ir-dce.cpp @@ -223,25 +223,6 @@ struct DeadCodeEliminationContext return processInst(module->getModuleInst()); } - void removePhiArgs(IRInst* phiParam) - { - auto block = cast<IRBlock>(phiParam->getParent()); - UInt paramIndex = 0; - for (auto p = block->getFirstParam(); p; p = p->getNextParam()) - { - if (p == phiParam) - break; - paramIndex++; - } - for (auto predBlock : block->getPredecessors()) - { - auto termInst = as<IRUnconditionalBranch>(predBlock->getTerminator()); - SLANG_ASSERT(paramIndex < termInst->getArgCount()); - termInst->removeArgument(paramIndex); - } - phiRemoved = true; - } - bool eliminateDeadInstsRec(IRInst* inst) { bool changed = false; @@ -266,6 +247,7 @@ struct DeadCodeEliminationContext { // For Phi parameters, we need to update all branch arguments. removePhiArgs(inst); + phiRemoved = true; } inst->removeAndDeallocate(); changed = true; |
