aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-06-19 01:21:26 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-06-19 01:21:26 +0000
commita43fc8c36cb7f1bbe1881ad683f4d1373988b035 (patch)
tree5b583366685d27cfb68dd0ad4f897058b4534086 /lib
parent05faa1ca1723639eb1fae7cc3fe94a5f922cced6 (diff)
downloadexternal_llvm-a43fc8c36cb7f1bbe1881ad683f4d1373988b035.zip
external_llvm-a43fc8c36cb7f1bbe1881ad683f4d1373988b035.tar.gz
external_llvm-a43fc8c36cb7f1bbe1881ad683f4d1373988b035.tar.bz2
Cosmetic changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/PHIElimination.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index 4e2ed67..b50a008 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -97,7 +97,7 @@ bool PNE::runOnMachineFunction(MachineFunction &Fn) {
E = ImpDefs.end(); I != E; ++I) {
MachineInstr *DefMI = *I;
unsigned DefReg = DefMI->getOperand(0).getReg();
- if (MRI->use_begin(DefReg) == MRI->use_end())
+ if (MRI->use_empty(DefReg))
DefMI->eraseFromParent();
}
@@ -127,8 +127,10 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
return true;
}
+/// isSourceDefinedByImplicitDef - Return true if all sources of the phi node
+/// are implicit_def's.
static bool isSourceDefinedByImplicitDef(const MachineInstr *MPhi,
- const MachineRegisterInfo *MRI) {
+ const MachineRegisterInfo *MRI) {
for (unsigned i = 1; i != MPhi->getNumOperands(); i += 2) {
unsigned SrcReg = MPhi->getOperand(i).getReg();
const MachineInstr *DefMI = MRI->getVRegDef(SrcReg);
@@ -229,7 +231,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 = opBlock.getFirstTerminator();
-
+
// Insert the copy.
TII->copyRegToReg(opBlock, InsertPos, IncomingReg, SrcReg, RC, RC);