[llvm-commits] CVS: reopt/lib/TraceToFunction/TraceToFunction.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Fri May 21 15:55:01 PDT 2004


Changes in directory reopt/lib/TraceToFunction:

TraceToFunction.cpp updated: 1.55 -> 1.56

---
Log message:

Fix two important bugs in live-in set calculation: 
1) phis which reference values defined in the trace are not live-in 
2) phis which define values in the entry basic block are live-in
   (still need to add fixup code in entry BB for these though!)


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

Index: reopt/lib/TraceToFunction/TraceToFunction.cpp
diff -u reopt/lib/TraceToFunction/TraceToFunction.cpp:1.55 reopt/lib/TraceToFunction/TraceToFunction.cpp:1.56
--- reopt/lib/TraceToFunction/TraceToFunction.cpp:1.55	Fri May 21 05:28:42 2004
+++ reopt/lib/TraceToFunction/TraceToFunction.cpp	Fri May 21 15:54:44 2004
@@ -113,6 +113,9 @@
     Instruction *UInst = dyn_cast<Instruction> (*ui);
     if (!UInst)                      // Non-Instruction Users scare me, mommy
       return false;
+    if (isa<PHINode> (UInst))
+      continue; // If a Phi node uses a value that's defined in the
+                // trace, the def. must have originally dominated the Phi.
     BasicBlock *UBlock = UInst->getParent ();
     if (Block == UBlock) {
       // Start at Block->begin() traversing next pointers; if UInst
@@ -163,6 +166,10 @@
       }
     }
   }
+  // Add phis from entry BB
+  for (BasicBlock::iterator Inst = T.getEntryBasicBlock ()->begin ();
+       PHINode *PN = dyn_cast<PHINode> (Inst); ++Inst)
+    S.insert (PN);
   return S;
 }
 





More information about the llvm-commits mailing list