summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-05-30 03:33:49 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-05-30 03:33:49 +0000
commitbc3d8652ec8c29089e24f2806e5e3cf67c303c9f (patch)
treee02b9eed019467343677339e3cef3401a35bb8a1 /llvm
parenta8b396fe29f5a509d83b19ee2da2310a7e601533 (diff)
downloadbcm5719-llvm-bc3d8652ec8c29089e24f2806e5e3cf67c303c9f.tar.gz
bcm5719-llvm-bc3d8652ec8c29089e24f2806e5e3cf67c303c9f.zip
Insert machine instructions generated for Phi nodes into their
corresponding MachineCodeForInstruction vectors. I need to be able to get the register allocated for the thing which is called PhiCpRes in this code; this should make that task easier, plus, Phi nodes are no longer "special" in the sense that their MachineCodeForInstruction is empty. llvm-svn: 13904
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
index 8c3dd5d859e..c9be16f192f 100644
--- a/llvm/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp
+++ b/llvm/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<MachineInstr*> 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<MachineInstr*> mvec;
Target.getRegInfo().cpValue2Value(PhiCpRes, const_cast<PHINode*>(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
}
OpenPOWER on IntegriCloud