From 957a4d3eb0a14a9d57bbb325ef0e1d458df2d2b9 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 21 Apr 2023 14:28:57 -0700 Subject: Refactor checkpointing policy and availability pass. (#2826) Co-authored-by: Yong He --- source/slang/slang-ir-loop-unroll.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'source/slang/slang-ir-loop-unroll.cpp') 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(param) || as(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 -- cgit v1.2.3