PassInfo keep tracks whether a pass is an analysis pass or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48554 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2008-03-19 21:56:59 +00:00
parent 7925ed05d0
commit c758209153
35 changed files with 92 additions and 75 deletions

View 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>

View 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

View 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.

View 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);

View 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);

View 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.

View 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.
///

View 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);
}

View 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.

View 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.

View 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.

View 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) {
}
};

View 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);
}

View 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(); }

View 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);
}

View 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);
}

View 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);

View 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

View 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).

View 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

View 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.

View 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);
}

View 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(); }

View 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

View 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);

View 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

View 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();

View 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,

View 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);

View 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

View 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;

View 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);

View 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;

View 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.

View 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);