summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-05-11 17:41:34 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-05-11 17:41:34 +0000
commitabb7b93eb9e21ea55a566b4f2c29b4fbd500906a (patch)
treedf137bad5c2dae8388c5b1666ee2c95ad23b2e6f /llvm/lib/Analysis/ScalarEvolutionExpander.cpp
parent787c2460c2da6e8aabb196a820ba5d14db23e528 (diff)
downloadbcm5719-llvm-abb7b93eb9e21ea55a566b4f2c29b4fbd500906a.tar.gz
bcm5719-llvm-abb7b93eb9e21ea55a566b4f2c29b4fbd500906a.zip
[SCEVExpander] Don't break SSA in replaceCongruentIVs
`SCEVExpander::replaceCongruentIVs` bypasses `hoistIVInc` if both the original and the isomorphic increments are PHI nodes. Doing this can break SSA if the isomorphic increment is not dominated by the original increment. Get rid of the bypass, and let `hoistIVInc` do the right thing. Fixes PR27232 (compile time crash/hang). llvm-svn: 269212
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 86c7bb9e289..c71f1a51382 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -1820,8 +1820,7 @@ unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
IsomorphicInc->getType());
if (OrigInc != IsomorphicInc && TruncExpr == SE.getSCEV(IsomorphicInc) &&
SE.LI.replacementPreservesLCSSAForm(IsomorphicInc, OrigInc) &&
- ((isa<PHINode>(OrigInc) && isa<PHINode>(IsomorphicInc)) ||
- hoistIVInc(OrigInc, IsomorphicInc))) {
+ hoistIVInc(OrigInc, IsomorphicInc)) {
DEBUG_WITH_TYPE(DebugType,
dbgs() << "INDVARS: Eliminated congruent iv.inc: "
<< *IsomorphicInc << '\n');
OpenPOWER on IntegriCloud