diff options
author | Owen Anderson <resistor@mac.com> | 2006-06-13 20:45:22 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2006-06-13 20:45:22 +0000 |
commit | 3cc86cc11f0bf4df5b62be617d5c2cd431bbc976 (patch) | |
tree | 09b5e5bd759f651d31fb0c948960f6f20e88cbcc /lib/Analysis/LoopInfo.cpp | |
parent | c8aba85e1c8bfa3ca5b1810bd8e942fa98c5da56 (diff) |
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
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r-- | lib/Analysis/LoopInfo.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index eed2cd6c4e..49162a6635 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<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; } } |