[llvm-commits] [llvm] r72411 - in /llvm/trunk: include/llvm/CodeGen/LiveVariables.h lib/CodeGen/LiveVariables.cpp lib/CodeGen/PHIElimination.cpp lib/CodeGen/TwoAddressInstructionPass.cpp

Evan Cheng evan.cheng at apple.com
Mon May 25 23:25:47 PDT 2009


Author: evancheng
Date: Tue May 26 01:25:46 2009
New Revision: 72411

URL: http://llvm.org/viewvc/llvm-project?rev=72411&view=rev
Log:
Eliminate VarInfo::UsedBlocks.

Modified:
    llvm/trunk/include/llvm/CodeGen/LiveVariables.h
    llvm/trunk/lib/CodeGen/LiveVariables.cpp
    llvm/trunk/lib/CodeGen/PHIElimination.cpp
    llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp

Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=72411&r1=72410&r2=72411&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Tue May 26 01:25:46 2009
@@ -77,10 +77,6 @@
     ///
     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;

Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveVariables.cpp?rev=72411&r1=72410&r2=72411&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LiveVariables.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveVariables.cpp Tue May 26 01:25:46 2009
@@ -54,9 +54,6 @@
   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 @@
   }
   VarInfo &VI = VirtRegInfo[RegIdx];
   VI.AliveBlocks.resize(MF->getNumBlockIDs());
-  VI.UsedBlocks.resize(MF->getNumBlockIDs());
   return VI;
 }
 
@@ -131,7 +127,6 @@
   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.

Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=72411&r1=72410&r2=72411&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Tue May 26 01:25:46 2009
@@ -249,8 +249,6 @@
       // 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 @@
     // 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.

Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=72411&r1=72410&r2=72411&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original)
+++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Tue May 26 01:25:46 2009
@@ -955,11 +955,6 @@
 
           // 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);
 





More information about the llvm-commits mailing list