diff options
| author | Yong He <yonghe@outlook.com> | 2022-11-10 14:19:20 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-10 14:19:20 -0800 |
| commit | 0b05fe33c82ee301c134f5b9a87a596aa47121c8 (patch) | |
| tree | 61869daaf5cad2609efcdf239f31c203d64f39b1 /source/slang/slang-ir-single-return.cpp | |
| parent | 10834e69b1e483be4116d85b00d4bc0b861da822 (diff) | |
Fix inlining pass. (#2506)
* Fix inlining pass.
* Add more check against corner cases.
* Revise comments.
* Fixes.
* Fix premake script.
* Fixes.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-single-return.cpp')
| -rw-r--r-- | source/slang/slang-ir-single-return.cpp | 13 |
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(); } }; |
