[PATCH] D91230: [IRCE] Use the same min runtime iteration threshold for BPI and BFI checks
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 15 18:54:19 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG400f6edce754: [IRCE] Use the same min runtime iteration threshold for BPI and BFI checks (authored by skatkov).
Changed prior to commit:
https://reviews.llvm.org/D91230?vs=304747&id=305401#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91230/new/
https://reviews.llvm.org/D91230
Files:
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
llvm/test/Transforms/IRCE/low-iterations.ll
llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll
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}
Index: llvm/test/Transforms/IRCE/low-iterations.ll
===================================================================
--- llvm/test/Transforms/IRCE/low-iterations.ll
+++ 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
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<bool> PrintRangeChecks("irce-print-range-checks", cl::Hidden,
cl::init(false));
-static cl::opt<int> MaxExitProbReciprocal("irce-max-exit-prob-reciprocal",
- cl::Hidden, cl::init(10));
-
static cl::opt<bool> SkipProfitabilityChecks("irce-skip-profitability-checks",
cl::Hidden, cl::init(false));
-static cl::opt<unsigned> MinRuntimeIterations("min-runtime-iterations",
- cl::Hidden, cl::init(3));
+static cl::opt<unsigned> MinRuntimeIterations("irce-min-runtime-iterations",
+ cl::Hidden, cl::init(10));
static cl::opt<bool> 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";);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91230.305401.patch
Type: text/x-patch
Size: 3011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201116/433a9ae0/attachment.bin>
More information about the llvm-commits
mailing list