* Eliminate the LiveVarSet class, making applyTranferFuncForMInst a static
authorChris Lattner <sabre@nondot.org>
Tue, 5 Feb 2002 02:52:05 +0000 (02:52 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 5 Feb 2002 02:52:05 +0000 (02:52 +0000)
  function in the one .cpp file that uses it.  Use ValueSet's instead.
* Prepare to delete LiveVarSet.h & LiveVarSet.cpp
* Eliminate the ValueSet class, making all old member functions into global
  templates that will eventually be moved to Support.
* Eliminate some irrelevant const's

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1712 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAlloc/InterferenceGraph.cpp
lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
lib/Target/SparcV9/RegAlloc/InterferenceGraph.cpp
lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
lib/Target/SparcV9/SparcV9RegClassInfo.cpp
lib/Target/SparcV9/SparcV9RegInfo.cpp

index a366c117109b69ac7477fe40ab4ddb6492fc80b8..c90ae4ae24192d357138fa4171ab5ca2b01a1ee1 100644 (file)
@@ -133,8 +133,8 @@ unsigned InterferenceGraph::getInterference(const LiveRange *const LR1,
 //            LiveRangeInfo::unionAndUpdateLRs for that purpose.
 //----------------------------------------------------------------------------
 
-void InterferenceGraph::mergeIGNodesOfLRs(const LiveRange *const LR1, 
-                                         LiveRange *const LR2 ) {
+void InterferenceGraph::mergeIGNodesOfLRs(const LiveRange *LR1, 
+                                         LiveRange *LR2) {
 
   assert( LR1 != LR2);                  // cannot merge the same live range
 
@@ -145,8 +145,8 @@ void InterferenceGraph::mergeIGNodesOfLRs(const LiveRange *const LR1,
   assertIGNode( SrcNode );
 
   if( DEBUG_RA > 1) {
-    cerr << "Merging LRs: \""; LR1->printSet(); 
-    cerr << "\" and \""; LR2->printSet();
+    cerr << "Merging LRs: \""; printSet(*LR1); 
+    cerr << "\" and \""; printSet(*LR2);
     cerr << "\"\n";
   }
 
@@ -236,7 +236,7 @@ void InterferenceGraph::printIGNodeList() const
 
     if (Node) {
       cerr << " [" << Node->getIndex() << "] ";
-      Node->getParentLR()->printSet(); 
+      printSet(*Node->getParentLR());
       //int Deg = Node->getCurDegree();
       cerr << "\t <# of Neighs: " << Node->getNumOfNeighbors() << ">\n";
     }
index 590c88fbc496aa92c05125abe44b25c6b5ae53ad..aef84310d3253fc21e26744c704ac3a53e48dd97 100644 (file)
@@ -12,7 +12,7 @@ using std::cerr;
 LiveRangeInfo::LiveRangeInfo(const Method *const M, 
                             const TargetMachine& tm,
                             std::vector<RegClass *> &RCL)
-                             : Meth(M), LiveRangeMap(), TM(tm),
+                             : Meth(M), TM(tm),
                                RegClassList(RCL), MRI(tm.getRegInfo())
 { }
 
@@ -48,18 +48,16 @@ LiveRangeInfo::~LiveRangeInfo() {
 // Note: the caller must make sure that L1 and L2 are distinct and both
 // LRs don't have suggested colors
 //---------------------------------------------------------------------------
-void LiveRangeInfo::unionAndUpdateLRs(LiveRange *const L1, LiveRange *L2)
-{
-  assert( L1 != L2);
-  L1->setUnion( L2 );                   // add elements of L2 to L1
-  ValueSet::iterator L2It;
 
-  for( L2It = L2->begin() ; L2It != L2->end(); ++L2It) {
+void LiveRangeInfo::unionAndUpdateLRs(LiveRange *L1, LiveRange *L2) {
+  assert(L1 != L2 && (!L1->hasSuggestedColor() || !L2->hasSuggestedColor()));
+  set_union(*L1, *L2);                   // add elements of L2 to L1
 
+  for(ValueSet::iterator L2It = L2->begin(); L2It != L2->end(); ++L2It) {
     //assert(( L1->getTypeID() == L2->getTypeID()) && "Merge:Different types");
 
     L1->insert(*L2It);                  // add the var in L2 to L1
-    LiveRangeMap[ *L2It ] = L1;         // now the elements in L2 should map 
+    LiveRangeMap[*L2It] = L1;         // now the elements in L2 should map 
                                         //to L1    
   }
 
@@ -69,15 +67,15 @@ void LiveRangeInfo::unionAndUpdateLRs(LiveRange *const L1, LiveRange *L2)
   // must have the same color.
 
   if(L2->hasSuggestedColor())
-    L1->setSuggestedColor( L2->getSuggestedColor() );
+    L1->setSuggestedColor(L2->getSuggestedColor());
 
 
-  if( L2->isCallInterference() )
+  if (L2->isCallInterference())
     L1->setCallInterference();
   
-  L1->addSpillCost( L2->getSpillCost() ); // add the spill costs
-
+  // add the spill costs
+  L1->addSpillCost(L2->getSpillCost());
+  
   delete L2;                        // delete L2 as it is no longer needed
 }
 
@@ -394,7 +392,7 @@ void LiveRangeInfo::printLiveRanges() {
   for( ; HMI != LiveRangeMap.end(); ++HMI) {
     if (HMI->first && HMI->second) {
       cerr << " " << RAV(HMI->first) << "\t: "; 
-      HMI->second->printSet(); cerr << "\n";
+      printSet(*HMI->second); cerr << "\n";
     }
   }
 }
index 90de8b969f1e386e65fbb8d7cb0c37485c823e83..938ab1b8512a222092ad6242574e1284c5f10371 100644 (file)
@@ -15,7 +15,7 @@
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineCodeForMethod.h"
 #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
-#include "llvm/Analysis/LiveVar/LiveVarSet.h"
+#include "llvm/Analysis/LiveVar/ValueSet.h"
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/MachineFrameInfo.h"
@@ -151,11 +151,11 @@ void PhyRegAlloc::createIGNodeListsAndIGs() {
 // class as that of live var. The live var passed to this function is the 
 // LVset AFTER the instruction
 //----------------------------------------------------------------------------
-void PhyRegAlloc::addInterference(const Value *const Def, 
-                                 const LiveVarSet *const LVSet,
-                                 const bool isCallInst) {
+void PhyRegAlloc::addInterference(const Value *Def, 
+                                 const ValueSet *LVSet,
+                                 bool isCallInst) {
 
-  LiveVarSet::const_iterator LIt = LVSet->begin();
+  ValueSet::const_iterator LIt = LVSet->begin();
 
   // get the live range of instruction
   //
@@ -207,7 +207,7 @@ void PhyRegAlloc::addInterference(const Value *const Def,
 //----------------------------------------------------------------------------
 
 void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst, 
-                                      const LiveVarSet *const LVSetAft ) {
+                                      const ValueSet *LVSetAft) {
 
   // Now find the LR of the return value of the call
   // We do this because, we look at the LV set *after* the instruction
@@ -226,7 +226,7 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst,
   if( DEBUG_RA)
     cerr << "\n For call inst: " << *MInst;
 
-  LiveVarSet::const_iterator LIt = LVSetAft->begin();
+  ValueSet::const_iterator LIt = LVSetAft->begin();
 
   // for each live var in live variable set after machine inst
   //
@@ -238,7 +238,7 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst,
 
     if( LR && DEBUG_RA) {
       cerr << "\n\tLR Aft Call: ";
-      LR->printSet();
+      printSet(*LR);
     }
    
 
@@ -249,7 +249,7 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst,
       LR->setCallInterference();
       if( DEBUG_RA) {
        cerr << "\n  ++Added call interf for LR: " ;
-       LR->printSet();
+       printSet(*LR);
       }
     }
 
@@ -293,8 +293,7 @@ void PhyRegAlloc::buildInterferenceGraphs()
 
       // get the LV set after the instruction
       //
-      const LiveVarSet *const LVSetAI = 
-       LVI->getLiveVarSetAfterMInst(MInst, *BBI);
+      const ValueSet *LVSetAI = LVI->getLiveVarSetAfterMInst(MInst, *BBI);
     
       const bool isCallInst = TM.getInstrInfo().isCall(MInst->getOpCode());
 
@@ -416,15 +415,14 @@ void PhyRegAlloc::addInterf4PseudoInstr(const MachineInstr *MInst) {
 //----------------------------------------------------------------------------
 // This method will add interferences for incoming arguments to a method.
 //----------------------------------------------------------------------------
-void PhyRegAlloc::addInterferencesForArgs()
-{
-                                              // get the InSet of root BB
-  const LiveVarSet *const InSet = LVI->getInSetOfBB( Meth->front() );  
+void PhyRegAlloc::addInterferencesForArgs() {
+  // get the InSet of root BB
+  const ValueSet *InSet = LVI->getInSetOfBB(Meth->front());  
 
-                                              // get the argument list
+  // get the argument list
   const Method::ArgumentListType& ArgList = Meth->getArgumentList();  
 
-                                              // get an iterator to arg list
+  // get an iterator to arg list
   Method::ArgumentListType::const_iterator ArgIt = ArgList.begin();          
 
 
@@ -683,7 +681,7 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
   unsigned RegType = MRI.getRegType( LR );
   int SpillOff = LR->getSpillOffFromFP();
   RegClass *RC = LR->getRegClass();
-  const LiveVarSet *LVSetBef =  LVI->getLiveVarSetBeforeMInst(MInst, BB);
+  const ValueSet *LVSetBef =  LVI->getLiveVarSetBeforeMInst(MInst, BB);
 
   mcInfo.pushTempValue(TM, MRI.getSpilledRegSize(RegType) );
   
@@ -715,10 +713,7 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
     if(MIAft)
       AI->InstrnsAfter.push_front(MIAft);
     
-    
-  } 
-  else {   // if this is a Def
-
+  } else {   // if this is a Def
     // for a DEF, we have to store the value produced by this instruction
     // on the stack position allocated for this LR
 
@@ -736,22 +731,17 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
   }  // if !DEF
 
   cerr << "\nFor Inst " << *MInst;
-  cerr << " - SPILLED LR: "; LR->printSet();
+  cerr << " - SPILLED LR: "; printSet(*LR);
   cerr << "\n - Added Instructions:";
-  if( MIBef ) cerr <<  *MIBef;
+  if (MIBef) cerr <<  *MIBef;
   cerr <<  *AdIMid;
-  if( MIAft ) cerr <<  *MIAft;
-
-  Op.setRegForValue( TmpRegU );    // set the opearnd
-
+  if (MIAft) cerr <<  *MIAft;
 
+  Op.setRegForValue(TmpRegU);    // set the opearnd
 }
 
 
 
-
-
-
 //----------------------------------------------------------------------------
 // We can use the following method to get a temporary register to be used
 // BEFORE any given machine instruction. If there is a register available,
@@ -764,7 +754,7 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
 int PhyRegAlloc::getUsableUniRegAtMI(RegClass *RC, 
                                  const int RegType,
                                  const MachineInstr *MInst, 
-                                 const LiveVarSet *LVSetBef,
+                                 const ValueSet *LVSetBef,
                                  MachineInstr *MIBef,
                                  MachineInstr *MIAft) {
 
@@ -801,7 +791,7 @@ int PhyRegAlloc::getUsableUniRegAtMI(RegClass *RC,
 //----------------------------------------------------------------------------
 int PhyRegAlloc::getUnusedUniRegAtMI(RegClass *RC, 
                                  const MachineInstr *MInst, 
-                                 const LiveVarSet *LVSetBef) {
+                                 const ValueSet *LVSetBef) {
 
   unsigned NumAvailRegs =  RC->getNumOfAvailRegs();
   
@@ -810,7 +800,7 @@ int PhyRegAlloc::getUnusedUniRegAtMI(RegClass *RC,
   for(unsigned i=0; i <  NumAvailRegs; i++)     // Reset array
       IsColorUsedArr[i] = false;
       
-  LiveVarSet::const_iterator LIt = LVSetBef->begin();
+  ValueSet::const_iterator LIt = LVSetBef->begin();
 
   // for each live var in live variable set after machine inst
   for( ; LIt != LVSetBef->end(); ++LIt) {
index a366c117109b69ac7477fe40ab4ddb6492fc80b8..c90ae4ae24192d357138fa4171ab5ca2b01a1ee1 100644 (file)
@@ -133,8 +133,8 @@ unsigned InterferenceGraph::getInterference(const LiveRange *const LR1,
 //            LiveRangeInfo::unionAndUpdateLRs for that purpose.
 //----------------------------------------------------------------------------
 
-void InterferenceGraph::mergeIGNodesOfLRs(const LiveRange *const LR1, 
-                                         LiveRange *const LR2 ) {
+void InterferenceGraph::mergeIGNodesOfLRs(const LiveRange *LR1, 
+                                         LiveRange *LR2) {
 
   assert( LR1 != LR2);                  // cannot merge the same live range
 
@@ -145,8 +145,8 @@ void InterferenceGraph::mergeIGNodesOfLRs(const LiveRange *const LR1,
   assertIGNode( SrcNode );
 
   if( DEBUG_RA > 1) {
-    cerr << "Merging LRs: \""; LR1->printSet(); 
-    cerr << "\" and \""; LR2->printSet();
+    cerr << "Merging LRs: \""; printSet(*LR1); 
+    cerr << "\" and \""; printSet(*LR2);
     cerr << "\"\n";
   }
 
@@ -236,7 +236,7 @@ void InterferenceGraph::printIGNodeList() const
 
     if (Node) {
       cerr << " [" << Node->getIndex() << "] ";
-      Node->getParentLR()->printSet(); 
+      printSet(*Node->getParentLR());
       //int Deg = Node->getCurDegree();
       cerr << "\t <# of Neighs: " << Node->getNumOfNeighbors() << ">\n";
     }
index 590c88fbc496aa92c05125abe44b25c6b5ae53ad..aef84310d3253fc21e26744c704ac3a53e48dd97 100644 (file)
@@ -12,7 +12,7 @@ using std::cerr;
 LiveRangeInfo::LiveRangeInfo(const Method *const M, 
                             const TargetMachine& tm,
                             std::vector<RegClass *> &RCL)
-                             : Meth(M), LiveRangeMap(), TM(tm),
+                             : Meth(M), TM(tm),
                                RegClassList(RCL), MRI(tm.getRegInfo())
 { }
 
@@ -48,18 +48,16 @@ LiveRangeInfo::~LiveRangeInfo() {
 // Note: the caller must make sure that L1 and L2 are distinct and both
 // LRs don't have suggested colors
 //---------------------------------------------------------------------------
-void LiveRangeInfo::unionAndUpdateLRs(LiveRange *const L1, LiveRange *L2)
-{
-  assert( L1 != L2);
-  L1->setUnion( L2 );                   // add elements of L2 to L1
-  ValueSet::iterator L2It;
 
-  for( L2It = L2->begin() ; L2It != L2->end(); ++L2It) {
+void LiveRangeInfo::unionAndUpdateLRs(LiveRange *L1, LiveRange *L2) {
+  assert(L1 != L2 && (!L1->hasSuggestedColor() || !L2->hasSuggestedColor()));
+  set_union(*L1, *L2);                   // add elements of L2 to L1
 
+  for(ValueSet::iterator L2It = L2->begin(); L2It != L2->end(); ++L2It) {
     //assert(( L1->getTypeID() == L2->getTypeID()) && "Merge:Different types");
 
     L1->insert(*L2It);                  // add the var in L2 to L1
-    LiveRangeMap[ *L2It ] = L1;         // now the elements in L2 should map 
+    LiveRangeMap[*L2It] = L1;         // now the elements in L2 should map 
                                         //to L1    
   }
 
@@ -69,15 +67,15 @@ void LiveRangeInfo::unionAndUpdateLRs(LiveRange *const L1, LiveRange *L2)
   // must have the same color.
 
   if(L2->hasSuggestedColor())
-    L1->setSuggestedColor( L2->getSuggestedColor() );
+    L1->setSuggestedColor(L2->getSuggestedColor());
 
 
-  if( L2->isCallInterference() )
+  if (L2->isCallInterference())
     L1->setCallInterference();
   
-  L1->addSpillCost( L2->getSpillCost() ); // add the spill costs
-
+  // add the spill costs
+  L1->addSpillCost(L2->getSpillCost());
+  
   delete L2;                        // delete L2 as it is no longer needed
 }
 
@@ -394,7 +392,7 @@ void LiveRangeInfo::printLiveRanges() {
   for( ; HMI != LiveRangeMap.end(); ++HMI) {
     if (HMI->first && HMI->second) {
       cerr << " " << RAV(HMI->first) << "\t: "; 
-      HMI->second->printSet(); cerr << "\n";
+      printSet(*HMI->second); cerr << "\n";
     }
   }
 }
index 90de8b969f1e386e65fbb8d7cb0c37485c823e83..938ab1b8512a222092ad6242574e1284c5f10371 100644 (file)
@@ -15,7 +15,7 @@
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineCodeForMethod.h"
 #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
-#include "llvm/Analysis/LiveVar/LiveVarSet.h"
+#include "llvm/Analysis/LiveVar/ValueSet.h"
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/MachineFrameInfo.h"
@@ -151,11 +151,11 @@ void PhyRegAlloc::createIGNodeListsAndIGs() {
 // class as that of live var. The live var passed to this function is the 
 // LVset AFTER the instruction
 //----------------------------------------------------------------------------
-void PhyRegAlloc::addInterference(const Value *const Def, 
-                                 const LiveVarSet *const LVSet,
-                                 const bool isCallInst) {
+void PhyRegAlloc::addInterference(const Value *Def, 
+                                 const ValueSet *LVSet,
+                                 bool isCallInst) {
 
-  LiveVarSet::const_iterator LIt = LVSet->begin();
+  ValueSet::const_iterator LIt = LVSet->begin();
 
   // get the live range of instruction
   //
@@ -207,7 +207,7 @@ void PhyRegAlloc::addInterference(const Value *const Def,
 //----------------------------------------------------------------------------
 
 void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst, 
-                                      const LiveVarSet *const LVSetAft ) {
+                                      const ValueSet *LVSetAft) {
 
   // Now find the LR of the return value of the call
   // We do this because, we look at the LV set *after* the instruction
@@ -226,7 +226,7 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst,
   if( DEBUG_RA)
     cerr << "\n For call inst: " << *MInst;
 
-  LiveVarSet::const_iterator LIt = LVSetAft->begin();
+  ValueSet::const_iterator LIt = LVSetAft->begin();
 
   // for each live var in live variable set after machine inst
   //
@@ -238,7 +238,7 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst,
 
     if( LR && DEBUG_RA) {
       cerr << "\n\tLR Aft Call: ";
-      LR->printSet();
+      printSet(*LR);
     }
    
 
@@ -249,7 +249,7 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst,
       LR->setCallInterference();
       if( DEBUG_RA) {
        cerr << "\n  ++Added call interf for LR: " ;
-       LR->printSet();
+       printSet(*LR);
       }
     }
 
@@ -293,8 +293,7 @@ void PhyRegAlloc::buildInterferenceGraphs()
 
       // get the LV set after the instruction
       //
-      const LiveVarSet *const LVSetAI = 
-       LVI->getLiveVarSetAfterMInst(MInst, *BBI);
+      const ValueSet *LVSetAI = LVI->getLiveVarSetAfterMInst(MInst, *BBI);
     
       const bool isCallInst = TM.getInstrInfo().isCall(MInst->getOpCode());
 
@@ -416,15 +415,14 @@ void PhyRegAlloc::addInterf4PseudoInstr(const MachineInstr *MInst) {
 //----------------------------------------------------------------------------
 // This method will add interferences for incoming arguments to a method.
 //----------------------------------------------------------------------------
-void PhyRegAlloc::addInterferencesForArgs()
-{
-                                              // get the InSet of root BB
-  const LiveVarSet *const InSet = LVI->getInSetOfBB( Meth->front() );  
+void PhyRegAlloc::addInterferencesForArgs() {
+  // get the InSet of root BB
+  const ValueSet *InSet = LVI->getInSetOfBB(Meth->front());  
 
-                                              // get the argument list
+  // get the argument list
   const Method::ArgumentListType& ArgList = Meth->getArgumentList();  
 
-                                              // get an iterator to arg list
+  // get an iterator to arg list
   Method::ArgumentListType::const_iterator ArgIt = ArgList.begin();          
 
 
@@ -683,7 +681,7 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
   unsigned RegType = MRI.getRegType( LR );
   int SpillOff = LR->getSpillOffFromFP();
   RegClass *RC = LR->getRegClass();
-  const LiveVarSet *LVSetBef =  LVI->getLiveVarSetBeforeMInst(MInst, BB);
+  const ValueSet *LVSetBef =  LVI->getLiveVarSetBeforeMInst(MInst, BB);
 
   mcInfo.pushTempValue(TM, MRI.getSpilledRegSize(RegType) );
   
@@ -715,10 +713,7 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
     if(MIAft)
       AI->InstrnsAfter.push_front(MIAft);
     
-    
-  } 
-  else {   // if this is a Def
-
+  } else {   // if this is a Def
     // for a DEF, we have to store the value produced by this instruction
     // on the stack position allocated for this LR
 
@@ -736,22 +731,17 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
   }  // if !DEF
 
   cerr << "\nFor Inst " << *MInst;
-  cerr << " - SPILLED LR: "; LR->printSet();
+  cerr << " - SPILLED LR: "; printSet(*LR);
   cerr << "\n - Added Instructions:";
-  if( MIBef ) cerr <<  *MIBef;
+  if (MIBef) cerr <<  *MIBef;
   cerr <<  *AdIMid;
-  if( MIAft ) cerr <<  *MIAft;
-
-  Op.setRegForValue( TmpRegU );    // set the opearnd
-
+  if (MIAft) cerr <<  *MIAft;
 
+  Op.setRegForValue(TmpRegU);    // set the opearnd
 }
 
 
 
-
-
-
 //----------------------------------------------------------------------------
 // We can use the following method to get a temporary register to be used
 // BEFORE any given machine instruction. If there is a register available,
@@ -764,7 +754,7 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
 int PhyRegAlloc::getUsableUniRegAtMI(RegClass *RC, 
                                  const int RegType,
                                  const MachineInstr *MInst, 
-                                 const LiveVarSet *LVSetBef,
+                                 const ValueSet *LVSetBef,
                                  MachineInstr *MIBef,
                                  MachineInstr *MIAft) {
 
@@ -801,7 +791,7 @@ int PhyRegAlloc::getUsableUniRegAtMI(RegClass *RC,
 //----------------------------------------------------------------------------
 int PhyRegAlloc::getUnusedUniRegAtMI(RegClass *RC, 
                                  const MachineInstr *MInst, 
-                                 const LiveVarSet *LVSetBef) {
+                                 const ValueSet *LVSetBef) {
 
   unsigned NumAvailRegs =  RC->getNumOfAvailRegs();
   
@@ -810,7 +800,7 @@ int PhyRegAlloc::getUnusedUniRegAtMI(RegClass *RC,
   for(unsigned i=0; i <  NumAvailRegs; i++)     // Reset array
       IsColorUsedArr[i] = false;
       
-  LiveVarSet::const_iterator LIt = LVSetBef->begin();
+  ValueSet::const_iterator LIt = LVSetBef->begin();
 
   // for each live var in live variable set after machine inst
   for( ; LIt != LVSetBef->end(); ++LIt) {
index 5e02aaf921112670c4d786d56ca3a66d0e05b854..96ff39ef046ffcebb6bc358fb6512d76482ad572 100644 (file)
@@ -38,7 +38,7 @@ void SparcIntRegClass::colorIGNode(IGNode * Node, bool IsColorUsedArr[]) const {
 
   if( DEBUG_RA ) {
     cerr << "\nColoring LR [CallInt=" << LR->isCallInterference() <<"]:"; 
-    LR->printSet();
+    printSet(*LR);
   }
 
   if( LR->hasSuggestedColor() ) {
@@ -64,7 +64,7 @@ void SparcIntRegClass::colorIGNode(IGNode * Node, bool IsColorUsedArr[]) const {
     }
     else if ( DEBUG_RA ) {                // can't allocate the suggested col
       cerr << "  \n  Could NOT allocate the suggested color (already used) ";
-      LR->printSet(); cerr << "\n";
+      printSet(*LR); cerr << "\n";
     }
   }
 
@@ -185,10 +185,9 @@ void SparcFloatRegClass::colorIGNode(IGNode * Node,bool IsColorUsedArr[]) const
     if( ! IsColorUsedArr[ LR->getSuggestedColor() ] ) {
       LR->setColor(  LR->getSuggestedColor() );
       return;
-    }
-    else if (DEBUG_RA)  {                 // can't allocate the suggested col
+    } else if (DEBUG_RA)  {                 // can't allocate the suggested col
       cerr << " Could NOT allocate the suggested color for LR ";
-      LR->printSet(); cerr << "\n";
+      printSet(*LR); cerr << "\n";
     }
   }
 
index 6e2c1b0cd67cf44b010c8d7fd41778865e81862e..879b01efc447c9eae39250f18bf5f3be768626e8 100644 (file)
@@ -11,7 +11,7 @@
 #include "llvm/CodeGen/MachineCodeForMethod.h"
 #include "llvm/CodeGen/PhyRegAlloc.h"
 #include "llvm/CodeGen/MachineInstr.h"
-#include "llvm/Analysis/LiveVar/LiveVarSet.h"
+#include "llvm/Analysis/LiveVar/ValueSet.h"
 #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
 #include "llvm/iTerminators.h"
 #include "llvm/iOther.h"
@@ -1252,8 +1252,8 @@ void UltraSparcRegInfo::insertCallerSavingCode(const MachineInstr *MInst,
   }
 
 
-  const LiveVarSet *LVSetAft =  PRA.LVI->getLiveVarSetAfterMInst(MInst, BB);
-  LiveVarSet::const_iterator LIt = LVSetAft->begin();
+  const ValueSet *LVSetAft =  PRA.LVI->getLiveVarSetAfterMInst(MInst, BB);
+  ValueSet::const_iterator LIt = LVSetAft->begin();
 
   // for each live var in live variable set after machine inst
   for( ; LIt != LVSetAft->end(); ++LIt) {
@@ -1303,7 +1303,7 @@ void UltraSparcRegInfo::insertCallerSavingCode(const MachineInstr *MInst,
              // Handle IntCCRegType specially since we cannot directly 
              // push %ccr on to the stack
 
-             const LiveVarSet *LVSetBef = 
+             const ValueSet *LVSetBef = 
                PRA.LVI->getLiveVarSetBeforeMInst(MInst, BB);
 
              // get a free INTEGER register