From: Owen Anderson Date: Tue, 13 Jun 2006 20:45:22 +0000 (+0000) Subject: Update isLCSSAForm to handle PHI nodes specially for live-out detection. This X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3cc86cc11f0bf4df5b62be617d5c2cd431bbc976;p=oota-llvm.git Update isLCSSAForm to handle PHI nodes specially for live-out detection. This is the same as the recent patch to LCSSA.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28773 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index eed2cd6c4ef..49162a66353 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -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(*UI)->getParent(); - if (!isa(*UI) && !contains(UserBB)) { + if (PHINode* p = dyn_cast(*UI)) { + unsigned OperandNo = UI.getOperandNo(); + UserBB = p->getIncomingBlock(OperandNo/2); + } + + if (!contains(UserBB)) { return false; } }