Keep UsedBlocks info accurate.
authorEvan Cheng <evan.cheng@apple.com>
Sun, 18 Mar 2007 09:02:31 +0000 (09:02 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sun, 18 Mar 2007 09:02:31 +0000 (09:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35140 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PHIElimination.cpp
lib/CodeGen/TwoAddressInstructionPass.cpp

index 6a9f4282080048edaf0adcacd4ffebd789bac4c0..734a06fa9d212ff8f58c0364c228fb33a8c49c12 100644 (file)
@@ -160,6 +160,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
@@ -210,6 +212,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
index ba768ba19fa5b347628e8c8e0cb429a1fb7125ca..9209420e3e1e7941686664af98277678fef76839 100644 (file)
@@ -198,6 +198,9 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
           varInfo.DefInst = prevMi;
 
           // update live variables for regB
+          LiveVariables::VarInfo& varInfoB = LV.getVarInfo(regB);
+          // regB is used in this BB.
+          varInfoB.UsedBlocks[mbbi->getNumber()] = true;
           if (LV.removeVirtualRegisterKilled(regB, mbbi, mi))
             LV.addVirtualRegisterKilled(regB, prevMi);