From 284cee1f246c072f190c87c8fb60c1d2181e458f Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 24 Apr 2023 19:44:23 -0700 Subject: Change AD checkpointing policy to recompute more. (#2836) Co-authored-by: Yong He --- source/slang/slang-ir-dce.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'source/slang/slang-ir-dce.cpp') 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(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(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; -- cgit v1.2.3