[llvm-commits] CVS: llvm/lib/Analysis/LoopInfo.cpp

Owen Anderson resistor at mac.com
Tue Jun 13 13:45:34 PDT 2006



Changes in directory llvm/lib/Analysis:

LoopInfo.cpp updated: 1.73 -> 1.74
---
Log message:

Update isLCSSAForm to handle PHI nodes specially for live-out detection.  This
is the same as the recent patch to LCSSA.cpp.


---
Diffs of the changes:  (+6 -1)

 LoopInfo.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)


Index: llvm/lib/Analysis/LoopInfo.cpp
diff -u llvm/lib/Analysis/LoopInfo.cpp:1.73 llvm/lib/Analysis/LoopInfo.cpp:1.74
--- llvm/lib/Analysis/LoopInfo.cpp:1.73	Sun Jun 11 14:22:28 2006
+++ llvm/lib/Analysis/LoopInfo.cpp	Tue Jun 13 15:45:22 2006
@@ -487,7 +487,12 @@
       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;
         }
       }






More information about the llvm-commits mailing list