diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp index 8c3dd5d859e..c9be16f192f 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp @@ -217,6 +217,7 @@ void InstructionSelection::InsertCodeForPhis(Function &F) { // For each of PN's incoming values, insert a copy in the corresponding // predecessor block. + MachineCodeForInstruction &MCforPN = MachineCodeForInstruction::get (PN); for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i) { std::vector mvec, CpVec; Target.getRegInfo().cpValue2Value(PN->getIncomingValue(i), PhiCpRes, @@ -230,12 +231,14 @@ void InstructionSelection::InsertCodeForPhis(Function &F) { } // Insert the copy instructions into the predecessor BB. InsertPhiElimInstructions(PN->getIncomingBlock(i), CpVec); + MCforPN.insert (MCforPN.end (), CpVec.begin (), CpVec.end ()); } // Insert a copy instruction from PhiCpRes to PN. std::vector mvec; Target.getRegInfo().cpValue2Value(PhiCpRes, const_cast(PN), mvec); BB->insert(BB->begin(), mvec.begin(), mvec.end()); + MCforPN.insert (MCforPN.end (), mvec.begin (), mvec.end ()); } // for each Phi Instr in BB } // for all BBs in function }