diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-05-29 23:10:20 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-05-29 23:10:20 +0000 |
commit | 7916c92a2b00e70d5ae9cd6ad8f633d6a08d2af1 (patch) | |
tree | bb7061db5f5c18fe81338cc8c46af5ecce838328 /lib/Target | |
parent | 1c334a3eea9f806b95a991a0aebcf95ec89cb626 (diff) | |
download | external_llvm-7916c92a2b00e70d5ae9cd6ad8f633d6a08d2af1.zip external_llvm-7916c92a2b00e70d5ae9cd6ad8f633d6a08d2af1.tar.gz external_llvm-7916c92a2b00e70d5ae9cd6ad8f633d6a08d2af1.tar.bz2 |
Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/SparcV9/InstrSelection/InstrSelection.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp index 70b5dbc..8c3dd5d 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp @@ -209,15 +209,15 @@ void InstructionSelection::InsertCodeForPhis(Function &F) { for (MachineFunction::iterator BB = MF.begin(); BB != MF.end(); ++BB) { for (BasicBlock::const_iterator IIt = BB->getBasicBlock()->begin(); const PHINode *PN = dyn_cast<PHINode>(IIt); ++IIt) { - Value *PhiCpRes = new PHINode(PN->getType(), PN->getName() + ":PhiCp"); - + // Create a new temporary register to hold the result of the Phi copy. // The leak detector shouldn't track these nodes. They are not garbage, // even though their parent field is never filled in. + Value *PhiCpRes = new PHINode(PN->getType(), PN->getName() + ":PhiCp"); LeakDetector::removeGarbageObject(PhiCpRes); - // for each incoming value of the phi, insert phi elimination + // For each of PN's incoming values, insert a copy in the corresponding + // predecessor block. for (unsigned i = 0; i < PN->getNumIncomingValues(); ++i) { - // insert the copy instruction to the predecessor BB std::vector<MachineInstr*> mvec, CpVec; Target.getRegInfo().cpValue2Value(PN->getIncomingValue(i), PhiCpRes, mvec); @@ -228,10 +228,10 @@ void InstructionSelection::InsertCodeForPhis(Function &F) { CpVec2.push_back(*MI); CpVec.insert(CpVec.end(), CpVec2.begin(), CpVec2.end()); } - + // Insert the copy instructions into the predecessor BB. InsertPhiElimInstructions(PN->getIncomingBlock(i), CpVec); } - + // Insert a copy instruction from PhiCpRes to PN. std::vector<MachineInstr*> mvec; Target.getRegInfo().cpValue2Value(PhiCpRes, const_cast<PHINode*>(PN), mvec); |