Eliminate VarInfo::UsedBlocks.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 26 May 2009 06:25:46 +0000 (06:25 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 26 May 2009 06:25:46 +0000 (06:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72411 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LiveVariables.h
lib/CodeGen/LiveVariables.cpp
lib/CodeGen/PHIElimination.cpp
lib/CodeGen/TwoAddressInstructionPass.cpp

index bb050f260368dbf344ea7fbff4519c9b6214724e..aae76873d03be10cd73b7e8989a5a0303d0b8316 100644 (file)
@@ -77,10 +77,6 @@ public:
     ///
     BitVector AliveBlocks;
 
-    /// UsedBlocks - Set of blocks in which this value is actually used. This
-    /// is a bit set which uses the basic block number as an index.
-    BitVector UsedBlocks;
-
     /// NumUses - Number of uses of this register across the entire function.
     ///
     unsigned NumUses;
index a7bdbd92ff2dd281b26008c61a1d387289075755..9453aa402b0c8c380d15b7ebec0fff89c6bf7064 100644 (file)
@@ -54,9 +54,6 @@ void LiveVariables::VarInfo::dump() const {
   cerr << "  Alive in blocks: ";
   for (int i = AliveBlocks.find_first(); i != -1; i = AliveBlocks.find_next(i))
     cerr << i << ", ";
-  cerr << "  Used in blocks: ";
-  for (int i = UsedBlocks.find_first(); i != -1; i = UsedBlocks.find_next(i))
-    cerr << i << ", ";
   cerr << "\n  Killed by:";
   if (Kills.empty())
     cerr << " No instructions.\n";
@@ -80,7 +77,6 @@ LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) {
   }
   VarInfo &VI = VirtRegInfo[RegIdx];
   VI.AliveBlocks.resize(MF->getNumBlockIDs());
-  VI.UsedBlocks.resize(MF->getNumBlockIDs());
   return VI;
 }
 
@@ -131,7 +127,6 @@ void LiveVariables::HandleVirtRegUse(unsigned reg, MachineBasicBlock *MBB,
   unsigned BBNum = MBB->getNumber();
 
   VarInfo& VRInfo = getVarInfo(reg);
-  VRInfo.UsedBlocks[BBNum] = true;
   VRInfo.NumUses++;
 
   // Check to see if this basic block is already a kill block.
index 67c555fd17f8fd314877cd5fb7cf8642e80a8c63..2eacb086d8b0258b23b79304672bed9d1666040d 100644 (file)
@@ -249,8 +249,6 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
       // each for each incoming block), the "def" block and instruction fields
       // for the VarInfo is not filled in.
       LV->addVirtualRegisterKilled(IncomingReg, PHICopy);
-
-      LV->getVarInfo(IncomingReg).UsedBlocks[MBB.getNumber()] = true;
     }
 
     // Since we are going to be deleting the PHI node, if it is the last use of
@@ -317,7 +315,6 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB,
     // variables information so that it knows the copy source 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 block.
index 6282a4ab554f43ecc410025dd227257030e21d1a..3c404046f15e49e875ccde2756fb780bd8b33bce 100644 (file)
@@ -955,11 +955,6 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
 
           // Update live variables for regB.
           if (LV) {
-            LiveVariables::VarInfo& varInfoB = LV->getVarInfo(regB);
-
-            // regB is used in this BB.
-            varInfoB.UsedBlocks[mbbi->getNumber()] = true;
-
             if (LV->removeVirtualRegisterKilled(regB,  mi))
               LV->addVirtualRegisterKilled(regB, prevMI);