summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2021-02-15 17:32:11 +0000
committerFlorian Hahn <flo@fhahn.com>2021-02-19 20:33:42 +0000
commitac5cc50e2598878abbeec0422ace51a020ba75c4 (patch)
tree4ad6b1a4460519cbdf1c59185f0cb6fac2eb6687 /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
parentc1653b8cc7bd8e7e3168089b6c6dad0aa4b6fdd6 (diff)
downloadllvm-perf/tmp.tar.gz
[SCEV] Improve handling of pointer compares involving subtractions.perf/tmp
This patch improves handling of pointer comparisons involving subtractions, if an offset is known to be positive. Proof for isKnownPredicateSubIdiom: https://alive2.llvm.org/ce/z/Gfe8mS Proof for getUDivExpr extension:a https://alive2.llvm.org/ce/z/H_G2Q0
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index ae1fff0fa844..643605ff352c 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1521,8 +1521,8 @@ bool IndVarSimplify::optimizeLoopExits(Loop *L, SCEVExpander &Rewriter) {
// Can we prove that some other exit must be taken strictly before this
// one?
- if (SE->isLoopEntryGuardedByCond(L, CmpInst::ICMP_ULT,
- MaxExitCount, ExitCount)) {
+ if (SE->isLoopEntryGuardedByCond(L, CmpInst::ICMP_ULT, MaxExitCount,
+ ExitCount)) {
foldExit(L, ExitingBB, false, DeadInsts);
Changed = true;
continue;