summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2006-06-13 20:45:22 +0000
committerOwen Anderson <resistor@mac.com>2006-06-13 20:45:22 +0000
commit7e428625c9f54a642ff13538e5ce3ff07424ab6d (patch)
treeb5dea71bbcf0a55ef13118c400d2daf863c2397d
parent7c69df968cc96e401ddf943fb0617561ac54ee45 (diff)
downloadbcm5719-llvm-7e428625c9f54a642ff13538e5ce3ff07424ab6d.tar.gz
bcm5719-llvm-7e428625c9f54a642ff13538e5ce3ff07424ab6d.zip
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
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index eed2cd6c4ef..49162a66353 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/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;
}
}
OpenPOWER on IntegriCloud