aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-10-06 21:44:49 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-10-06 21:44:49 +0000
commit5c8bead46da91c348d37bcbefb431f5ff122ab19 (patch)
treec4ef42fbec27b10e8ab9e64b612958333da10136 /llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
parent088bb0ea9f5223c7c584163a49ddd4d9291581d5 (diff)
downloadllvm-5c8bead46da91c348d37bcbefb431f5ff122ab19.zip
llvm-5c8bead46da91c348d37bcbefb431f5ff122ab19.tar.gz
llvm-5c8bead46da91c348d37bcbefb431f5ff122ab19.tar.bz2
[IndVars] Don't break dominance in `eliminateIdentitySCEV`
Summary: After r249211, `getSCEV(X) == getSCEV(Y)` does not guarantee that X and Y are related in the dominator tree, even if X is an operand to Y (I've included a toy example in comments, and a real example as a test case). This commit changes `SimplifyIndVar` to require a `DominatorTree`. I don't think this is a problem because `ScalarEvolution` requires it anyway. Fixes PR25051. Depends on D13459. Reviewers: atrick, hfinkel Subscribers: joker.eph, llvm-commits, sanjoy Differential Revision: http://reviews.llvm.org/D13460 llvm-svn: 249471
Diffstat (limited to 'llvm/lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 2f295fe..0062ce5 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1395,7 +1395,7 @@ void IndVarSimplify::SimplifyAndExtend(Loop *L,
// Information about sign/zero extensions of CurrIV.
IndVarSimplifyVisitor Visitor(CurrIV, SE, TTI, DT);
- Changed |= simplifyUsersOfIV(CurrIV, SE, &LPM, DeadInsts, &Visitor);
+ Changed |= simplifyUsersOfIV(CurrIV, SE, DT, &LPM, DeadInsts, &Visitor);
if (Visitor.WI.WidestNativeType) {
WideIVs.push_back(Visitor.WI);