From 3e0f8288e774a88d837329d8f70c02fcbb7e3c69 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 4 Feb 2002 17:38:48 +0000 Subject: [PATCH] Make #include "llvm/Analysis/LoopDepth.h" be an internal artifact of how register allocation is implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1693 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RegAlloc/PhyRegAlloc.h | 27 +++++++++++------------ lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h | 27 +++++++++++------------ 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.h b/lib/CodeGen/RegAlloc/PhyRegAlloc.h index 38f8dd774b7..8efa7570267 100644 --- a/lib/CodeGen/RegAlloc/PhyRegAlloc.h +++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.h @@ -32,12 +32,12 @@ #include "llvm/CodeGen/RegClass.h" #include "llvm/CodeGen/LiveRangeInfo.h" -#include "llvm/Analysis/LoopDepth.h" #include class MachineCodeForMethod; class MachineRegInfo; class MethodLiveVarInfo; class MachineInstr; +namespace cfg { class LoopDepthCalculator; } //---------------------------------------------------------------------------- // Class AddedInstrns: @@ -66,8 +66,7 @@ typedef std::hash_map AddedInstrMapType; //---------------------------------------------------------------------------- -class PhyRegAlloc: public NonCopyable -{ +class PhyRegAlloc: public NonCopyable { std::vector RegClassList; // vector of register classes const TargetMachine &TM; // target machine @@ -81,10 +80,20 @@ class PhyRegAlloc: public NonCopyable AddedInstrMapType AddedInstrMap; // to store instrns added in this phase - cfg::LoopDepthCalculator LoopDepthCalc; // to calculate loop depths + cfg::LoopDepthCalculator *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); + ~PhyRegAlloc(); + + // main method called for allocating registers + // + void allocateRegisters(); +private: + //------- ------------------ private methods--------------------------------- @@ -134,16 +143,6 @@ class PhyRegAlloc: public NonCopyable int getUniRegNotUsedByThisInst(RegClass *RC, const MachineInstr *MInst); void addInterf4PseudoInstr(const MachineInstr *MInst); - - public: - PhyRegAlloc(Method *const M, const TargetMachine& TM, - MethodLiveVarInfo *const Lvi); - ~PhyRegAlloc(); - - // main method called for allocating registers - // - void allocateRegisters(); - }; diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h index 38f8dd774b7..8efa7570267 100644 --- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h +++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h @@ -32,12 +32,12 @@ #include "llvm/CodeGen/RegClass.h" #include "llvm/CodeGen/LiveRangeInfo.h" -#include "llvm/Analysis/LoopDepth.h" #include class MachineCodeForMethod; class MachineRegInfo; class MethodLiveVarInfo; class MachineInstr; +namespace cfg { class LoopDepthCalculator; } //---------------------------------------------------------------------------- // Class AddedInstrns: @@ -66,8 +66,7 @@ typedef std::hash_map AddedInstrMapType; //---------------------------------------------------------------------------- -class PhyRegAlloc: public NonCopyable -{ +class PhyRegAlloc: public NonCopyable { std::vector RegClassList; // vector of register classes const TargetMachine &TM; // target machine @@ -81,10 +80,20 @@ class PhyRegAlloc: public NonCopyable AddedInstrMapType AddedInstrMap; // to store instrns added in this phase - cfg::LoopDepthCalculator LoopDepthCalc; // to calculate loop depths + cfg::LoopDepthCalculator *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); + ~PhyRegAlloc(); + + // main method called for allocating registers + // + void allocateRegisters(); +private: + //------- ------------------ private methods--------------------------------- @@ -134,16 +143,6 @@ class PhyRegAlloc: public NonCopyable int getUniRegNotUsedByThisInst(RegClass *RC, const MachineInstr *MInst); void addInterf4PseudoInstr(const MachineInstr *MInst); - - public: - PhyRegAlloc(Method *const M, const TargetMachine& TM, - MethodLiveVarInfo *const Lvi); - ~PhyRegAlloc(); - - // main method called for allocating registers - // - void allocateRegisters(); - };