Use newly added API in MRegisterInfo and don't expose the allocatable
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Thu, 26 Aug 2004 22:23:32 +0000 (22:23 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Thu, 26 Aug 2004 22:23:32 +0000 (22:23 +0000)
register set anymore. Its users now use the MRegisterInfo API.

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

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

index 4eec1d66120216bb4165d8bd9c4066fe632a4f25..7820f7414d4f2db87e59e62bcb07aeefa9d01869 100644 (file)
@@ -231,10 +231,6 @@ public:
   /// register.
   VarInfo &getVarInfo(unsigned RegIdx);
 
-  const std::vector<bool>& getAllocatablePhysicalRegisters() const {
-    return AllocatablePhysicalRegisters;
-  }
-
   void MarkVirtRegAliveInBlock(VarInfo &VRInfo, MachineBasicBlock *BB);
   void HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB,
                                MachineInstr *MI);
index 0bdf86406f104cab9b127fed994f2017a148bb2e..b6d9bc2a6015ff7987f5ab6eb27fc366a0443fa6 100644 (file)
@@ -148,19 +148,7 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) {
   RegInfo = MF.getTarget().getRegisterInfo();
   assert(RegInfo && "Target doesn't have register information?");
 
-  // First time though, initialize AllocatablePhysicalRegisters for the target
-  if (AllocatablePhysicalRegisters.empty()) {
-    // Make space, initializing to false...
-    AllocatablePhysicalRegisters.resize(RegInfo->getNumRegs());
-
-    // Loop over all of the register classes...
-    for (MRegisterInfo::regclass_iterator RCI = RegInfo->regclass_begin(),
-           E = RegInfo->regclass_end(); RCI != E; ++RCI)
-      // Loop over all of the allocatable registers in the function...
-      for (TargetRegisterClass::iterator I = (*RCI)->allocation_order_begin(MF),
-             E = (*RCI)->allocation_order_end(MF); I != E; ++I)
-        AllocatablePhysicalRegisters[*I] = true;  // The reg is allocatable!
-  }
+  AllocatablePhysicalRegisters = RegInfo->getAllocatableSet(MF);
 
   // PhysRegInfo - Keep track of which instruction was the last use of a
   // physical register.  This is a purely local property, because all physical