diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-27 07:27:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-27 07:27:19 +0000 |
commit | 483e14ee0412a98db1fb0121528d8d621ae3dfdb (patch) | |
tree | ac49b8e451a1a70cfebad3a753f5999ac06f4d06 /lib/Target | |
parent | 3b743f9fb3dc95aabc54d17cafe1b393b76b943c (diff) |
s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/SparcV9/InstrSched/InstrScheduling.cpp | 6 | ||||
-rw-r--r-- | lib/Target/SparcV9/InstrSched/SchedPriorities.cpp | 8 | ||||
-rw-r--r-- | lib/Target/SparcV9/InstrSched/SchedPriorities.h | 8 | ||||
-rw-r--r-- | lib/Target/SparcV9/LiveVar/BBLiveVar.cpp | 2 | ||||
-rw-r--r-- | lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp | 27 | ||||
-rw-r--r-- | lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp | 8 | ||||
-rw-r--r-- | lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h | 10 | ||||
-rw-r--r-- | lib/Target/SparcV9/SparcV9RegInfo.cpp | 2 |
8 files changed, 36 insertions, 35 deletions
diff --git a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp index adc8903541..4c2a28c788 100644 --- a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp +++ b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp @@ -9,7 +9,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineCodeForInstruction.h" #include "llvm/CodeGen/MachineCodeForMethod.h" -#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" // FIXME: Remove when AnalysisUsage sets can be symbolic! +#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" // FIXME: Remove when modularized better #include "llvm/Target/TargetMachine.h" #include "llvm/BasicBlock.h" #include "llvm/Instruction.h" @@ -1487,7 +1487,7 @@ namespace { // getAnalysisUsage - We use LiveVarInfo... virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(MethodLiveVarInfo::ID); + AU.addRequired(FunctionLiveVarInfo::ID); } bool runOnFunction(Function *F); @@ -1521,7 +1521,7 @@ InstructionSchedulingWithSSA::runOnFunction(Function *M) cerr << "\n*** TRACE OF INSTRUCTION SCHEDULING OPERATIONS\n\n"; // expensive! - SchedPriorities schedPrio(M, graph,getAnalysis<MethodLiveVarInfo>()); + SchedPriorities schedPrio(M, graph,getAnalysis<FunctionLiveVarInfo>()); SchedulingManager S(target, graph, schedPrio); ChooseInstructionsForDelaySlots(S, bb, graph); // modifies graph diff --git a/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp b/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp index 02e50c0cc7..a4480e8865 100644 --- a/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp +++ b/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp @@ -19,14 +19,14 @@ //**************************************************************************/ #include "SchedPriorities.h" -#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" +#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" #include "llvm/Support/CFG.h" #include "Support/PostOrderIterator.h" #include <iostream> using std::cerr; SchedPriorities::SchedPriorities(const Function *, const SchedGraph *G, - MethodLiveVarInfo &LVI) + FunctionLiveVarInfo &LVI) : curTime(0), graph(G), methodLiveVarInfo(LVI), nodeDelayVec(G->getNumNodes(), INVALID_LATENCY), // make errors obvious earliestForNode(G->getNumNodes(), 0), @@ -266,7 +266,7 @@ SchedPriorities::findSetWithMaxDelay(std::vector<candIndex>& mcands, bool -SchedPriorities::instructionHasLastUse(MethodLiveVarInfo& methodLiveVarInfo, +SchedPriorities::instructionHasLastUse(FunctionLiveVarInfo &LVI, const SchedGraphNode* graphNode) { const MachineInstr *MI = graphNode->getMachineInstr(); @@ -278,7 +278,7 @@ SchedPriorities::instructionHasLastUse(MethodLiveVarInfo& methodLiveVarInfo, // else check if instruction is a last use and save it in the hash_map bool hasLastUse = false; const BasicBlock* bb = graphNode->getBB(); - const ValueSet &LVs = methodLiveVarInfo.getLiveVarSetBeforeMInst(MI, bb); + const ValueSet &LVs = LVI.getLiveVarSetBeforeMInst(MI, bb); for (MachineInstr::const_val_op_iterator OI = MI->begin(), OE = MI->end(); OI != OE; ++OI) diff --git a/lib/Target/SparcV9/InstrSched/SchedPriorities.h b/lib/Target/SparcV9/InstrSched/SchedPriorities.h index c76beadcb5..3f087d5224 100644 --- a/lib/Target/SparcV9/InstrSched/SchedPriorities.h +++ b/lib/Target/SparcV9/InstrSched/SchedPriorities.h @@ -31,7 +31,7 @@ class Function; class MachineInstr; class SchedulingManager; -class MethodLiveVarInfo; +class FunctionLiveVarInfo; //--------------------------------------------------------------------------- // Debug option levels for instruction scheduling @@ -127,7 +127,7 @@ private: class SchedPriorities: public NonCopyable { public: SchedPriorities(const Function *F, const SchedGraph *G, - MethodLiveVarInfo &LVI); + FunctionLiveVarInfo &LVI); // This must be called before scheduling begins. @@ -157,7 +157,7 @@ private: private: cycles_t curTime; const SchedGraph* graph; - MethodLiveVarInfo &methodLiveVarInfo; + FunctionLiveVarInfo &methodLiveVarInfo; std::hash_map<const MachineInstr*, bool> lastUseMap; std::vector<cycles_t> nodeDelayVec; std::vector<cycles_t> earliestForNode; @@ -180,7 +180,7 @@ private: void initializeReadyHeap (const SchedGraph* graph); - bool instructionHasLastUse (MethodLiveVarInfo& methodLiveVarInfo, + bool instructionHasLastUse (FunctionLiveVarInfo& LVI, const SchedGraphNode* graphNode); // NOTE: The next two return references to the actual vector entries. diff --git a/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp b/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp index 5217bf52a5..958f7d7c66 100644 --- a/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp +++ b/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp @@ -5,7 +5,7 @@ //===----------------------------------------------------------------------===// #include "BBLiveVar.h" -#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" +#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/BasicBlock.h" #include "llvm/Support/CFG.h" diff --git a/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp b/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp index 0518aef3b8..58d4691b76 100644 --- a/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp +++ b/lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp @@ -5,7 +5,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" +#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" #include "BBLiveVar.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/BasicBlock.h" @@ -14,7 +14,7 @@ #include "Support/SetOperations.h" #include <iostream> -AnalysisID MethodLiveVarInfo::ID(AnalysisID::create<MethodLiveVarInfo>()); +AnalysisID FunctionLiveVarInfo::ID(AnalysisID::create<FunctionLiveVarInfo>()); cl::Enum<LiveVarDebugLevel_t> DEBUG_LV("dlivevar", cl::NoFlags, "enable live-variable debugging information", @@ -28,12 +28,12 @@ cl::Enum<LiveVarDebugLevel_t> DEBUG_LV("dlivevar", cl::NoFlags, //----------------------------------------------------------------------------- // gets OutSet of a BB -const ValueSet &MethodLiveVarInfo::getOutSetOfBB(const BasicBlock *BB) const { +const ValueSet &FunctionLiveVarInfo::getOutSetOfBB(const BasicBlock *BB) const { return BBLiveVar::GetFromBB(BB)->getOutSet(); } // gets InSet of a BB -const ValueSet &MethodLiveVarInfo::getInSetOfBB(const BasicBlock *BB) const { +const ValueSet &FunctionLiveVarInfo::getInSetOfBB(const BasicBlock *BB) const { return BBLiveVar::GetFromBB(BB)->getInSet(); } @@ -42,7 +42,7 @@ const ValueSet &MethodLiveVarInfo::getInSetOfBB(const BasicBlock *BB) const { // Performs live var analysis for a function //----------------------------------------------------------------------------- -bool MethodLiveVarInfo::runOnFunction(Function *Meth) { +bool FunctionLiveVarInfo::runOnFunction(Function *Meth) { M = Meth; if (DEBUG_LV) std::cerr << "Analysing live variables ...\n"; @@ -62,7 +62,7 @@ bool MethodLiveVarInfo::runOnFunction(Function *Meth) { // constructs BBLiveVars and init Def and In sets //----------------------------------------------------------------------------- -void MethodLiveVarInfo::constructBBs(const Function *M) { +void FunctionLiveVarInfo::constructBBs(const Function *M) { unsigned int POId = 0; // Reverse Depth-first Order ID for(po_iterator<const Function*> BBI = po_begin(M), BBE = po_end(M); @@ -94,7 +94,8 @@ void MethodLiveVarInfo::constructBBs(const Function *M) { // do one backward pass over the CFG (for iterative analysis) //----------------------------------------------------------------------------- -bool MethodLiveVarInfo::doSingleBackwardPass(const Function *M, unsigned iter) { +bool FunctionLiveVarInfo::doSingleBackwardPass(const Function *M, + unsigned iter) { if (DEBUG_LV) std::cerr << "\n After Backward Pass " << iter << "...\n"; bool NeedAnotherIteration = false; @@ -122,7 +123,7 @@ bool MethodLiveVarInfo::doSingleBackwardPass(const Function *M, unsigned iter) { } -void MethodLiveVarInfo::releaseMemory() { +void FunctionLiveVarInfo::releaseMemory() { // First remove all BBLiveVar annotations created in constructBBs(). if (M) for (Function::const_iterator I = M->begin(), E = M->end(); I != E; ++I) @@ -163,8 +164,8 @@ void MethodLiveVarInfo::releaseMemory() { //----------------------------------------------------------------------------- const ValueSet & -MethodLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *MInst, - const BasicBlock *BB) { +FunctionLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *MInst, + const BasicBlock *BB) { if (const ValueSet *LVSet = MInst2LVSetBI[MInst]) { return *LVSet; // if found, just return the set } else { @@ -178,8 +179,8 @@ MethodLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *MInst, // Gives live variable information after a machine instruction //----------------------------------------------------------------------------- const ValueSet & -MethodLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *MI, - const BasicBlock *BB) { +FunctionLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *MI, + const BasicBlock *BB) { if (const ValueSet *LVSet = MInst2LVSetAI[MI]) { return *LVSet; // if found, just return the set @@ -227,7 +228,7 @@ static void applyTranferFuncForMInst(ValueSet &LVS, const MachineInstr *MInst) { // variable sets into a the caches (MInst2LVSetAI, MInst2LVSetBI) //----------------------------------------------------------------------------- -void MethodLiveVarInfo::calcLiveVarSetsForBB(const BasicBlock *BB) { +void FunctionLiveVarInfo::calcLiveVarSetsForBB(const BasicBlock *BB) { const MachineCodeForBasicBlock &MIVec = BB->getMachineInstrVec(); if (DEBUG_LV >= LV_DEBUG_Instr) diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp index c22ede96b3..4f12d697b1 100644 --- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp +++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp @@ -14,7 +14,7 @@ #include "llvm/CodeGen/PhyRegAlloc.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineCodeForMethod.h" -#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" +#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/MachineFrameInfo.h" @@ -50,7 +50,7 @@ namespace { cerr << "\n******************** Function "<< F->getName() << " ********************\n"; - PhyRegAlloc PRA(F, Target, &getAnalysis<MethodLiveVarInfo>(), + PhyRegAlloc PRA(F, Target, &getAnalysis<FunctionLiveVarInfo>(), &getAnalysis<cfg::LoopInfo>()); PRA.allocateRegisters(); @@ -60,7 +60,7 @@ namespace { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(cfg::LoopInfo::ID); - AU.addRequired(MethodLiveVarInfo::ID); + AU.addRequired(FunctionLiveVarInfo::ID); } }; } @@ -74,7 +74,7 @@ Pass *getRegisterAllocator(TargetMachine &T) { //---------------------------------------------------------------------------- PhyRegAlloc::PhyRegAlloc(Function *F, const TargetMachine& tm, - MethodLiveVarInfo *Lvi, + FunctionLiveVarInfo *Lvi, cfg::LoopInfo *LDC) : TM(tm), Meth(F), mcInfo(MachineCodeForMethod::get(F)), diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h index 5922497f11..5cc01c6765 100644 --- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h +++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h @@ -17,13 +17,13 @@ Register allocation must be done as: - MethodLiveVarInfo LVI(*MethodI ); // compute LV info + FunctionLiveVarInfo LVI(*FunctionI ); // compute LV info LVI.analyze(); TargetMachine &target = .... - PhyRegAlloc PRA(*MethodI, target, &LVI); // allocate regs + PhyRegAlloc PRA(*FunctionI, target, &LVI); // allocate regs PRA.allocateRegisters(); */ @@ -35,7 +35,7 @@ #include <deque> class MachineCodeForMethod; class MachineRegInfo; -class MethodLiveVarInfo; +class FunctionLiveVarInfo; class MachineInstr; namespace cfg { class LoopInfo; } @@ -70,7 +70,7 @@ class PhyRegAlloc: public NonCopyable { const TargetMachine &TM; // target machine const Function *Meth; // name of the function we work on MachineCodeForMethod &mcInfo; // descriptor for method's native code - MethodLiveVarInfo *const LVI; // LV information for this method + FunctionLiveVarInfo *const LVI; // LV information for this method // (already computed for BBs) LiveRangeInfo LRI; // LR info (will be computed) const MachineRegInfo &MRI; // Machine Register information @@ -84,7 +84,7 @@ class PhyRegAlloc: public NonCopyable { // currently not used public: - PhyRegAlloc(Function *F, const TargetMachine& TM, MethodLiveVarInfo *Lvi, + PhyRegAlloc(Function *F, const TargetMachine& TM, FunctionLiveVarInfo *Lvi, cfg::LoopInfo *LoopDepthCalc); ~PhyRegAlloc(); diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp index ad66a3482c..ad0dd25685 100644 --- a/lib/Target/SparcV9/SparcV9RegInfo.cpp +++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp @@ -11,7 +11,7 @@ #include "llvm/CodeGen/MachineCodeForMethod.h" #include "llvm/CodeGen/PhyRegAlloc.h" #include "llvm/CodeGen/MachineInstr.h" -#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" +#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h" #include "llvm/iTerminators.h" #include "llvm/iOther.h" #include "llvm/Function.h" |