Skip to content

Commit 6ee30e8

Browse files
authored
[InstCombine] Fix incorrect number of iterations (llvm#140004)
1 parent 9a26dff commit 6ee30e8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5663,15 +5663,14 @@ static bool combineInstructionsOverFunction(
56635663
// Iterate while there is work to do.
56645664
unsigned Iteration = 0;
56655665
while (true) {
5666-
++Iteration;
5667-
5668-
if (Iteration > Opts.MaxIterations && !VerifyFixpoint) {
5666+
if (Iteration >= Opts.MaxIterations && !VerifyFixpoint) {
56695667
LLVM_DEBUG(dbgs() << "\n\n[IC] Iteration limit #" << Opts.MaxIterations
56705668
<< " on " << F.getName()
56715669
<< " reached; stopping without verifying fixpoint\n");
56725670
break;
56735671
}
56745672

5673+
++Iteration;
56755674
++NumWorklistIterations;
56765675
LLVM_DEBUG(dbgs() << "\n\nINSTCOMBINE ITERATION #" << Iteration << " on "
56775676
<< F.getName() << "\n");

0 commit comments

Comments
 (0)