[llvm-commits] CVS: llvm/lib/Transforms/Utils/LCSSA.cpp

Owen Anderson resistor at mac.com
Tue Jun 13 13:50:22 PDT 2006



Changes in directory llvm/lib/Transforms/Utils:

LCSSA.cpp updated: 1.21 -> 1.22
---
Log message:

Fix another instance where PHI nodes need special treatment.


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

 LCSSA.cpp |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/lib/Transforms/Utils/LCSSA.cpp
diff -u llvm/lib/Transforms/Utils/LCSSA.cpp:1.21 llvm/lib/Transforms/Utils/LCSSA.cpp:1.22
--- llvm/lib/Transforms/Utils/LCSSA.cpp:1.21	Tue Jun 13 14:37:18 2006
+++ llvm/lib/Transforms/Utils/LCSSA.cpp	Tue Jun 13 15:50:09 2006
@@ -215,6 +215,12 @@
   for (Instruction::use_iterator UI = Instr->use_begin(), UE = Instr->use_end();
        UI != UE; ++UI) {
     Instruction* use = cast<Instruction>(*UI);
+    BasicBlock* UserBB = use->getParent();
+    if (PHINode* p = dyn_cast<PHINode>(use)) {
+      unsigned OperandNo = UI.getOperandNo();
+      UserBB = p->getIncomingBlock(OperandNo/2);
+    }
+    
     // Don't need to update uses within the loop body.
     if (!inLoop(use->getParent()))
       Uses.push_back(use);






More information about the llvm-commits mailing list