PassInfo keep tracks whether a pass is an analysis pass or not.
authorDevang Patel <dpatel@apple.com>
Wed, 19 Mar 2008 21:56:59 +0000 (21:56 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 19 Mar 2008 21:56:59 +0000 (21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48554 91177308-0d34-0410-b5e6-96231b3b80d8

35 files changed:
docs/WritingAnLLVMPass.html
include/llvm/Analysis/Dominators.h
include/llvm/Analysis/FindUsedTypes.h
include/llvm/Analysis/IntervalPartition.h
include/llvm/Analysis/LoopInfo.h
include/llvm/Analysis/LoopPass.h
include/llvm/Analysis/MemoryDependenceAnalysis.h
include/llvm/Analysis/PostDominators.h
include/llvm/Analysis/ScalarEvolution.h
include/llvm/CallGraphSCCPass.h
include/llvm/Pass.h
include/llvm/PassSupport.h
lib/Analysis/AliasAnalysisCounter.cpp
lib/Analysis/AliasAnalysisEvaluator.cpp
lib/Analysis/AliasDebugger.cpp
lib/Analysis/AliasSetTracker.cpp
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/CFGPrinter.cpp
lib/Analysis/IPA/Andersens.cpp
lib/Analysis/IPA/CallGraph.cpp
lib/Analysis/IPA/FindUsedTypes.cpp
lib/Analysis/IPA/GlobalsModRef.cpp
lib/Analysis/InstCount.cpp
lib/Analysis/IntervalPartition.cpp
lib/Analysis/LoadValueNumbering.cpp
lib/Analysis/LoopInfo.cpp
lib/Analysis/MemoryDependenceAnalysis.cpp
lib/Analysis/PostDominators.cpp
lib/Analysis/ProfileInfo.cpp
lib/Analysis/ProfileInfoLoaderPass.cpp
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ValueNumbering.cpp
lib/Target/TargetData.cpp
lib/VMCore/Dominators.cpp
lib/VMCore/PassManager.cpp

index 4ae039d75396d58327ff7a3a9e857445993c435b..07e736da691e55ae8a2aa1325e72dc0c9e2205f1 100644 (file)
@@ -292,13 +292,19 @@ function.</p>
 initialization value is not important.</p>
 
 <div class="doc_code"><pre>
-  RegisterPass&lt;Hello&gt; X("<i>hello</i>", "<i>Hello World Pass</i>");
+  RegisterPass&lt;Hello&gt; X("<i>hello</i>", "<i>Hello World Pass</i>",
+                        false /* Only looks at CFG */,
+                        false /* Analysis Pass */);
 }  <i>// end of anonymous namespace</i>
 </pre></div>
 
 <p>Lastly, we <a href="#registration">register our class</a> <tt>Hello</tt>, 
 giving it a command line
-argument "<tt>hello</tt>", and a name "<tt>Hello World Pass</tt>".</p>
+argument "<tt>hello</tt>", and a name "<tt>Hello World Pass</tt>".
+Last two RegisterPass arguments are optional. Their default value is false.
+If a pass walks CFG without modifying it then third argument is set to true. 
+If  a pass is an analysis pass, for example dominator tree pass, then true 
+is supplied as fourth argument. </p>
 
 <p>As a whole, the <tt>.cpp</tt> file looks like:</p>
 
index 1b7fa75e6a22e592ecddf37eae489c47718a549c..ce305d5875e0c38b1e3d193f9cdc449def53c5b6 100644 (file)
@@ -664,7 +664,7 @@ public:
   static char ID; // Pass ID, replacement for typeid
   DominatorTreeBase<BasicBlock>* DT;
   
-  DominatorTree() : FunctionPass(intptr_t(&ID), true) {
+  DominatorTree() : FunctionPass(intptr_t(&ID)) {
     DT = new DominatorTreeBase<BasicBlock>(false);
   }
   
@@ -837,7 +837,7 @@ protected:
   
 public:
   DominanceFrontierBase(intptr_t ID, bool isPostDom) 
-    : FunctionPass(ID, true), IsPostDominators(isPostDom) {}
+    : FunctionPass(ID), IsPostDominators(isPostDom) {}
 
   /// getRoots -  Return the root blocks of the current CFG.  This may include
   /// multiple blocks if we are computing post dominators.  For forward
index 6a128c80886a12fc2b06facd41a824743b4d3a3f..b0d38c509c1f17e27a7cc3c5d7cb7dab289dbcb3 100644 (file)
@@ -25,7 +25,7 @@ class FindUsedTypes : public ModulePass {
   std::set<const Type *> UsedTypes;
 public:
   static char ID; // Pass identification, replacement for typeid
-  FindUsedTypes() : ModulePass((intptr_t)&ID, true) {}
+  FindUsedTypes() : ModulePass((intptr_t)&ID) {}
 
   /// getTypes - After the pass has been run, return the set containing all of
   /// the types used in the module.
index 42d27feaec4868ebe2d76e72c1f43a8f47521b10..8b85e7c08b12c43eede7d1e37bc8464e363b80a4 100644 (file)
@@ -47,7 +47,7 @@ class IntervalPartition : public FunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
 
-  IntervalPartition() : FunctionPass((intptr_t)&ID, true), RootInterval(0) {}
+  IntervalPartition() : FunctionPass((intptr_t)&ID), RootInterval(0) {}
 
   // run - Calculate the interval partition for this function
   virtual bool runOnFunction(Function &F);
index cc2b10eb53f2c954e86b5e54f0fd07fe36eb3bc2..ab7cb7e03e55f577c6b236d6e9575b30ad7160ab 100644 (file)
@@ -879,7 +879,7 @@ class LoopInfo : public FunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
 
-  LoopInfo() : FunctionPass(intptr_t(&ID), true) {
+  LoopInfo() : FunctionPass(intptr_t(&ID)) {
     LI = new LoopInfoBase<BasicBlock>();
   }
   
@@ -919,6 +919,9 @@ public:
     return LI->isLoopHeader(BB);
   }
 
+  /// isAnalysis - Return true if this pass is  implementing an analysis pass.
+  bool isAnalysis() const { return true; }
+
   /// runOnFunction - Calculate the natural loop information.
   ///
   virtual bool runOnFunction(Function &F);
index 8ebbbafb5858a15895711f508dd856a19b0b9efb..c0cdce2f1a5f0dc9e08f4a9aadf2893d0e38ec86 100644 (file)
@@ -29,7 +29,7 @@ class PMStack;
 class LoopPass : public Pass {
 
  public:
-  explicit LoopPass(intptr_t pid, bool AP = false) : Pass(pid, AP) {}
+  explicit LoopPass(intptr_t pid) : Pass(pid) {}
 
   // runOnLoop - This method should be implemented by the subclass to perform
   // whatever action is necessary for the specfied Loop. 
index c683a6b74b8da8a788da6c96c08c04f0951635d4..c6ef41ff24046de932a30586bcf7ad6dc0e23dcd 100644 (file)
@@ -66,7 +66,7 @@ class MemoryDependenceAnalysis : public FunctionPass {
     static Instruction* const Dirty;
     
     static char ID; // Class identification, replacement for typeinfo
-    MemoryDependenceAnalysis() : FunctionPass((intptr_t)&ID, true) {}
+    MemoryDependenceAnalysis() : FunctionPass((intptr_t)&ID) {}
 
     /// Pass Implementation stuff.  This doesn't do any analysis.
     ///
index f20f050a9b3c7d2e79ee324a20577deb808be6db..07910e9538c7cb6c013322bab035755916787d3b 100644 (file)
@@ -25,7 +25,7 @@ struct PostDominatorTree : public FunctionPass {
   static char ID; // Pass identification, replacement for typeid
   DominatorTreeBase<BasicBlock>* DT;
 
-  PostDominatorTree() : FunctionPass((intptr_t)&ID, true) {
+  PostDominatorTree() : FunctionPass((intptr_t)&ID) {
     DT = new DominatorTreeBase<BasicBlock>(true);
   }
 
index 5894d8c3f33798ffec8877c573aeeea8f8c4add2..4d9d5e5fc044c7aad59ad93bd91b17cfa14de1af 100644 (file)
@@ -192,7 +192,7 @@ namespace llvm {
     void *Impl;    // ScalarEvolution uses the pimpl pattern
   public:
     static char ID; // Pass identification, replacement for typeid
-    ScalarEvolution() : FunctionPass((intptr_t)&ID, true), Impl(0) {}
+    ScalarEvolution() : FunctionPass((intptr_t)&ID), Impl(0) {}
 
     /// getSCEV - Return a SCEV expression handle for the full generality of the
     /// specified expression.
index f2190e67211355683b5211fcf98f04fffc9834d5..26005059dee5aaa765d5ce1d5eb5cb8ea99992c2 100644 (file)
@@ -31,7 +31,7 @@ class PMStack;
 
 struct CallGraphSCCPass : public Pass {
 
-  explicit CallGraphSCCPass(intptr_t pid, bool AP = false) : Pass(pid, AP) {}
+  explicit CallGraphSCCPass(intptr_t pid) : Pass(pid) {}
 
   /// doInitialization - This method is called before the SCC's of the program
   /// has been processed, allowing the pass to do initialization as necessary.
index 07355da2d1877b851a2384165f0a4ad78d99a053..a0ffcde4da1c7b41b7137c9f3bc7adab5103285d 100644 (file)
@@ -73,7 +73,6 @@ enum PassManagerType {
 class Pass {
   AnalysisResolver *Resolver;  // Used to resolve analysis
   intptr_t PassID;
-  bool isAnalysisPass; // True if this pass is an analysis pass.
   // AnalysisImpls - This keeps track of which passes implement the interfaces
   // that are required by the current pass (to implement getAnalysis()).
   //
@@ -82,14 +81,11 @@ class Pass {
   void operator=(const Pass&);  // DO NOT IMPLEMENT
   Pass(const Pass &);           // DO NOT IMPLEMENT
 public:
-  explicit Pass(intptr_t pid, bool AP = false) : Resolver(0), PassID(pid), 
-                                                 isAnalysisPass(AP) {}
-  explicit Pass(const void *pid, bool AP = false) : Resolver(0), 
-                                                    PassID((intptr_t)pid),
-                                                    isAnalysisPass(AP) {}
+  explicit Pass(intptr_t pid) : Resolver(0), PassID(pid) {}
+  explicit Pass(const void *pid) : Resolver(0), 
+                                                    PassID((intptr_t)pid) {}
   virtual ~Pass();
 
-  bool isAnalysis() const { return isAnalysisPass; }
   /// getPassName - Return a nice clean name for a pass.  This usually
   /// implemented in terms of the name that is registered by one of the
   /// Registration templates, but can be overloaded directly.
@@ -231,8 +227,8 @@ public:
     return PMT_ModulePassManager;
   }
 
-  explicit ModulePass(intptr_t pid, bool AP = false) : Pass(pid, AP) {}
-  explicit ModulePass(const void *pid, bool AP = false) : Pass(pid, AP) {}
+  explicit ModulePass(intptr_t pid) : Pass(pid) {}
+  explicit ModulePass(const void *pid) : Pass(pid) {}
   // Force out-of-line virtual method.
   virtual ~ModulePass();
 };
@@ -257,9 +253,9 @@ public:
   ///
   bool runOnModule(Module &M) { return false; }
 
-  explicit ImmutablePass(intptr_t pid, bool AP = false) : ModulePass(pid, AP) {}
-  explicit ImmutablePass(const void *pid, bool AP = false
-  : ModulePass(pid, AP) {}
+  explicit ImmutablePass(intptr_t pid) : ModulePass(pid) {}
+  explicit ImmutablePass(const void *pid) 
+  : ModulePass(pid) {}
   
   // Force out-of-line virtual method.
   virtual ~ImmutablePass();
@@ -276,8 +272,8 @@ public:
 ///
 class FunctionPass : public Pass {
 public:
-  explicit FunctionPass(intptr_t pid, bool AP = false) : Pass(pid, AP) {}
-  explicit FunctionPass(const void *pid, bool AP = false) : Pass(pid, AP) {}
+  explicit FunctionPass(intptr_t pid) : Pass(pid) {}
+  explicit FunctionPass(const void *pid) : Pass(pid) {}
 
   /// doInitialization - Virtual method overridden by subclasses to do
   /// any necessary per-module initialization.
@@ -328,8 +324,8 @@ public:
 ///
 class BasicBlockPass : public Pass {
 public:
-  explicit BasicBlockPass(intptr_t pid, bool AP = false) : Pass(pid, AP) {}
-  explicit BasicBlockPass(const void *pid, bool AP = false) : Pass(pid, AP) {}
+  explicit BasicBlockPass(intptr_t pid) : Pass(pid) {}
+  explicit BasicBlockPass(const void *pid) : Pass(pid) {}
 
   /// doInitialization - Virtual method overridden by subclasses to do
   /// any necessary per-module initialization.
index 1ddc2df53daaac3c73174a2df8de48ad45653611..68fd901048fdad37dcf0f1943da29b0f0bfe388c 100644 (file)
@@ -39,6 +39,7 @@ class PassInfo {
   const char           *PassArgument;  // Command Line argument to run this pass
   intptr_t             PassID;      
   bool IsCFGOnlyPass;                  // Pass only looks at the CFG.
+  bool IsAnalysis;                     // True if an analysis pass.
   bool IsAnalysisGroup;                // True if an analysis group.
   std::vector<const PassInfo*> ItfImpl;// Interfaces implemented by this pass
 
@@ -48,9 +49,10 @@ public:
   /// PassInfo ctor - Do not call this directly, this should only be invoked
   /// through RegisterPass.
   PassInfo(const char *name, const char *arg, intptr_t pi,
-           Pass *(*normal)() = 0, bool isCFGOnly = false)
+           Pass *(*normal)() = 0, bool isCFGOnly = false, bool isAnalysis = false)
     : PassName(name), PassArgument(arg), PassID(pi), 
-      IsCFGOnlyPass(isCFGOnly), IsAnalysisGroup(false), NormalCtor(normal) {
+      IsCFGOnlyPass(isCFGOnly), 
+      IsAnalysis(isAnalysis), IsAnalysisGroup(false), NormalCtor(normal) {
   }
 
   /// getPassName - Return the friendly name for the pass, never returns null
@@ -72,6 +74,7 @@ public:
   /// pass.
   ///
   bool isAnalysisGroup() const { return IsAnalysisGroup; }
+  bool isAnalysis() const { return IsAnalysis; }
   void SetIsAnalysisGroup() { IsAnalysisGroup = true; }
 
   /// isCFGOnlyPass - return true if this pass only looks at the CFG for the
@@ -140,8 +143,9 @@ struct RegisterPassBase {
   typedef Pass* (*NormalCtor_t)();
   
   RegisterPassBase(const char *Name, const char *Arg, intptr_t TI,
-                   NormalCtor_t NormalCtor = 0, bool CFGOnly = false)
-    : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) {
+                   NormalCtor_t NormalCtor = 0, bool CFGOnly = false, 
+                   bool IsAnalysis = false)
+    : PIObj(Name, Arg, TI, NormalCtor, CFGOnly, IsAnalysis) {
     registerPass();
   }
   explicit RegisterPassBase(intptr_t TI)
@@ -164,9 +168,11 @@ template<typename PassName>
 struct RegisterPass : public RegisterPassBase {
 
   // Register Pass using default constructor...
-  RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false)
+  RegisterPass(const char *PassArg, const char *Name, bool CFGOnly = false,
+               bool IsAnalysis = false)
     : RegisterPassBase(Name, PassArg, intptr_t(&PassName::ID),
-                     RegisterPassBase::NormalCtor_t(callDefaultCtor<PassName>), CFGOnly) {
+                      RegisterPassBase::NormalCtor_t(callDefaultCtor<PassName>),
+                      CFGOnly, IsAnalysis) {
   }
 };
 
index df3a66c660670c7fe11ce61c090d300f4ccee9bc..3f8f1fc56ba50dac9f9bab729e6f46ca3096ce0e 100644 (file)
@@ -35,7 +35,7 @@ namespace {
     Module *M;
   public:
     static char ID; // Class identification, replacement for typeinfo
-    AliasAnalysisCounter() : ModulePass((intptr_t) &ID, true) {
+    AliasAnalysisCounter() : ModulePass((intptr_t) &ID) {
       No = May = Must = 0;
       NoMR = JustRef = JustMod = MR = 0;
     }
@@ -116,7 +116,7 @@ namespace {
 
   char AliasAnalysisCounter::ID = 0;
   RegisterPass<AliasAnalysisCounter>
-  X("count-aa", "Count Alias Analysis Query Responses");
+  X("count-aa", "Count Alias Analysis Query Responses", true, true);
   RegisterAnalysisGroup<AliasAnalysis> Y(X);
 }
 
index 648760a2b73d6d42a0a4c3cb78f608d9b45acc9f..868de34c1f635db525f1f4ab28900580c0e4e017 100644 (file)
@@ -52,7 +52,7 @@ namespace {
 
   public:
     static char ID; // Pass identification, replacement for typeid
-    AAEval() : FunctionPass((intptr_t)&ID, true) {}
+    AAEval() : FunctionPass((intptr_t)&ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<AliasAnalysis>();
@@ -76,7 +76,7 @@ namespace {
 
   char AAEval::ID = 0;
   RegisterPass<AAEval>
-  X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator");
+  X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", true, true);
 }
 
 FunctionPass *llvm::createAAEvalPass() { return new AAEval(); }
index 76dfe073375ea40e7f914081af667a5fae57f730..7f4e418c27d3b1d8b1e49b285d18e2e9f07c6b91 100644 (file)
@@ -41,7 +41,7 @@ namespace {
     
   public:
     static char ID; // Class identification, replacement for typeinfo
-    AliasDebugger() : ModulePass((intptr_t)&ID, true) {}
+    AliasDebugger() : ModulePass((intptr_t)&ID) {}
 
     bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);                 // set up super class
@@ -123,7 +123,7 @@ namespace {
   };
 
   char AliasDebugger::ID = 0;
-  RegisterPass<AliasDebugger> X("debug-aa", "AA use debugger");
+  RegisterPass<AliasDebugger> X("debug-aa", "AA use debugger", true, true);
   RegisterAnalysisGroup<AliasAnalysis> Y(X);
 }
 
index a6f9227fd1c9172a60466ffe563aad07c408d5f8..5a3e126cf8d2ab808f08338cc2506707cfd56aa9 100644 (file)
@@ -551,7 +551,7 @@ namespace {
     AliasSetTracker *Tracker;
   public:
     static char ID; // Pass identification, replacement for typeid
-    AliasSetPrinter() : FunctionPass((intptr_t)&ID, true) {}
+    AliasSetPrinter() : FunctionPass((intptr_t)&ID) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
@@ -569,5 +569,5 @@ namespace {
     }
   };
   char AliasSetPrinter::ID = 0;
-  RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
+  RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer", true, true);
 }
index 866c8100abbbffb9d378f320059e09c957ff1b3d..eab3ec332ee828624fe6d2fcdca14ff4feb9bdcd 100644 (file)
@@ -83,7 +83,7 @@ namespace {
   // Register this pass...
   char NoAA::ID = 0;
   RegisterPass<NoAA>
-  U("no-aa", "No Alias Analysis (always returns 'may' alias)");
+  U("no-aa", "No Alias Analysis (always returns 'may' alias)", true, true);
 
   // Declare that we implement the AliasAnalysis interface
   RegisterAnalysisGroup<AliasAnalysis> V(U);
@@ -128,7 +128,7 @@ namespace {
   // Register this pass...
   char BasicAliasAnalysis::ID = 0;
   RegisterPass<BasicAliasAnalysis>
-  X("basicaa", "Basic Alias Analysis (default AA impl)");
+  X("basicaa", "Basic Alias Analysis (default AA impl)", true, true);
 
   // Declare that we implement the AliasAnalysis interface
   RegisterAnalysisGroup<AliasAnalysis, true> Y(X);
index b4840dc3f1421769169e6a6ee0d77e97d2a07162..b3253777fc3c21f434e5c92699fbf0597129b65f 100644 (file)
@@ -92,7 +92,7 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
 namespace {
   struct VISIBILITY_HIDDEN CFGViewer : public FunctionPass {
     static char ID; // Pass identifcation, replacement for typeid
-    CFGViewer() : FunctionPass((intptr_t)&ID, true) {}
+    CFGViewer() : FunctionPass((intptr_t)&ID) {}
 
     virtual bool runOnFunction(Function &F) {
       F.viewCFG();
@@ -108,11 +108,11 @@ namespace {
 
   char CFGViewer::ID = 0;
   RegisterPass<CFGViewer> V0("view-cfg",
-                             "View CFG of function");
+                             "View CFG of function", true, true);
 
   struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass {
     static char ID; // Pass identifcation, replacement for typeid
-    CFGOnlyViewer() : FunctionPass((intptr_t)&ID, true) {}
+    CFGOnlyViewer() : FunctionPass((intptr_t)&ID) {}
 
     virtual bool runOnFunction(Function &F) {
       CFGOnly = true;
@@ -130,12 +130,12 @@ namespace {
 
   char CFGOnlyViewer::ID = 0;
   RegisterPass<CFGOnlyViewer> V1("view-cfg-only",
-                                 "View CFG of function (with no function bodies)");
+                                 "View CFG of function (with no function bodies)", true, true);
 
   struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
     static char ID; // Pass identification, replacement for typeid
     CFGPrinter() : FunctionPass((intptr_t)&ID) {}
-    explicit CFGPrinter(intptr_t pid) : FunctionPass(pid, true) {}
+    explicit CFGPrinter(intptr_t pid) : FunctionPass(pid) {}
 
     virtual bool runOnFunction(Function &F) {
       std::string Filename = "cfg." + F.getName() + ".dot";
@@ -159,7 +159,7 @@ namespace {
 
   char CFGPrinter::ID = 0;
   RegisterPass<CFGPrinter> P1("print-cfg",
-                              "Print CFG of function to 'dot' file");
+                              "Print CFG of function to 'dot' file", true, true);
 
   struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter {
     static char ID; // Pass identification, replacement for typeid
@@ -181,7 +181,7 @@ namespace {
   char CFGOnlyPrinter::ID = 0;
   RegisterPass<CFGOnlyPrinter>
   P2("print-cfg-only",
-     "Print CFG of function to 'dot' file (with no function bodies)");
+     "Print CFG of function to 'dot' file (with no function bodies)", true, true);
 }
 
 /// viewCFG - This function is meant for use from the debugger.  You can just
index d77997bb3979dc3f3936a5eafc58f85c5d946adb..b34b50ed6453d3059fad221028455add03f79170 100644 (file)
@@ -430,7 +430,7 @@ namespace {
 
   public:
     static char ID;
-    Andersens() : ModulePass((intptr_t)&ID, true) {}
+    Andersens() : ModulePass((intptr_t)&ID) {}
 
     bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);
@@ -602,7 +602,8 @@ namespace {
 
   char Andersens::ID = 0;
   RegisterPass<Andersens> X("anders-aa",
-                            "Andersen's Interprocedural Alias Analysis");
+                            "Andersen's Interprocedural Alias Analysis", true, 
+                            true);
   RegisterAnalysisGroup<AliasAnalysis> Y(X);
 
   // Initialize Timestamp Counter (static).
index cb24df6c359e45ce32258dd173c0171f47a4a471..5c5418ba250355be89bca32351da48851f0aaeb0 100644 (file)
@@ -191,7 +191,7 @@ private:
 };
 
 RegisterAnalysisGroup<CallGraph> X("Call Graph");
-RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction");
+RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction", false, true);
 RegisterAnalysisGroup<CallGraph, true> Z(Y);
 
 } //End anonymous namespace
index 34c126f5d45bc212626857f2742e31d18c13462b..4d44e5384d110a61c5f88818ec6dfd34a03a9529 100644 (file)
@@ -23,7 +23,7 @@ using namespace llvm;
 
 char FindUsedTypes::ID = 0;
 static RegisterPass<FindUsedTypes>
-X("printusedtypes", "Find Used Types");
+X("printusedtypes", "Find Used Types", true, true);
 
 // IncorporateType - Incorporate one type and all of its subtypes into the
 // collection of used types.
index a08db7bf4203aeb8dad92fa8dd51c5e662218b94..17fce9d62adcb41689f6c5cc7972fa835e355768 100644 (file)
@@ -84,7 +84,7 @@ namespace {
 
   public:
     static char ID;
-    GlobalsModRef() : ModulePass((intptr_t)&ID, true) {}
+    GlobalsModRef() : ModulePass((intptr_t)&ID) {}
 
     bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);                 // set up super class
@@ -149,7 +149,8 @@ namespace {
 
   char GlobalsModRef::ID = 0;
   RegisterPass<GlobalsModRef> X("globalsmodref-aa",
-                                "Simple mod/ref analysis for globals");
+                                "Simple mod/ref analysis for globals", true, 
+                                true);
   RegisterAnalysisGroup<AliasAnalysis> Y(X);
 }
 
index 2eae5c369ab5b15bce13aa8283f33edeebaa9ec5..2e0e8c6fcc97cdc070064088b147c2d030c3e06f 100644 (file)
@@ -52,7 +52,7 @@ namespace {
     }
   public:
     static char ID; // Pass identification, replacement for typeid
-    InstCount() : FunctionPass((intptr_t)&ID, true) {}
+    InstCount() : FunctionPass((intptr_t)&ID) {}
 
     virtual bool runOnFunction(Function &F);
 
@@ -65,7 +65,7 @@ namespace {
 
   char InstCount::ID = 0;
   RegisterPass<InstCount> X("instcount",
-                            "Counts the various types of Instructions");
+                            "Counts the various types of Instructions", true, true);
 }
 
 FunctionPass *llvm::createInstCountPass() { return new InstCount(); }
index e73b40b63ed7ae7ba6a475899e79f1d53c1ed9ef..a430cffc3580a22799b7255e5ad06d4920c06dee 100644 (file)
@@ -17,7 +17,7 @@ using namespace llvm;
 
 char IntervalPartition::ID = 0;
 static RegisterPass<IntervalPartition>
-X("intervals", "Interval Partition Construction", true);
+X("intervals", "Interval Partition Construction", true, true);
 
 //===----------------------------------------------------------------------===//
 // IntervalPartition Implementation
index 6b8775bb1a8963e6b28a3c4af15cb23a903213dd..f9bf7ba57f797e36cf0d0182120b9a26b9f71512 100644 (file)
@@ -41,7 +41,7 @@ namespace {
   // FIXME: This should not be a FunctionPass.
   struct VISIBILITY_HIDDEN LoadVN : public FunctionPass, public ValueNumbering {
     static char ID; // Class identification, replacement for typeinfo
-    LoadVN() : FunctionPass((intptr_t)&ID, true) {}
+    LoadVN() : FunctionPass((intptr_t)&ID) {}
 
     /// Pass Implementation stuff.  This doesn't do any analysis.
     ///
@@ -85,7 +85,7 @@ namespace {
 
   char LoadVN::ID = 0;
   // Register this pass...
-  RegisterPass<LoadVN> X("load-vn", "Load Value Numbering");
+  RegisterPass<LoadVN> X("load-vn", "Load Value Numbering", true, true);
 
   // Declare that we implement the ValueNumbering interface
   RegisterAnalysisGroup<ValueNumbering> Y(X);
index e136f2930f6f92cca21260ceb78c54d43365cdfd..e067c1768fe1714ef962daf435eb2d2bada671f0 100644 (file)
@@ -29,7 +29,7 @@ using namespace llvm;
 
 char LoopInfo::ID = 0;
 static RegisterPass<LoopInfo>
-X("loops", "Natural Loop Construction", true);
+X("loops", "Natural Loop Construction", true, true);
 
 //===----------------------------------------------------------------------===//
 // Loop implementation
index 22c454fae15d95558d53496909813917a58d630f..80f7fe831c9b8357db192d924d44c41b3a98208f 100644 (file)
@@ -48,7 +48,7 @@ Instruction* const MemoryDependenceAnalysis::Dirty = (Instruction*)-5;
   
 // Register this pass...
 static RegisterPass<MemoryDependenceAnalysis> X("memdep",
-                                                "Memory Dependence Analysis");
+                                                "Memory Dependence Analysis", true, true);
 
 void MemoryDependenceAnalysis::ping(Instruction *D) {
   for (depMapType::iterator I = depGraphLocal.begin(), E = depGraphLocal.end();
index f72d971c9e7cea804052b57702c5dd7aa7d3748c..8bfa0692b9adc67850518d6d22b7e9d99300ba87 100644 (file)
@@ -26,7 +26,7 @@ using namespace llvm;
 char PostDominatorTree::ID = 0;
 char PostDominanceFrontier::ID = 0;
 static RegisterPass<PostDominatorTree>
-F("postdomtree", "Post-Dominator Tree Construction", true);
+F("postdomtree", "Post-Dominator Tree Construction", true, true);
 
 bool PostDominatorTree::runOnFunction(Function &F) {
   DT->recalculate(F);
@@ -38,7 +38,7 @@ bool PostDominatorTree::runOnFunction(Function &F) {
 //===----------------------------------------------------------------------===//
 
 static RegisterPass<PostDominanceFrontier>
-H("postdomfrontier", "Post-Dominance Frontier Construction", true);
+H("postdomfrontier", "Post-Dominance Frontier Construction", true, true);
 
 const DominanceFrontier::DomSetType &
 PostDominanceFrontier::calculate(const PostDominatorTree &DT,
index 9e90c9435818bbd0d5c7c0c07d3ecf134c9ba8ea..e5b557ec8871a8d52ced3074789a78c398621862 100644 (file)
@@ -93,7 +93,7 @@ namespace {
   char NoProfileInfo::ID = 0;
   // Register this pass...
   RegisterPass<NoProfileInfo>
-  X("no-profile", "No Profile Information");
+  X("no-profile", "No Profile Information", true, true);
 
   // Declare that we implement the ProfileInfo interface
   RegisterAnalysisGroup<ProfileInfo, true> Y(X);
index 12b18f736c25461f3c3e279b0288ff2ac5c162b1..9efb312d78fea27e90e4c5457220bca7dad706b8 100644 (file)
@@ -34,7 +34,7 @@ namespace {
   public:
     static char ID; // Class identification, replacement for typeinfo
     explicit LoaderPass(const std::string &filename = "")
-      : ModulePass((intptr_t)&ID, true), Filename(filename) {
+      : ModulePass((intptr_t)&ID), Filename(filename) {
       if (filename.empty()) Filename = ProfileInfoFilename;
     }
 
@@ -52,7 +52,7 @@ namespace {
 
   char LoaderPass::ID = 0;
   RegisterPass<LoaderPass>
-  X("profile-loader", "Load profile information from llvmprof.out");
+  X("profile-loader", "Load profile information from llvmprof.out", true, true);
 
   RegisterAnalysisGroup<ProfileInfo> Y(X);
 }  // End of anonymous namespace
index 0db02d98c20ce13cdeaddbeb3a2541cc94ffd551..6c51abd1471e035ac1c061fccfe35e647d5f2df0 100644 (file)
@@ -103,7 +103,7 @@ MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
 
 namespace {
   RegisterPass<ScalarEvolution>
-  R("scalar-evolution", "Scalar Evolution Analysis");
+  R("scalar-evolution", "Scalar Evolution Analysis", true, true);
 }
 char ScalarEvolution::ID = 0;
 
index 743d811c75589a6828b8324c3c283af38469c44e..b9964153801bf0e850ae2b86acbc299cd930112b 100644 (file)
@@ -68,7 +68,7 @@ namespace {
   char BasicVN::ID = 0;
   // Register this pass...
   RegisterPass<BasicVN>
-  X("basicvn", "Basic Value Numbering (default GVN impl)");
+  X("basicvn", "Basic Value Numbering (default GVN impl)", true, true);
 
   // Declare that we implement the ValueNumbering interface
   RegisterAnalysisGroup<ValueNumbering, true> Y(X);
index 64332a0df56e50f874f207dfa35b048d0868c6f7..0a98fb790d66861ed435a52dca22b594ab2ca3f1 100644 (file)
@@ -33,7 +33,8 @@ using namespace llvm;
 // Handle the Pass registration stuff necessary to use TargetData's.
 namespace {
   // Register the default SparcV9 implementation...
-  RegisterPass<TargetData> X("targetdata", "Target Data Layout");
+  RegisterPass<TargetData> X("targetdata", "Target Data Layout", false, 
+                             true);
 }
 char TargetData::ID = 0;
 
index ceb1df8c63883b56dae7813e0a151c7ac089fc4d..28f772f93f64f2b16909b3b17352eb3113ed3a4f 100644 (file)
@@ -54,7 +54,7 @@ TEMPLATE_INSTANTIATION(class DominatorTreeBase<BasicBlock>);
 
 char DominatorTree::ID = 0;
 static RegisterPass<DominatorTree>
-E("domtree", "Dominator Tree Construction", true);
+E("domtree", "Dominator Tree Construction", true, true);
 
 bool DominatorTree::runOnFunction(Function &F) {
   DT->recalculate(F);
@@ -68,7 +68,7 @@ bool DominatorTree::runOnFunction(Function &F) {
 
 char DominanceFrontier::ID = 0;
 static RegisterPass<DominanceFrontier>
-G("domfrontier", "Dominance Frontier Construction", true);
+G("domfrontier", "Dominance Frontier Construction", true, true);
 
 // NewBB is split and now it has one successor. Update dominace frontier to
 // reflect this change.
index 7db6aa2643d804ac13660fd89f380533451e875c..6c8d0624e6849c4d557fa5623bebb6a33eee6e6c 100644 (file)
@@ -426,11 +426,14 @@ void PMTopLevelManager::schedulePass(Pass *P) {
   // Give pass a chance to prepare the stage.
   P->preparePassManager(activeStack);
 
+#if 1
   // If P is an analysis pass and it is available then do not
   // generate the analysis again. Stale analysis info should not be
   // available at this point.
-  if (P->isAnalysis() && findAnalysisPass(P->getPassInfo()))
+  if (P->getPassInfo() &&
+      P->getPassInfo()->isAnalysis() && findAnalysisPass(P->getPassInfo()))
     return;
+#endif
 
   AnalysisUsage AnUsage;
   P->getAnalysisUsage(AnUsage);