[llvm-commits] [llvm] r48554 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Analysis/ lib/Analysis/ lib/Analysis/IPA/ lib/Target/ lib/VMCore/

Devang Patel dpatel at apple.com
Wed Mar 19 14:57:00 PDT 2008


Author: dpatel
Date: Wed Mar 19 16:56:59 2008
New Revision: 48554

URL: http://llvm.org/viewvc/llvm-project?rev=48554&view=rev
Log:
PassInfo keep tracks whether a pass is an analysis pass or not.

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

Modified: llvm/trunk/docs/WritingAnLLVMPass.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.html?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/docs/WritingAnLLVMPass.html (original)
+++ llvm/trunk/docs/WritingAnLLVMPass.html Wed Mar 19 16:56:59 2008
@@ -292,13 +292,19 @@
 initialization value is not important.</p>
 
 <div class="doc_code"><pre>
-  RegisterPass<Hello> X("<i>hello</i>", "<i>Hello World Pass</i>");
+  RegisterPass<Hello> 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>
 

Modified: llvm/trunk/include/llvm/Analysis/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/Dominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/Dominators.h Wed Mar 19 16:56:59 2008
@@ -664,7 +664,7 @@
   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 @@
   
 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

Modified: llvm/trunk/include/llvm/Analysis/FindUsedTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/FindUsedTypes.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/FindUsedTypes.h (original)
+++ llvm/trunk/include/llvm/Analysis/FindUsedTypes.h Wed Mar 19 16:56:59 2008
@@ -25,7 +25,7 @@
   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.

Modified: llvm/trunk/include/llvm/Analysis/IntervalPartition.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IntervalPartition.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/IntervalPartition.h (original)
+++ llvm/trunk/include/llvm/Analysis/IntervalPartition.h Wed Mar 19 16:56:59 2008
@@ -47,7 +47,7 @@
 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);

Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Wed Mar 19 16:56:59 2008
@@ -879,7 +879,7 @@
 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 @@
     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);

Modified: llvm/trunk/include/llvm/Analysis/LoopPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopPass.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopPass.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopPass.h Wed Mar 19 16:56:59 2008
@@ -29,7 +29,7 @@
 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. 

Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Wed Mar 19 16:56:59 2008
@@ -66,7 +66,7 @@
     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.
     ///

Modified: llvm/trunk/include/llvm/Analysis/PostDominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PostDominators.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/PostDominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/PostDominators.h Wed Mar 19 16:56:59 2008
@@ -25,7 +25,7 @@
   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);
   }
 

Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Wed Mar 19 16:56:59 2008
@@ -192,7 +192,7 @@
     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.

Modified: llvm/trunk/include/llvm/CallGraphSCCPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CallGraphSCCPass.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CallGraphSCCPass.h (original)
+++ llvm/trunk/include/llvm/CallGraphSCCPass.h Wed Mar 19 16:56:59 2008
@@ -31,7 +31,7 @@
 
 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.

Modified: llvm/trunk/include/llvm/Pass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Pass.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Pass.h (original)
+++ llvm/trunk/include/llvm/Pass.h Wed Mar 19 16:56:59 2008
@@ -73,7 +73,6 @@
 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 @@
   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 @@
     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 @@
   ///
   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 @@
 ///
 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 @@
 ///
 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.

Modified: llvm/trunk/include/llvm/PassSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/include/llvm/PassSupport.h (original)
+++ llvm/trunk/include/llvm/PassSupport.h Wed Mar 19 16:56:59 2008
@@ -39,6 +39,7 @@
   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 @@
   /// 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 @@
   /// 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 @@
   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 @@
 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) {
   }
 };
 

Modified: llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp Wed Mar 19 16:56:59 2008
@@ -35,7 +35,7 @@
     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 @@
 
   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);
 }
 

Modified: llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysisEvaluator.cpp Wed Mar 19 16:56:59 2008
@@ -52,7 +52,7 @@
 
   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 @@
 
   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(); }

Modified: llvm/trunk/lib/Analysis/AliasDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasDebugger.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/AliasDebugger.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasDebugger.cpp Wed Mar 19 16:56:59 2008
@@ -41,7 +41,7 @@
     
   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 @@
   };
 
   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);
 }
 

Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Wed Mar 19 16:56:59 2008
@@ -551,7 +551,7 @@
     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 @@
     }
   };
   char AliasSetPrinter::ID = 0;
-  RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
+  RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer", true, true);
 }

Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Mar 19 16:56:59 2008
@@ -83,7 +83,7 @@
   // 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 @@
   // 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);

