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.
2 parents 3bb86f3 + 4db8130 commit 363ad2fCopy full SHA for 363ad2f
lib/SILOptimizer/LoopTransforms/LoopRotate.cpp
@@ -288,7 +288,11 @@ static bool isSingleBlockLoop(SILLoop *L) {
288
&& "Loop not well formed");
289
290
// Check whether the back-edge block is just a split-edge.
291
- return ++BackEdge->begin() == BackEdge->end();
+ for (SILInstruction &inst : make_range(BackEdge->begin(), --BackEdge->end())) {
292
+ if (instructionInlineCost(inst) != InlineCost::Free)
293
+ return false;
294
+ }
295
+ return true;
296
}
297
298
/// We rotated a loop if it has the following properties.
test/SILOptimizer/looprotate_ossa.sil
@@ -465,6 +465,7 @@ bb1:
465
cond_br %0, bb1a, bb2
466
467
bb1a:
468
+ %t = tuple(%0 : $Builtin.Int1, %0 : $Builtin.Int1)
469
br bb1
470
471
bb2:
0 commit comments