Ensuring that the PHI are all single-operand is not performed in the
second pass added by the previous pass. This removes the assert from
the first pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272650
91177308-0d34-0410-b5e6-
96231b3b80d8
// See if we have a single-operand PHI with the value defined by the
// original loop.
for (auto I = PHIBlock->begin(); (PN = dyn_cast<PHINode>(I)); ++I) {
- if (PN->getIncomingValue(0) == Inst) {
- assert(PN->getNumOperands() == 1 &&
- "Exit block should only have on predecessor");
+ if (PN->getIncomingValue(0) == Inst)
break;
- }
}
// If not create it.
if (!PN) {