// that need to be moved to the dominating block.
std::set<Instruction*> AggressiveInsts;
- bool CanPromote = true;
BasicBlock::iterator AfterPHIIt = BB->begin();
while (isa<PHINode>(AfterPHIIt)) {
PHINode *PN = cast<PHINode>(AfterPHIIt++);
&AggressiveInsts) ||
!DominatesMergePoint(PN->getIncomingValue(1), BB,
&AggressiveInsts)) {
- CanPromote = false;
+ return false;
}
}
- // Did we eliminate all PHI's?
- if (!CanPromote && AfterPHIIt != BB->begin())
- return false;
-
// If we all PHI nodes are promotable, check to make sure that all
// instructions in the predecessor blocks can be promoted as well. If
// not, we won't be able to get rid of the control flow, so it's not