We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c2c047 commit b06aea0Copy full SHA for b06aea0
lib/SILOptimizer/LoopTransforms/LoopUnroll.cpp
@@ -74,7 +74,8 @@ void LoopCloner::cloneLoop() {
74
Loop->getExitBlocks(ExitBlocks);
75
76
// Clone the entire loop.
77
- cloneReachableBlocks(Loop->getHeader(), ExitBlocks);
+ cloneReachableBlocks(Loop->getHeader(), ExitBlocks,
78
+ /*insertAfter*/Loop->getLoopLatch());
79
}
80
81
/// Determine the number of iterations the loop is at most executed. The loop
@@ -93,7 +94,7 @@ static Optional<uint64_t> getMaxLoopTripCount(SILLoop *Loop,
93
94
if (!Loop->isLoopExiting(Latch))
95
return None;
96
- // Get the loop exit condition.
97
+ // Get the loop exit condition.
98
auto *CondBr = dyn_cast<CondBranchInst>(Latch->getTerminator());
99
if (!CondBr)
100
0 commit comments