summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-04-06 07:23:45 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-04-06 07:23:45 +0000
commit2f2fbebdc837dabe713db37cca8cd629a1c75260 (patch)
tree02e529cf64c1b402f6e913e84bdeedba3636ece3 /llvm/lib/Analysis
parent9f4247d3e37f7fbe104efe5222ec74f27529b26a (diff)
downloadbcm5719-llvm-2f2fbebdc837dabe713db37cca8cd629a1c75260.tar.gz
bcm5719-llvm-2f2fbebdc837dabe713db37cca8cd629a1c75260.zip
[NFC] Loosen restriction on preheader to fix buildbot
llvm-svn: 329379
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index ef278065fec..e0b8d84371a 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -9595,14 +9595,14 @@ bool ScalarEvolution::isImpliedViaMerge(ICmpInst::Predicate Pred,
} else if (RAR && RAR->getLoop()->getHeader() == LBB) {
// Case two: RHS is also a Phi from the same basic block, and it is an
// AddRec. It means that there is a loop which has both AddRec and Unknown
- // PHIs, for it we can compare incoming values of AddRec from preheader and
- // latch with their respective incoming values of LPhi.
+ // PHIs, for it we can compare incoming values of AddRec from above the loop
+ // and latch with their respective incoming values of LPhi.
assert(LPhi->getNumIncomingValues() == 2 &&
"Phi node standing in loop header does not have exactly 2 inputs?");
auto *RLoop = RAR->getLoop();
- auto *Preheader = RLoop->getLoopPreheader();
- assert(Preheader && "Loop with AddRec with no preheader?");
- const SCEV *L1 = getSCEV(LPhi->getIncomingValueForBlock(Preheader));
+ auto *Predecessor = RLoop->getLoopPredecessor();
+ assert(Predecessor && "Loop with AddRec with no predecessor?");
+ const SCEV *L1 = getSCEV(LPhi->getIncomingValueForBlock(Predecessor));
if (!ProvedEasily(L1, RAR->getStart()))
return false;
auto *Latch = RLoop->getLoopLatch();
OpenPOWER on IntegriCloud