summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-loop-unroll.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-04-21 14:28:57 -0700
committerGitHub <noreply@github.com>2023-04-21 14:28:57 -0700
commit957a4d3eb0a14a9d57bbb325ef0e1d458df2d2b9 (patch)
treefabc9317b1595c9f74f5b25ee83d16f4260a19d3 /source/slang/slang-ir-loop-unroll.cpp
parent69a327a98e3f9504863f9ecb623aa93036ac43db (diff)
Refactor checkpointing policy and availability pass. (#2826)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-loop-unroll.cpp')
-rw-r--r--source/slang/slang-ir-loop-unroll.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/source/slang/slang-ir-loop-unroll.cpp b/source/slang/slang-ir-loop-unroll.cpp
index 121665c85..a368ff8c8 100644
--- a/source/slang/slang-ir-loop-unroll.cpp
+++ b/source/slang/slang-ir-loop-unroll.cpp
@@ -529,23 +529,6 @@ bool unrollLoopsInModule(IRModule* module, DiagnosticSink* sink)
return true;
}
-static void _moveParams(IRBlock* dest, IRBlock* src)
-{
- for (auto param = src->getFirstChild(); param;)
- {
- auto nextInst = param->getNextInst();
- if (as<IRDecoration>(param) || as<IRParam>(param))
- {
- param->insertAtEnd(dest);
- }
- else
- {
- break;
- }
- param = nextInst;
- }
-}
-
void eliminateContinueBlocks(IRModule* module, IRLoop* loopInst)
{
// Eliminate the continue jumps by turning a loop in the form of:
@@ -599,7 +582,7 @@ void eliminateContinueBlocks(IRModule* module, IRLoop* loopInst)
targetBlock->replaceUsesWith(innerBreakableRegionHeader);
// Move decorations and params from original targetBlock to innerBreakableRegionHeader.
- _moveParams(innerBreakableRegionHeader, targetBlock);
+ moveParams(innerBreakableRegionHeader, targetBlock);
builder.setInsertInto(innerBreakableRegionHeader);
builder.emitLoop(targetBlock, innerBreakableRegionBreakBlock, targetBlock);
@@ -607,7 +590,7 @@ void eliminateContinueBlocks(IRModule* module, IRLoop* loopInst)
continueBlock->replaceUsesWith(innerBreakableRegionBreakBlock);
builder.setInsertInto(innerBreakableRegionBreakBlock);
- _moveParams(innerBreakableRegionBreakBlock, continueBlock);
+ moveParams(innerBreakableRegionBreakBlock, continueBlock);
builder.emitBranch(continueBlock);
// If the original loop can be executed up to N times, the new loop may be executed