aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/InstSelectSimple.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-13 11:52:34 +0000
committerChris Lattner <sabre@nondot.org>2002-12-13 11:52:34 +0000
commit920536333c4c143a92b5c0ed4ce712e59188e5e0 (patch)
tree1b99de9005bd94ef8df290afe179d77dc1625dd5 /lib/Target/X86/InstSelectSimple.cpp
parent992447f91b720f3148d3d989a15f77fd60dd9ee7 (diff)
downloadexternal_llvm-920536333c4c143a92b5c0ed4ce712e59188e5e0.zip
external_llvm-920536333c4c143a92b5c0ed4ce712e59188e5e0.tar.gz
external_llvm-920536333c4c143a92b5c0ed4ce712e59188e5e0.tar.bz2
Insert phi code at top of block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/InstSelectSimple.cpp')
-rw-r--r--lib/Target/X86/InstSelectSimple.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp
index 4cb6562..cad8e0d 100644
--- a/lib/Target/X86/InstSelectSimple.cpp
+++ b/lib/Target/X86/InstSelectSimple.cpp
@@ -340,9 +340,12 @@ void ISel::SelectPHINodes() {
// 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