It is obvious that this has never been used for outputing more than a single
[oota-llvm.git] / lib / CodeGen / PHIElimination.cpp
index 5a988bafe3c87c1fbfe689522ba3b6b7d3f2d87a..4d34080b4ef9a3ad1c915909930089af9ca61a94 100644 (file)
@@ -21,6 +21,8 @@
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/CFG.h"
 
+namespace llvm {
+
 namespace {
   struct PNE : public MachineFunctionPass {
     bool runOnMachineFunction(MachineFunction &Fn) {
@@ -52,6 +54,7 @@ namespace {
                      "Eliminate PHI nodes for register allocation");
 }
 
+
 const PassInfo *PHIEliminationID = X.getPassInfo();
 
 /// EliminatePHINodes - Eliminate phi nodes by inserting copy instructions in
@@ -172,7 +175,7 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
         for (unsigned i = 0, e = PrevInst->getNumOperands(); i != e; ++i) {
           MachineOperand &MO = PrevInst->getOperand(i);
           if (MO.isVirtualRegister() && MO.getReg() == IncomingReg)
-            if (MO.opIsDefOnly() || MO.opIsDefAndUse()) {
+            if (MO.isDef()) {
               HaveNotEmitted = false;
               break;
             }             
@@ -260,3 +263,5 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
 
   return true;
 }
+
+} // End llvm namespace