[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
Thu Nov 12 01:40:12 PST 2020


skatkov updated this revision to Diff 304747.
skatkov retitled this revision from "[IRCE] Increase min runtime iteration threshold" to "[IRCE] Use the same min runtime iteration threshold for BPI and BFI checks".
skatkov edited the summary of this revision.

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/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/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));
+                                              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.304747.patch
Type: text/x-patch
Size: 2039 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201112/b3932216/attachment.bin>


More information about the llvm-commits mailing list