diff --git a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp index ef5ea30ffeac..12e86e0ea920 100644 --- a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp +++ b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp @@ -110,14 +110,11 @@ static cl::opt PrintChangedLoops("irce-print-changed-loops", cl::Hidden, 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)); +static cl::opt MinRuntimeIterations("irce-min-runtime-iterations", + cl::Hidden, cl::init(10)); static cl::opt AllowUnsignedLatchCondition("irce-allow-unsigned-latch", cl::Hidden, cl::init(true)); @@ -1871,7 +1868,7 @@ InductiveRangeCheckElimination::isProfitableToTransform(const Loop &L, 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";); diff --git a/llvm/test/Transforms/IRCE/low-iterations.ll b/llvm/test/Transforms/IRCE/low-iterations.ll index 4d174e9fcbc6..7a82852fe883 100644 --- a/llvm/test/Transforms/IRCE/low-iterations.ll +++ b/llvm/test/Transforms/IRCE/low-iterations.ll @@ -1,5 +1,5 @@ -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes=irce -min-runtime-iterations=3 < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NO -; RUN: opt -verify-loop-info -irce-print-changed-loops -passes=irce -min-runtime-iterations=0 < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-YES +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes=irce -irce-min-runtime-iterations=3 < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NO +; RUN: opt -verify-loop-info -irce-print-changed-loops -passes=irce -irce-min-runtime-iterations=0 < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-YES ; CHECK-YES: constrained Loop ; CHECK-NO-NOT: constrained Loop diff --git a/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll b/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll index 7ef305b0569e..2abbe4146e07 100644 --- a/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll +++ b/llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll @@ -60,4 +60,4 @@ define void @multiple_access_no_preloop( ; 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}