Switch register allocator over to using LoopInfo directly instead of indirectly throu...
authorChris Lattner <sabre@nondot.org>
Mon, 4 Feb 2002 17:48:00 +0000 (17:48 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 4 Feb 2002 17:48:00 +0000 (17:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1696 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
lib/CodeGen/RegAlloc/PhyRegAlloc.h
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h

index 946a1e9c1b50f6216e39bc0ed5679f2fd5c6f201..1ce41fda430b0f9fd4d7aa9d2e40f743f526900b 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/LoopDepth.h"
+#include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/MachineFrameInfo.h"
 #include "llvm/Method.h"
@@ -52,7 +52,7 @@ namespace {
       LVI.analyze();
       
       PhyRegAlloc PRA(M, Target, &LVI,
-                      &getAnalysis<cfg::LoopDepthCalculator>());
+                      &getAnalysis<cfg::LoopInfo>());
       PRA.allocateRegisters();
       
       if (DEBUG_RA) cerr << "\nRegister allocation complete!\n";
@@ -62,7 +62,7 @@ namespace {
     virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Requires,
                                       Pass::AnalysisSet &Destroyed,
                                       Pass::AnalysisSet &Provided) {
-      Requires.push_back(cfg::LoopDepthCalculator::ID);
+      Requires.push_back(cfg::LoopInfo::ID);
     }
   };
 }
@@ -77,7 +77,7 @@ MethodPass *getRegisterAllocator(TargetMachine &T) {
 PhyRegAlloc::PhyRegAlloc(Method *M, 
                         const TargetMachine& tm, 
                         MethodLiveVarInfo *Lvi,
-                         cfg::LoopDepthCalculator *LDC) 
+                         cfg::LoopInfo *LDC) 
                        :  TM(tm), Meth(M),
                           mcInfo(MachineCodeForMethod::get(M)),
                           LVI(Lvi), LRI(M, tm, RegClassList), 
index 8efa757026776cb359fef2ff116455f2a6b1caa7..de8d7938388e5f4957d7ccefb5d213c77b7b68e5 100644 (file)
@@ -37,7 +37,7 @@ class MachineCodeForMethod;
 class MachineRegInfo;
 class MethodLiveVarInfo;
 class MachineInstr;
-namespace cfg { class LoopDepthCalculator; }
+namespace cfg { class LoopInfo; }
 
 //----------------------------------------------------------------------------
 // Class AddedInstrns:
@@ -80,13 +80,13 @@ class PhyRegAlloc: public NonCopyable {
 
   
   AddedInstrMapType AddedInstrMap;      // to store instrns added in this phase
-  cfg::LoopDepthCalculator *LoopDepthCalc;    // to calculate loop depths 
+  cfg::LoopInfo *LoopDepthCalc;         // to calculate loop depths 
   ReservedColorListType ResColList;     // A set of reserved regs if desired.
                                         // currently not used
 
 public:
   PhyRegAlloc(Method *M, const TargetMachine& TM, MethodLiveVarInfo *Lvi,
-              cfg::LoopDepthCalculator *LoopDepthCalc);
+              cfg::LoopInfo *LoopDepthCalc);
   ~PhyRegAlloc();
 
   // main method called for allocating registers
index 946a1e9c1b50f6216e39bc0ed5679f2fd5c6f201..1ce41fda430b0f9fd4d7aa9d2e40f743f526900b 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/LoopDepth.h"
+#include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/MachineFrameInfo.h"
 #include "llvm/Method.h"
@@ -52,7 +52,7 @@ namespace {
       LVI.analyze();
       
       PhyRegAlloc PRA(M, Target, &LVI,
-                      &getAnalysis<cfg::LoopDepthCalculator>());
+                      &getAnalysis<cfg::LoopInfo>());
       PRA.allocateRegisters();
       
       if (DEBUG_RA) cerr << "\nRegister allocation complete!\n";
@@ -62,7 +62,7 @@ namespace {
     virtual void getAnalysisUsageInfo(Pass::AnalysisSet &Requires,
                                       Pass::AnalysisSet &Destroyed,
                                       Pass::AnalysisSet &Provided) {
-      Requires.push_back(cfg::LoopDepthCalculator::ID);
+      Requires.push_back(cfg::LoopInfo::ID);
     }
   };
 }
@@ -77,7 +77,7 @@ MethodPass *getRegisterAllocator(TargetMachine &T) {
 PhyRegAlloc::PhyRegAlloc(Method *M, 
                         const TargetMachine& tm, 
                         MethodLiveVarInfo *Lvi,
-                         cfg::LoopDepthCalculator *LDC) 
+                         cfg::LoopInfo *LDC) 
                        :  TM(tm), Meth(M),
                           mcInfo(MachineCodeForMethod::get(M)),
                           LVI(Lvi), LRI(M, tm, RegClassList), 
index 8efa757026776cb359fef2ff116455f2a6b1caa7..de8d7938388e5f4957d7ccefb5d213c77b7b68e5 100644 (file)
@@ -37,7 +37,7 @@ class MachineCodeForMethod;
 class MachineRegInfo;
 class MethodLiveVarInfo;
 class MachineInstr;
-namespace cfg { class LoopDepthCalculator; }
+namespace cfg { class LoopInfo; }
 
 //----------------------------------------------------------------------------
 // Class AddedInstrns:
@@ -80,13 +80,13 @@ class PhyRegAlloc: public NonCopyable {
 
   
   AddedInstrMapType AddedInstrMap;      // to store instrns added in this phase
-  cfg::LoopDepthCalculator *LoopDepthCalc;    // to calculate loop depths 
+  cfg::LoopInfo *LoopDepthCalc;         // to calculate loop depths 
   ReservedColorListType ResColList;     // A set of reserved regs if desired.
                                         // currently not used
 
 public:
   PhyRegAlloc(Method *M, const TargetMachine& TM, MethodLiveVarInfo *Lvi,
-              cfg::LoopDepthCalculator *LoopDepthCalc);
+              cfg::LoopInfo *LoopDepthCalc);
   ~PhyRegAlloc();
 
   // main method called for allocating registers