s/Method/Function
authorChris Lattner <sabre@nondot.org>
Sat, 27 Apr 2002 07:27:19 +0000 (07:27 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 27 Apr 2002 07:27:19 +0000 (07:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2336 91177308-0d34-0410-b5e6-96231b3b80d8

24 files changed:
include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h
include/llvm/CodeGen/FunctionLiveVarInfo.h
lib/Analysis/LiveVar/BBLiveVar.cpp
lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
lib/Analysis/PostDominators.cpp
lib/CodeGen/InstrSched/InstrScheduling.cpp
lib/CodeGen/InstrSched/SchedPriorities.cpp
lib/CodeGen/InstrSched/SchedPriorities.h
lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
lib/CodeGen/RegAlloc/PhyRegAlloc.h
lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
lib/Target/SparcV9/InstrSched/SchedPriorities.h
lib/Target/SparcV9/LiveVar/BBLiveVar.cpp
lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h
lib/Target/SparcV9/SparcV9RegInfo.cpp
lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
lib/Transforms/Utils/CloneFunction.cpp
lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
lib/VMCore/Dominators.cpp
tools/opt/opt.cpp

index eabae4bddcdd26224e545e2dde7a8bd53733733b..4f7db3fb88f96d0e2af76e8c1a051a18c1a7ae28 100644 (file)
@@ -79,7 +79,7 @@ enum LiveVarDebugLevel_t {
 extern cl::Enum<LiveVarDebugLevel_t> DEBUG_LV;
 
 
-class MethodLiveVarInfo : public FunctionPass {
+class FunctionLiveVarInfo : public FunctionPass {
   // Machine Instr to LiveVarSet Map for providing LVset BEFORE each inst
   std::map<const MachineInstr *, const ValueSet *> MInst2LVSetBI; 
 
@@ -103,7 +103,7 @@ class MethodLiveVarInfo : public FunctionPass {
 public:
   static AnalysisID ID;    // We are an analysis, we must have an ID
 
-  MethodLiveVarInfo(AnalysisID id = ID) { assert(id == ID); }
+  FunctionLiveVarInfo(AnalysisID id = ID) { assert(id == ID); }
 
   // --------- Implement the FunctionPass interface ----------------------
 
index eabae4bddcdd26224e545e2dde7a8bd53733733b..4f7db3fb88f96d0e2af76e8c1a051a18c1a7ae28 100644 (file)
@@ -79,7 +79,7 @@ enum LiveVarDebugLevel_t {
 extern cl::Enum<LiveVarDebugLevel_t> DEBUG_LV;
 
 
-class MethodLiveVarInfo : public FunctionPass {
+class FunctionLiveVarInfo : public FunctionPass {
   // Machine Instr to LiveVarSet Map for providing LVset BEFORE each inst
   std::map<const MachineInstr *, const ValueSet *> MInst2LVSetBI; 
 
@@ -103,7 +103,7 @@ class MethodLiveVarInfo : public FunctionPass {
 public:
   static AnalysisID ID;    // We are an analysis, we must have an ID
 
-  MethodLiveVarInfo(AnalysisID id = ID) { assert(id == ID); }
+  FunctionLiveVarInfo(AnalysisID id = ID) { assert(id == ID); }
 
   // --------- Implement the FunctionPass interface ----------------------
 
index 5217bf52a5802beaa0401ebd131a6c1ad4f31a18..958f7d7c6629730c7a846c0e67b320b515e31f69 100644 (file)
@@ -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"
index 0518aef3b8c88fa3c37e45b4b9fecad473de2663..58d4691b763124b1e993e022241e1dd078dfce72 100644 (file)
@@ -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)
index 387b673f60613abdfeba2b2fca4a8a0563e75a0f..cf55ab5c372ab4ad481d29abec6b675f0ad61db2 100644 (file)
@@ -6,7 +6,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Analysis/Dominators.h"
-#include "llvm/Transforms/UnifyMethodExitNodes.h"
+#include "llvm/Transforms/UnifyFunctionExitNodes.h"
 #include "llvm/Function.h"
 #include "llvm/Support/CFG.h"
 #include "Support/DepthFirstIterator.h"
@@ -85,7 +85,7 @@ void cfg::DominatorSet::calcPostDominatorSet(Function *M) {
   // that there can be at most one return instruction in the function left.
   // Get it.
   //
-  Root = getAnalysis<UnifyMethodExitNodes>().getExitNode();
+  Root = getAnalysis<UnifyFunctionExitNodes>().getExitNode();
 
   if (Root == 0) {  // No exit node for the function?  Postdomsets are all empty
     for (Function::const_iterator MI = M->begin(), ME = M->end(); MI!=ME; ++MI)
@@ -136,7 +136,7 @@ void cfg::DominatorSet::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.setPreservesAll();
   if (isPostDominator()) {
     AU.addProvided(PostDomID);
-    AU.addRequired(UnifyMethodExitNodes::ID);
+    AU.addRequired(UnifyFunctionExitNodes::ID);
   } else {
     AU.addProvided(ID);
   }
index adc8903541d2ee3dd520f9b6840549bb04fbd440..4c2a28c788255d3f156e3d1daa6e152f297183d5 100644 (file)
@@ -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
index 02e50c0cc79caeb5b7399744354c42e4535acf7a..a4480e8865792d965a9c231a76cf373a185fc3a5 100644 (file)
 //**************************************************************************/
 
 #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)
index c76beadcb590c7268782b5ec032e611be0ed7ebd..3f087d52249f2439919dacd28e68bb425eb80abc 100644 (file)
@@ -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.
index c22ede96b3326f534154154778230bd9622d6d75..4f12d697b14ecb23d73f92139d3c0c63dd3bd99b 100644 (file)
@@ -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)),
index 5922497f11e0e68709f7f67f2b31d79244a74bc9..5cc01c67650da5795ba39b4b7446d75841fb45f1 100644 (file)
 
    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();
 
index adc8903541d2ee3dd520f9b6840549bb04fbd440..4c2a28c788255d3f156e3d1daa6e152f297183d5 100644 (file)
@@ -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
index 02e50c0cc79caeb5b7399744354c42e4535acf7a..a4480e8865792d965a9c231a76cf373a185fc3a5 100644 (file)
 //**************************************************************************/
 
 #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)
index c76beadcb590c7268782b5ec032e611be0ed7ebd..3f087d52249f2439919dacd28e68bb425eb80abc 100644 (file)
@@ -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.
index 5217bf52a5802beaa0401ebd131a6c1ad4f31a18..958f7d7c6629730c7a846c0e67b320b515e31f69 100644 (file)
@@ -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"
index 0518aef3b8c88fa3c37e45b4b9fecad473de2663..58d4691b763124b1e993e022241e1dd078dfce72 100644 (file)
@@ -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)
index c22ede96b3326f534154154778230bd9622d6d75..4f12d697b14ecb23d73f92139d3c0c63dd3bd99b 100644 (file)
@@ -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)),
index 5922497f11e0e68709f7f67f2b31d79244a74bc9..5cc01c67650da5795ba39b4b7446d75841fb45f1 100644 (file)
 
    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();
 
index ad66a3482cd2bc93f246cb127faea06aa8f16630..ad0dd25685ff6f4b486e4171c0611068e7ef7de6 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/MethodLiveVarInfo.h"
+#include "llvm/Analysis/LiveVar/FunctionLiveVarInfo.h"
 #include "llvm/iTerminators.h"
 #include "llvm/iOther.h"
 #include "llvm/Function.h"
index fcb1e4fa40e5b087e6e2c14d38ba8c78d9195dba..1581323bea14b73d7483b9c91b2f49c029afec93 100644 (file)
@@ -18,7 +18,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Transforms/MethodInlining.h"
+#include "llvm/Transforms/FunctionInlining.h"
 #include "llvm/Module.h"
 #include "llvm/Function.h"
 #include "llvm/Pass.h"
index 860119e20689b1dac22dc16f9feefa7d32fd147b..b967db64c68d67b6760ed09fbd940540ea4a8fb6 100644 (file)
@@ -25,7 +25,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Transforms/Instrumentation/ProfilePaths.h"
-#include "llvm/Transforms/UnifyMethodExitNodes.h"
+#include "llvm/Transforms/UnifyFunctionExitNodes.h"
 #include "llvm/Support/CFG.h"
 #include "llvm/Function.h"
 #include "llvm/BasicBlock.h"
@@ -45,7 +45,7 @@ class ProfilePaths: public FunctionPass {
   // entry and only one exit node for the function in the CFG of the function
   //
   void ProfilePaths::getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequired(UnifyMethodExitNodes::ID);
+    AU.addRequired(UnifyFunctionExitNodes::ID);
   }
 };
 
@@ -67,20 +67,19 @@ static Node *findBB(std::set<Node *> &st, BasicBlock *BB){
 
 //Per function pass for inserting counters and trigger code
 bool ProfilePaths::runOnFunction(Function *M){
-  //Transform the cfg s.t. we have just one exit node
-  BasicBlock *ExitNode = 
-    getAnalysis<UnifyMethodExitNodes>().getExitNode();  
+  // Transform the cfg s.t. we have just one exit node
+  BasicBlock *ExitNode = getAnalysis<UnifyFunctionExitNodes>().getExitNode();  
   
-  //iterating over BBs and making graph
+  // iterating over BBs and making graph
   std::set<Node *> nodes;
   std::set<Edge> edges;
   Node *tmp;
   Node *exitNode, *startNode;
 
-  //The nodes must be uniquesly identified:
-  //That is, no two nodes must hav same BB*
+  // The nodes must be uniquesly identified:
+  // That is, no two nodes must hav same BB*
   
-  //First enter just nodes: later enter edges
+  // First enter just nodes: later enter edges
   for (Function::iterator BB = M->begin(), BE=M->end(); BB != BE; ++BB){
     Node *nd=new Node(*BB);
     nodes.insert(nd); 
@@ -90,7 +89,7 @@ bool ProfilePaths::runOnFunction(Function *M){
       startNode=nd;
   }
 
-  //now do it againto insert edges
+  // now do it againto insert edges
   for (Function::iterator BB = M->begin(), BE=M->end(); BB != BE; ++BB){
     Node *nd=findBB(nodes, *BB);
     assert(nd && "No node for this edge!");
@@ -111,39 +110,39 @@ bool ProfilePaths::runOnFunction(Function *M){
 
   BasicBlock *fr=M->front();
   
-  //If only one BB, don't instrument
+  // If only one BB, don't instrument
   if (M->getBasicBlocks().size() == 1) {    
-    //The graph is made acyclic: this is done
-    //by removing back edges for now, and adding them later on
+    // The graph is made acyclic: this is done
+    // by removing back edges for now, and adding them later on
     vector<Edge> be;
     g.getBackEdges(be);
 #ifdef DEBUG_PATH_PROFILES
     cerr<<"Backedges:"<<be.size()<<endl;
 #endif
-    //Now we need to reflect the effect of back edges
-    //This is done by adding dummy edges
-    //If a->b is a back edge
-    //Then we add 2 back edges for it:
-    //1. from root->b (in vector stDummy)
-    //and 2. from a->exit (in vector exDummy)
+    // Now we need to reflect the effect of back edges
+    // This is done by adding dummy edges
+    // If a->b is a back edge
+    // Then we add 2 back edges for it:
+    // 1. from root->b (in vector stDummy)
+    // and 2. from a->exit (in vector exDummy)
     vector<Edge> stDummy;
     vector<Edge> exDummy;
     addDummyEdges(stDummy, exDummy, g, be);
     
-    //Now, every edge in the graph is assigned a weight
-    //This weight later adds on to assign path
-    //numbers to different paths in the graph
-    // All paths for now are acyclic,
-    //since no back edges in the graph now
-    //numPaths is the number of acyclic paths in the graph
+    // Now, every edge in the graph is assigned a weight
+    // This weight later adds on to assign path
+    // numbers to different paths in the graph
+    //  All paths for now are acyclic,
+    // since no back edges in the graph now
+    // numPaths is the number of acyclic paths in the graph
     int numPaths=valueAssignmentToEdges(g);
     
-    //create instruction allocation r and count
-    //r is the variable that'll act like an accumulator
-    //all along the path, we just add edge values to r
-    //and at the end, r reflects the path number
-    //count is an array: count[x] would store
-    //the number of executions of path numbered x
+    // create instruction allocation r and count
+    // r is the variable that'll act like an accumulator
+    // all along the path, we just add edge values to r
+    // and at the end, r reflects the path number
+    // count is an array: count[x] would store
+    // the number of executions of path numbered x
     Instruction *rVar=new 
       AllocaInst(PointerType::get(Type::IntTy), 
                 ConstantUInt::get(Type::UIntTy,1),"R");
@@ -152,14 +151,14 @@ bool ProfilePaths::runOnFunction(Function *M){
       AllocaInst(PointerType::get(Type::IntTy), 
                 ConstantUInt::get(Type::UIntTy, numPaths), "Count");
     
-    //insert initialization code in first (entry) BB
-    //this includes initializing r and count
+    // insert initialization code in first (entry) BB
+    // this includes initializing r and count
     insertInTopBB(M->getEntryNode(),numPaths, rVar, countVar);
     
-    //now process the graph: get path numbers,
-    //get increments along different paths,
-    //and assign "increments" and "updates" (to r and count)
-    //"optimally". Finally, insert llvm code along various edges
+    // now process the graph: get path numbers,
+    // get increments along different paths,
+    // and assign "increments" and "updates" (to r and count)
+    // "optimally". Finally, insert llvm code along various edges
     processGraph(g, rVar, countVar, be, stDummy, exDummy);
   }
 
index aa627979fb015a929dccbf47d1ec1972020ec42a..808ea48e673adf175bdda017f4c08ca64a1bf0e9 100644 (file)
@@ -7,7 +7,7 @@
 #include "llvm/Instruction.h"
 #include <map>
 
-// FIXME: This should be merged with MethodInlining
+// FIXME: This should be merged with FunctionInlining
 
 // RemapInstruction - Convert the instruction operands from referencing the 
 // current values into those specified by ValueMap.
index 9a3b52c49cfa8240d0e17e2337af4787685b2328..0fa87f8e8d2ad0465ae0b2de56a8e3f55a85bbaf 100644 (file)
@@ -5,7 +5,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Transforms/UnifyMethodExitNodes.h"
+#include "llvm/Transforms/UnifyFunctionExitNodes.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/Function.h"
 #include "llvm/iTerminators.h"
@@ -13,7 +13,7 @@
 #include "llvm/Type.h"
 using std::vector;
 
-AnalysisID UnifyMethodExitNodes::ID(AnalysisID::create<UnifyMethodExitNodes>());
+AnalysisID UnifyFunctionExitNodes::ID(AnalysisID::create<UnifyFunctionExitNodes>());
 
 
 // UnifyAllExitNodes - Unify all exit nodes of the CFG by creating a new
@@ -22,7 +22,7 @@ AnalysisID UnifyMethodExitNodes::ID(AnalysisID::create<UnifyMethodExitNodes>());
 //
 // If there are no return stmts in the Function, a null pointer is returned.
 //
-bool UnifyMethodExitNodes::doit(Function *M, BasicBlock *&ExitNode) {
+bool UnifyFunctionExitNodes::doit(Function *M, BasicBlock *&ExitNode) {
   // Loop over all of the blocks in a function, tracking all of the blocks that
   // return.
   //
index 387b673f60613abdfeba2b2fca4a8a0563e75a0f..cf55ab5c372ab4ad481d29abec6b675f0ad61db2 100644 (file)
@@ -6,7 +6,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Analysis/Dominators.h"
-#include "llvm/Transforms/UnifyMethodExitNodes.h"
+#include "llvm/Transforms/UnifyFunctionExitNodes.h"
 #include "llvm/Function.h"
 #include "llvm/Support/CFG.h"
 #include "Support/DepthFirstIterator.h"
@@ -85,7 +85,7 @@ void cfg::DominatorSet::calcPostDominatorSet(Function *M) {
   // that there can be at most one return instruction in the function left.
   // Get it.
   //
-  Root = getAnalysis<UnifyMethodExitNodes>().getExitNode();
+  Root = getAnalysis<UnifyFunctionExitNodes>().getExitNode();
 
   if (Root == 0) {  // No exit node for the function?  Postdomsets are all empty
     for (Function::const_iterator MI = M->begin(), ME = M->end(); MI!=ME; ++MI)
@@ -136,7 +136,7 @@ void cfg::DominatorSet::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.setPreservesAll();
   if (isPostDominator()) {
     AU.addProvided(PostDomID);
-    AU.addRequired(UnifyMethodExitNodes::ID);
+    AU.addRequired(UnifyFunctionExitNodes::ID);
   } else {
     AU.addProvided(ID);
   }
index f9ef9edd3cc8116c5d9bbd87356f529228ea4a75..2b6f8e32ef39f6b97e49d382f7b391e863d1dd91 100644 (file)
 #include "llvm/Bytecode/WriteBytecodePass.h"
 #include "llvm/Assembly/PrintModulePass.h"
 #include "llvm/Analysis/Verifier.h"
-#include "llvm/Transforms/UnifyMethodExitNodes.h"
+#include "llvm/Transforms/UnifyFunctionExitNodes.h"
 #include "llvm/Transforms/ConstantMerge.h"
 #include "llvm/Transforms/CleanupGCCOutput.h"
 #include "llvm/Transforms/LevelChange.h"
-#include "llvm/Transforms/MethodInlining.h"
+#include "llvm/Transforms/FunctionInlining.h"
 #include "llvm/Transforms/SymbolStripping.h"
 #include "llvm/Transforms/ChangeAllocations.h"
 #include "llvm/Transforms/IPO/SimpleStructMutation.h"
@@ -77,7 +77,7 @@ struct {
   { constmerge , createConstantMergePass        },
   { strip      , createSymbolStrippingPass      },
   { mstrip     , createFullSymbolStrippingPass  },
-  { mergereturn, createUnifyMethodExitNodesPass },
+  { mergereturn, createUnifyFunctionExitNodesPass },
 
   { indvars    , createIndVarSimplifyPass         },
   { instcombine, createInstructionCombiningPass   },