aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/PHIElimination.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-04-04 01:20:05 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-04-04 01:20:05 +0000
commit3bca6ca424cd682c4ab174e82cd831b58c46859e (patch)
tree47dfccb1af4ee40f0567e6d45cbc7d1e732c6546 /lib/CodeGen/PHIElimination.cpp
parentc7fe333d42d6290fbf9116e8ed31a4fde776571b (diff)
downloadexternal_llvm-3bca6ca424cd682c4ab174e82cd831b58c46859e.zip
external_llvm-3bca6ca424cd682c4ab174e82cd831b58c46859e.tar.gz
external_llvm-3bca6ca424cd682c4ab174e82cd831b58c46859e.tar.bz2
Undo PHI elimination copy placement patch. This causes coalescing (performace) issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r--lib/CodeGen/PHIElimination.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index e218691..37b7f45 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -49,12 +49,6 @@ namespace {
}
private:
- /// findInsertionPoint - Find a safe location to insert a move to copy
- /// source of a PHI instruction.
- MachineBasicBlock::iterator
- findInsertionPoint(MachineBasicBlock &MBB, MachineInstr *DefMI,
- unsigned DstReg, unsigned SrcReg) const;
-
/// EliminatePHINodes - Eliminate phi nodes by inserting copy instructions
/// in predecessor basic blocks.
///
@@ -132,28 +126,6 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
return true;
}
-/// findInsertionPoint - Find a safe location to insert a move to copy
-/// source of a PHI instruction.
-MachineBasicBlock::iterator
-PNE::findInsertionPoint(MachineBasicBlock &MBB, MachineInstr *DefMI,
- unsigned DstReg, unsigned SrcReg) const {
- if (DefMI->getOpcode() == TargetInstrInfo::PHI ||
- DefMI->getParent() != &MBB)
- return MBB.getFirstTerminator();
-
- for (MachineRegisterInfo::use_iterator I = MRI->use_begin(SrcReg),
- E = MRI->use_end(); I != E; ++I)
- if (I->getParent() == &MBB)
- return MBB.getFirstTerminator();
- for (MachineRegisterInfo::use_iterator I = MRI->use_begin(DstReg),
- E = MRI->use_end(); I != E; ++I)
- if (I->getParent() == &MBB)
- return MBB.getFirstTerminator();
-
- MachineBasicBlock::iterator I = DefMI;
- return ++I;
-}
-
/// LowerAtomicPHINode - Lower the PHI node at the top of the specified block,
/// under the assuption that it needs to be lowered in a way that supports
/// atomic execution of PHIs. This lowering method is always correct all of the
@@ -242,8 +214,7 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
// Find a safe location to insert the copy, this may be the first
// terminator in the block (or end()).
- MachineBasicBlock::iterator InsertPos =
- findInsertionPoint(opBlock, DefMI, IncomingReg, SrcReg);
+ MachineBasicBlock::iterator InsertPos = opBlock.getFirstTerminator();
// Insert the copy.
TII->copyRegToReg(opBlock, InsertPos, IncomingReg, SrcReg, RC, RC);