forked from OSchip/llvm-project
Update isLCSSAForm to handle PHI nodes specially for live-out detection. This
is the same as the recent patch to LCSSA.cpp. llvm-svn: 28773
This commit is contained in:
parent
7c69df968c
commit
7e428625c9
|
@ -487,7 +487,12 @@ bool Loop::isLCSSAForm() const {
|
|||
for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;
|
||||
++UI) {
|
||||
BasicBlock *UserBB = cast<Instruction>(*UI)->getParent();
|
||||
if (!isa<PHINode>(*UI) && !contains(UserBB)) {
|
||||
if (PHINode* p = dyn_cast<PHINode>(*UI)) {
|
||||
unsigned OperandNo = UI.getOperandNo();
|
||||
UserBB = p->getIncomingBlock(OperandNo/2);
|
||||
}
|
||||
|
||||
if (!contains(UserBB)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue