add scaffolding for splitting of vectors.
[oota-llvm.git] / lib / CodeGen / PHIElimination.cpp
index 91dbc2e17ba45cd896bd5560ac052505e3b6fdf8..371fb072b5b8572406c440db88777678e08b5fb1 100644 (file)
@@ -33,7 +33,7 @@ STATISTIC(NumAtomic, "Number of atomic phis lowered");
 
 namespace {
   struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
-    static const char ID; // Pass identifcation, replacement for typeid
+    static char ID; // Pass identification, replacement for typeid
     PNE() : MachineFunctionPass((intptr_t)&ID) {}
 
     bool runOnMachineFunction(MachineFunction &Fn) {
@@ -76,7 +76,7 @@ namespace {
     VRegPHIUse VRegPHIUseCount;
   };
 
-  const char PNE::ID = 0;
+  char PNE::ID = 0;
   RegisterPass<PNE> X("phi-node-elimination",
                       "Eliminate PHI nodes for register allocation");
 }
@@ -135,7 +135,7 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
   // into the phi node destination.
   //
   const MRegisterInfo *RegInfo = MF.getTarget().getRegisterInfo();
-  RegInfo->copyRegToReg(MBB, AfterPHIsIt, DestReg, IncomingReg, RC);
+  RegInfo->copyRegToReg(MBB, AfterPHIsIt, DestReg, IncomingReg, RC, RC);
 
   // Update live variable information if there is any...
   LiveVariables *LV = getAnalysisToUpdate<LiveVariables>();
@@ -167,6 +167,8 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
     // Realize that the destination register is defined by the PHI copy now, not
     // the PHI itself.
     LV->getVarInfo(DestReg).DefInst = PHICopy;
+
+    LV->getVarInfo(IncomingReg).UsedBlocks[MBB.getNumber()] = true;
   }
 
   // Adjust the VRegPHIUseCount map to account for the removal of this PHI
@@ -200,7 +202,7 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
     MachineBasicBlock::iterator I = opBlock.getFirstTerminator();
     
     // Insert the copy.
-    RegInfo->copyRegToReg(opBlock, I, IncomingReg, SrcReg, RC);
+    RegInfo->copyRegToReg(opBlock, I, IncomingReg, SrcReg, RC, RC);
 
     // Now update live variable information if we have it.  Otherwise we're done
     if (!LV) continue;
@@ -217,6 +219,7 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
     // instruction kills the incoming value.
     //
     LiveVariables::VarInfo &InRegVI = LV->getVarInfo(SrcReg);
+    InRegVI.UsedBlocks[opBlock.getNumber()] = true;
 
     // Loop over all of the successors of the basic block, checking to see
     // if the value is either live in the block, or if it is killed in the