Index: llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp =================================================================== --- llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp +++ llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp @@ -110,14 +110,11 @@ static cl::opt PrintRangeChecks("irce-print-range-checks", cl::Hidden, cl::init(false)); -static cl::opt MaxExitProbReciprocal("irce-max-exit-prob-reciprocal", - cl::Hidden, cl::init(10)); - static cl::opt SkipProfitabilityChecks("irce-skip-profitability-checks", cl::Hidden, cl::init(false)); static cl::opt MinRuntimeIterations("min-runtime-iterations", - cl::Hidden, cl::init(3)); + cl::Hidden, cl::init(10)); static cl::opt AllowUnsignedLatchCondition("irce-allow-unsigned-latch", cl::Hidden, cl::init(true)); @@ -1871,7 +1868,7 @@ return true; BranchProbability ExitProbability = BPI->getEdgeProbability(LS.Latch, LS.LatchBrExitIdx); - if (ExitProbability > BranchProbability(1, MaxExitProbReciprocal)) { + if (ExitProbability > BranchProbability(1, MinRuntimeIterations)) { LLVM_DEBUG(dbgs() << "irce: could not prove profitability: " << "the exit probability is too big " << ExitProbability << "\n";); Index: llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll =================================================================== --- llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll +++ llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll @@ -60,4 +60,4 @@ ; CHECK: br i1 %next.postloop, label %loop.postloop, label %exit.loopexit !0 = !{i32 0, i32 2147483647} -!1 = !{!"branch_weights", i32 64, i32 4} +!1 = !{!"branch_weights", i32 128, i32 4}