1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

PHI nodes not in the loop header aren't part of the loop iteration initial

state. Furthermore, they might not have two operands. This fixes the underlying
issue behind the crashes introduced in r142781.

llvm-svn: 142788
This commit is contained in:
Nick Lewycky 2011-10-24 05:51:01 +00:00
parent 4d47e224d7
commit 341bf1548e

View File

@ -4856,7 +4856,7 @@ ScalarEvolution::getConstantEvolutionLoopExitValue(PHINode *PN,
for (DenseMap<Instruction *, Constant *>::const_iterator
I = CurrentIterVals.begin(), E = CurrentIterVals.end(); I != E; ++I){
PHINode *PHI = dyn_cast<PHINode>(I->first);
if (!PHI || PHI == PN) continue;
if (!PHI || PHI == PN || PHI->getParent() != Header) continue;
Constant *&NextPHI = NextIterVals[PHI];
if (NextPHI) continue; // Already computed!