summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-single-return.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-single-return.cpp')
-rw-r--r--source/slang/slang-ir-single-return.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/source/slang/slang-ir-single-return.cpp b/source/slang/slang-ir-single-return.cpp
index a00066556..f76e35040 100644
--- a/source/slang/slang-ir-single-return.cpp
+++ b/source/slang/slang-ir-single-return.cpp
@@ -54,7 +54,8 @@ struct SingleReturnContext : public InstPassBase
{
loopHeaderBlock->addParam(param);
}
- auto loopInst = (IRLoop*)builder.emitLoop(originalStartBlock, breakBlock, originalStartBlock);
+
+ builder.emitLoop(originalStartBlock, breakBlock, originalStartBlock);
// Now replace all return insts as break insts.
processChildInstsOfType<IRReturn>(kIROp_Return, func, [&](IRReturn* returnInst)
@@ -81,16 +82,6 @@ struct SingleReturnContext : public InstPassBase
builder.emitReturn(retValParam);
else
builder.emitReturn();
-
- // Now run the multi-level-break pass.
- eliminateMultiLevelBreakForFunc(module, func);
-
- // Now remove the trivial loop header.
- SLANG_RELEASE_ASSERT(loopInst->getContinueBlock() == loopInst->getTargetBlock());
- auto targetBlock = loopInst->getTargetBlock();
- for (auto param : params)
- targetBlock->addParam(param);
- loopHeaderBlock->removeAndDeallocate();
}
};