[llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Dec 13 05:53:01 PST 2002


Changes in directory llvm/lib/Target/X86:

InstSelectSimple.cpp updated: 1.64 -> 1.65

---
Log message:

Insert phi code at top of block


---
Diffs of the changes:

Index: llvm/lib/Target/X86/InstSelectSimple.cpp
diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.64 llvm/lib/Target/X86/InstSelectSimple.cpp:1.65
--- llvm/lib/Target/X86/InstSelectSimple.cpp:1.64	Fri Dec 13 05:39:18 2002
+++ llvm/lib/Target/X86/InstSelectSimple.cpp	Fri Dec 13 05:52:34 2002
@@ -340,9 +340,12 @@
         // Get the incoming value into a virtual register.  If it is not already
         // available in a virtual register, insert the computation code into
         // PredMBB
-        MachineBasicBlock::iterator PI = PredMBB->end()-1;
+        //
+
+        MachineBasicBlock::iterator PI = PredMBB->begin();
+        while ((*PI)->getOpcode() == X86::PHI) ++PI;
+        
         MI->addRegOperand(getReg(PN->getIncomingValue(i), PredMBB, PI));
-                                 
 
         // FIXME: Pass in the MachineBasicBlocks instead of the basic blocks...
         MI->addPCDispOperand(PN->getIncomingBlock(i));  // PredMBB





More information about the llvm-commits mailing list