Modified: llvm/trunk/lib/Analysis/CFGPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFGPrinter.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/CFGPrinter.cpp (original)
+++ llvm/trunk/lib/Analysis/CFGPrinter.cpp Wed Mar 19 16:56:59 2008
@@ -92,7 +92,7 @@
 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 @@
 
   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 @@
 
   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 @@
 
   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 @@
   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

Modified: llvm/trunk/lib/Analysis/IPA/Andersens.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp Wed Mar 19 16:56:59 2008
@@ -430,7 +430,7 @@
 
   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 @@
 
   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).

Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Wed Mar 19 16:56:59 2008
@@ -191,7 +191,7 @@
 };
 
 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

Modified: llvm/trunk/lib/Analysis/IPA/FindUsedTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/FindUsedTypes.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/IPA/FindUsedTypes.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/FindUsedTypes.cpp Wed Mar 19 16:56:59 2008
@@ -23,7 +23,7 @@
 
 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.

Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Wed Mar 19 16:56:59 2008
@@ -84,7 +84,7 @@
 
   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 @@
 
   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);
 }
 

Modified: llvm/trunk/lib/Analysis/InstCount.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstCount.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/InstCount.cpp (original)
+++ llvm/trunk/lib/Analysis/InstCount.cpp Wed Mar 19 16:56:59 2008
@@ -52,7 +52,7 @@
     }
   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 @@
 
   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(); }

Modified: llvm/trunk/lib/Analysis/IntervalPartition.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IntervalPartition.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/IntervalPartition.cpp (original)
+++ llvm/trunk/lib/Analysis/IntervalPartition.cpp Wed Mar 19 16:56:59 2008
@@ -17,7 +17,7 @@
 
 char IntervalPartition::ID = 0;
 static RegisterPass<IntervalPartition>
-X("intervals", "Interval Partition Construction", true);
+X("intervals", "Interval Partition Construction", true, true);
 
 //===----------------------------------------------------------------------===//
 // IntervalPartition Implementation

Modified: llvm/trunk/lib/Analysis/LoadValueNumbering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoadValueNumbering.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/LoadValueNumbering.cpp (original)
+++ llvm/trunk/lib/Analysis/LoadValueNumbering.cpp Wed Mar 19 16:56:59 2008
@@ -41,7 +41,7 @@
   // 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 @@
 
   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);

Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/LoopInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopInfo.cpp Wed Mar 19 16:56:59 2008
@@ -29,7 +29,7 @@
 
 char LoopInfo::ID = 0;
 static RegisterPass<LoopInfo>
-X("loops", "Natural Loop Construction", true);
+X("loops", "Natural Loop Construction", true, true);
 
 //===----------------------------------------------------------------------===//
 // Loop implementation

Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Wed Mar 19 16:56:59 2008
@@ -48,7 +48,7 @@
   
 // 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();

Modified: llvm/trunk/lib/Analysis/PostDominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PostDominators.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/PostDominators.cpp (original)
+++ llvm/trunk/lib/Analysis/PostDominators.cpp Wed Mar 19 16:56:59 2008
@@ -26,7 +26,7 @@
 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 @@
 //===----------------------------------------------------------------------===//
 
 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,

Modified: llvm/trunk/lib/Analysis/ProfileInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfo.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ProfileInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileInfo.cpp Wed Mar 19 16:56:59 2008
@@ -93,7 +93,7 @@
   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);

Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Wed Mar 19 16:56:59 2008
@@ -34,7 +34,7 @@
   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 @@
 
   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

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Mar 19 16:56:59 2008
@@ -103,7 +103,7 @@
 
 namespace {
   RegisterPass<ScalarEvolution>
-  R("scalar-evolution", "Scalar Evolution Analysis");
+  R("scalar-evolution", "Scalar Evolution Analysis", true, true);
 }
 char ScalarEvolution::ID = 0;
 

Modified: llvm/trunk/lib/Analysis/ValueNumbering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueNumbering.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ValueNumbering.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueNumbering.cpp Wed Mar 19 16:56:59 2008
@@ -68,7 +68,7 @@
   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);

Modified: llvm/trunk/lib/Target/TargetData.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/Target/TargetData.cpp (original)
+++ llvm/trunk/lib/Target/TargetData.cpp Wed Mar 19 16:56:59 2008
@@ -33,7 +33,8 @@
 // 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;
 

Modified: llvm/trunk/lib/VMCore/Dominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Dominators.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Dominators.cpp (original)
+++ llvm/trunk/lib/VMCore/Dominators.cpp Wed Mar 19 16:56:59 2008
@@ -54,7 +54,7 @@
 
 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 @@
 
 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.

Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=48554&r1=48553&r2=48554&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Wed Mar 19 16:56:59 2008
@@ -426,11 +426,14 @@
   // 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);





More information about the llvm-commits mailing list