[llvm] r329379 - [NFC] Loosen restriction on preheader to fix buildbot
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 6 00:23:45 PDT 2018
Author: mkazantsev
Date: Fri Apr 6 00:23:45 2018
New Revision: 329379
URL: http://llvm.org/viewvc/llvm-project?rev=329379&view=rev
Log:
[NFC] Loosen restriction on preheader to fix buildbot
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=329379&r1=329378&r2=329379&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Apr 6 00:23:45 2018
@@ -9595,14 +9595,14 @@ bool ScalarEvolution::isImpliedViaMerge(
} 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();
More information about the llvm-commits
mailing list