summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-loop-unroll.cpp
diff options
context:
space:
mode:
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