[llvm-commits] [llvm] r52479 - /llvm/trunk/lib/CodeGen/PHIElimination.cpp
Evan Cheng
evan.cheng at apple.com
Wed Jun 18 18:21:27 PDT 2008
Author: evancheng
Date: Wed Jun 18 20:21:26 2008
New Revision: 52479
URL: http://llvm.org/viewvc/llvm-project?rev=52479&view=rev
Log:
Cosmetic changes.
Modified:
llvm/trunk/lib/CodeGen/PHIElimination.cpp
Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=52479&r1=52478&r2=52479&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Wed Jun 18 20:21:26 2008
@@ -97,7 +97,7 @@
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 @@
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 @@
// 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);
More information about the llvm-commits
mailing list