state. Furthermore, they might not have two operands. This fixes the underlying
issue behind the crashes introduced in r142781.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142788
91177308-0d34-0410-b5e6-
96231b3b80d8
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!