mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
This commit is contained in:
parent
3547c114ac
commit
a39dcb5377
@ -208,53 +208,6 @@ struct RegisterPass : public RegisterPassBase {
|
||||
}
|
||||
};
|
||||
|
||||
/// RegisterOpt - Register something that is to show up in Opt, this is just a
|
||||
/// shortcut for specifying RegisterPass...
|
||||
///
|
||||
template<typename PassName>
|
||||
struct RegisterOpt : public RegisterPassBase {
|
||||
RegisterOpt(const char *PassArg, const char *Name, bool CFGOnly = false)
|
||||
: RegisterPassBase(Name, PassArg, typeid(PassName),
|
||||
callDefaultCtor<PassName>) {
|
||||
if (CFGOnly) setOnlyUsesCFG();
|
||||
}
|
||||
|
||||
/// Register Pass using default constructor explicitly...
|
||||
///
|
||||
RegisterOpt(const char *PassArg, const char *Name, Pass *(*ctor)(),
|
||||
bool CFGOnly = false)
|
||||
: RegisterPassBase(Name, PassArg, typeid(PassName), ctor) {
|
||||
if (CFGOnly) setOnlyUsesCFG();
|
||||
}
|
||||
|
||||
/// Register FunctionPass using default constructor explicitly...
|
||||
///
|
||||
RegisterOpt(const char *PassArg, const char *Name, FunctionPass *(*ctor)(),
|
||||
bool CFGOnly = false)
|
||||
: RegisterPassBase(Name, PassArg, typeid(PassName),
|
||||
static_cast<Pass*(*)()>(ctor)) {
|
||||
if (CFGOnly) setOnlyUsesCFG();
|
||||
}
|
||||
|
||||
/// Register Pass using TargetMachine constructor...
|
||||
///
|
||||
RegisterOpt(const char *PassArg, const char *Name,
|
||||
Pass *(*targetctor)(TargetMachine &), bool CFGOnly = false)
|
||||
: RegisterPassBase(Name, PassArg, typeid(PassName), 0, targetctor) {
|
||||
if (CFGOnly) setOnlyUsesCFG();
|
||||
}
|
||||
|
||||
/// Register FunctionPass using TargetMachine constructor...
|
||||
///
|
||||
RegisterOpt(const char *PassArg, const char *Name,
|
||||
FunctionPass *(*targetctor)(TargetMachine &),
|
||||
bool CFGOnly = false)
|
||||
: RegisterPassBase(Name, PassArg, typeid(PassName), 0,
|
||||
static_cast<Pass*(*)(TargetMachine&)>(targetctor)) {
|
||||
if (CFGOnly) setOnlyUsesCFG();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/// RegisterAnalysisGroup - Register a Pass as a member of an analysis _group_.
|
||||
/// Analysis groups are used to define an interface (which need not derive from
|
||||
|
@ -109,7 +109,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<AliasAnalysisCounter>
|
||||
RegisterPass<AliasAnalysisCounter>
|
||||
X("count-aa", "Count Alias Analysis Query Responses");
|
||||
RegisterAnalysisGroup<AliasAnalysis, AliasAnalysisCounter> Y;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace {
|
||||
bool doFinalization(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<AAEval>
|
||||
RegisterPass<AAEval>
|
||||
X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator");
|
||||
}
|
||||
|
||||
|
@ -568,5 +568,5 @@ namespace {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
RegisterOpt<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
|
||||
RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer");
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ namespace {
|
||||
};
|
||||
|
||||
// Register this pass...
|
||||
RegisterOpt<NoAA>
|
||||
RegisterPass<NoAA>
|
||||
U("no-aa", "No Alias Analysis (always returns 'may' alias)");
|
||||
|
||||
// Declare that we implement the AliasAnalysis interface
|
||||
@ -117,7 +117,7 @@ namespace {
|
||||
};
|
||||
|
||||
// Register this pass...
|
||||
RegisterOpt<BasicAliasAnalysis>
|
||||
RegisterPass<BasicAliasAnalysis>
|
||||
X("basicaa", "Basic Alias Analysis (default AA impl)");
|
||||
|
||||
// Declare that we implement the AliasAnalysis interface
|
||||
|
@ -96,7 +96,7 @@ namespace {
|
||||
};
|
||||
|
||||
// Register the pass...
|
||||
RegisterOpt<DSAA> X("ds-aa", "Data Structure Graph Based Alias Analysis");
|
||||
RegisterPass<DSAA> X("ds-aa", "Data Structure Graph Based Alias Analysis");
|
||||
|
||||
// Register as an implementation of AliasAnalysis
|
||||
RegisterAnalysisGroup<AliasAnalysis, DSAA> Y;
|
||||
|
@ -47,7 +47,7 @@ namespace {
|
||||
bool OptimizeGlobals(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<DSOpt> X("ds-opt", "DSA-based simple optimizations");
|
||||
RegisterPass<DSOpt> X("ds-opt", "DSA-based simple optimizations");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createDSOptPass() { return new DSOpt(); }
|
||||
|
@ -73,7 +73,7 @@ namespace {
|
||||
};
|
||||
|
||||
// Register the pass...
|
||||
RegisterOpt<Steens> X("steens-aa",
|
||||
RegisterPass<Steens> X("steens-aa",
|
||||
"Steensgaard's alias analysis (DSGraph based)");
|
||||
|
||||
// Register as an implementation of AliasAnalysis
|
||||
|
@ -336,7 +336,7 @@ namespace {
|
||||
void visitInstruction(Instruction &I);
|
||||
};
|
||||
|
||||
RegisterOpt<Andersens> X("anders-aa",
|
||||
RegisterPass<Andersens> X("anders-aa",
|
||||
"Andersen's Interprocedural Alias Analysis");
|
||||
RegisterAnalysisGroup<AliasAnalysis, Andersens> Y;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ private:
|
||||
};
|
||||
|
||||
RegisterAnalysisGroup<CallGraph> X("Call Graph");
|
||||
RegisterOpt<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction");
|
||||
RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction");
|
||||
RegisterAnalysisGroup<CallGraph, BasicCallGraph, true> Z;
|
||||
|
||||
} //End anonymous namespace
|
||||
|
@ -135,7 +135,7 @@ namespace {
|
||||
std::vector<Function*> &Writers);
|
||||
};
|
||||
|
||||
RegisterOpt<GlobalsModRef> X("globalsmodref-aa",
|
||||
RegisterPass<GlobalsModRef> X("globalsmodref-aa",
|
||||
"Simple mod/ref analysis for globals");
|
||||
RegisterAnalysisGroup<AliasAnalysis, GlobalsModRef> Y;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ namespace {
|
||||
};
|
||||
|
||||
// Register this pass...
|
||||
RegisterOpt<LoadVN> X("load-vn", "Load Value Numbering");
|
||||
RegisterPass<LoadVN> X("load-vn", "Load Value Numbering");
|
||||
|
||||
// Declare that we implement the ValueNumbering interface
|
||||
RegisterAnalysisGroup<ValueNumbering, LoadVN> Y;
|
||||
|
@ -85,7 +85,7 @@ namespace {
|
||||
struct NoProfileInfo : public ImmutablePass, public ProfileInfo {};
|
||||
|
||||
// Register this pass...
|
||||
RegisterOpt<NoProfileInfo>
|
||||
RegisterPass<NoProfileInfo>
|
||||
X("no-profile", "No Profile Information");
|
||||
|
||||
// Declare that we implement the ProfileInfo interface
|
||||
|
@ -49,7 +49,7 @@ namespace {
|
||||
virtual bool runOnModule(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<LoaderPass>
|
||||
RegisterPass<LoaderPass>
|
||||
X("profile-loader", "Load profile information from llvmprof.out");
|
||||
|
||||
RegisterAnalysisGroup<ProfileInfo, LoaderPass> Y;
|
||||
|
@ -60,7 +60,7 @@ namespace {
|
||||
};
|
||||
|
||||
// Register this pass...
|
||||
RegisterOpt<BasicVN>
|
||||
RegisterPass<BasicVN>
|
||||
X("basicvn", "Basic Value Numbering (default GVN impl)");
|
||||
|
||||
// Declare that we implement the ValueNumbering interface
|
||||
|
@ -35,7 +35,7 @@ namespace {
|
||||
class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
|
||||
virtual bool runOnFunction(Function &F);
|
||||
};
|
||||
RegisterOpt<UnreachableBlockElim>
|
||||
RegisterPass<UnreachableBlockElim>
|
||||
X("unreachableblockelim", "Remove unreachable blocks from the CFG");
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
RegisterOpt<Hello> X("hello", "Hello World Pass");
|
||||
RegisterPass<Hello> X("hello", "Hello World Pass");
|
||||
|
||||
// Hello2 - The second implementation with getAnalysisUsage implemented.
|
||||
struct Hello2 : public FunctionPass {
|
||||
@ -52,5 +52,6 @@ namespace {
|
||||
AU.setPreservesAll();
|
||||
};
|
||||
};
|
||||
RegisterOpt<Hello2> Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)");
|
||||
RegisterPass<Hello2> Y("hello2",
|
||||
"Hello World Pass (with getAnalysisUsage implemented)");
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ namespace {
|
||||
Function *DoPromotion(Function *F, std::vector<Argument*> &ArgsToPromote);
|
||||
};
|
||||
|
||||
RegisterOpt<ArgPromotion> X("argpromotion",
|
||||
RegisterPass<ArgPromotion> X("argpromotion",
|
||||
"Promote 'by reference' arguments to scalars");
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace {
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<ConstantMerge> X("constmerge","Merge Duplicate Global Constants");
|
||||
RegisterPass<ConstantMerge>X("constmerge","Merge Duplicate Global Constants");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createConstantMergePass() { return new ConstantMerge(); }
|
||||
|
@ -93,7 +93,7 @@ namespace {
|
||||
|
||||
void RemoveDeadArgumentsFromFunction(Function *F);
|
||||
};
|
||||
RegisterOpt<DAE> X("deadargelim", "Dead Argument Elimination");
|
||||
RegisterPass<DAE> X("deadargelim", "Dead Argument Elimination");
|
||||
|
||||
/// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but
|
||||
/// deletes arguments to functions which are external. This is only for use
|
||||
|
@ -36,7 +36,7 @@ namespace {
|
||||
AU.addRequired<FindUsedTypes>();
|
||||
}
|
||||
};
|
||||
RegisterOpt<DTE> X("deadtypeelim", "Dead Type Elimination");
|
||||
RegisterPass<DTE> X("deadtypeelim", "Dead Type Elimination");
|
||||
Statistic<>
|
||||
NumKilled("deadtypeelim", "Number of unused typenames removed from symtab");
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ namespace {
|
||||
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
RegisterOpt<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
|
||||
RegisterPass<FunctionResolvingPass> X("funcresolve", "Resolve Functions");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createFunctionResolvingPass() {
|
||||
@ -314,7 +314,8 @@ bool FunctionResolvingPass::runOnModule(Module &M) {
|
||||
Globals[F->getName()].push_back(F);
|
||||
}
|
||||
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ) {
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; ) {
|
||||
GlobalVariable *GV = I++;
|
||||
if (GV->use_empty() && GV->isExternal()) {
|
||||
M.getGlobalList().erase(GV);
|
||||
@ -346,7 +347,8 @@ bool FunctionResolvingPass::runOnModule(Module &M) {
|
||||
++I;
|
||||
}
|
||||
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; )
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; )
|
||||
if (I->isExternal() && I->use_empty()) {
|
||||
GlobalVariable *GV = I;
|
||||
++I;
|
||||
|
@ -44,7 +44,7 @@ namespace {
|
||||
bool SafeToDestroyConstant(Constant* C);
|
||||
bool RemoveUnusedGlobalValue(GlobalValue &GV);
|
||||
};
|
||||
RegisterOpt<GlobalDCE> X("globaldce", "Dead Global Elimination");
|
||||
RegisterPass<GlobalDCE> X("globaldce", "Dead Global Elimination");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createGlobalDCEPass() { return new GlobalDCE(); }
|
||||
|
@ -60,10 +60,10 @@ namespace {
|
||||
bool OptimizeFunctions(Module &M);
|
||||
bool OptimizeGlobalVars(Module &M);
|
||||
bool OptimizeGlobalCtorsList(GlobalVariable *&GCL);
|
||||
bool ProcessInternalGlobal(GlobalVariable *GV, Module::global_iterator &GVI);
|
||||
bool ProcessInternalGlobal(GlobalVariable *GV,Module::global_iterator &GVI);
|
||||
};
|
||||
|
||||
RegisterOpt<GlobalOpt> X("globalopt", "Global Variable Optimizer");
|
||||
RegisterPass<GlobalOpt> X("globalopt", "Global Variable Optimizer");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createGlobalOptimizerPass() { return new GlobalOpt(); }
|
||||
@ -800,7 +800,8 @@ static bool ValueIsOnlyUsedLocallyOrStoredToOneGlobal(Instruction *V,
|
||||
// OptimizeOnceStoredGlobal - Try to optimize globals based on the knowledge
|
||||
// that only one value (besides its initializer) is ever stored to the global.
|
||||
static bool OptimizeOnceStoredGlobal(GlobalVariable *GV, Value *StoredOnceVal,
|
||||
Module::global_iterator &GVI, TargetData &TD) {
|
||||
Module::global_iterator &GVI,
|
||||
TargetData &TD) {
|
||||
if (CastInst *CI = dyn_cast<CastInst>(StoredOnceVal))
|
||||
StoredOnceVal = CI->getOperand(0);
|
||||
else if (GetElementPtrInst *GEPI =dyn_cast<GetElementPtrInst>(StoredOnceVal)){
|
||||
|
@ -38,7 +38,7 @@ namespace {
|
||||
bool PropagateConstantsIntoArguments(Function &F);
|
||||
bool PropagateConstantReturn(Function &F);
|
||||
};
|
||||
RegisterOpt<IPCP> X("ipconstprop", "Interprocedural constant propagation");
|
||||
RegisterPass<IPCP> X("ipconstprop", "Interprocedural constant propagation");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); }
|
||||
|
@ -38,7 +38,7 @@ namespace {
|
||||
IndMemRemPass();
|
||||
virtual bool runOnModule(Module &M);
|
||||
};
|
||||
RegisterOpt<IndMemRemPass> X("indmemrem", "Indirect Malloc and Free Removal");
|
||||
RegisterPass<IndMemRemPass> X("indmemrem","Indirect Malloc and Free Removal");
|
||||
} // end anonymous namespace
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace {
|
||||
public:
|
||||
int getInlineCost(CallSite CS);
|
||||
};
|
||||
RegisterOpt<SimpleInliner> X("inline", "Function Integration/Inlining");
|
||||
RegisterPass<SimpleInliner> X("inline", "Function Integration/Inlining");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createFunctionInliningPass() { return new SimpleInliner(); }
|
||||
|
@ -49,7 +49,7 @@ namespace {
|
||||
void LoadFile(const char *Filename);
|
||||
virtual bool runOnModule(Module &M);
|
||||
};
|
||||
RegisterOpt<InternalizePass> X("internalize", "Internalize Global Symbols");
|
||||
RegisterPass<InternalizePass> X("internalize", "Internalize Global Symbols");
|
||||
} // end anonymous namespace
|
||||
|
||||
InternalizePass::InternalizePass(bool InternalizeEverything)
|
||||
|
@ -46,7 +46,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<LoopExtractor>
|
||||
RegisterPass<LoopExtractor>
|
||||
X("loop-extract", "Extract loops into new functions");
|
||||
|
||||
/// SingleLoopExtractor - For bugpoint.
|
||||
@ -54,7 +54,7 @@ namespace {
|
||||
SingleLoopExtractor() : LoopExtractor(1) {}
|
||||
};
|
||||
|
||||
RegisterOpt<SingleLoopExtractor>
|
||||
RegisterPass<SingleLoopExtractor>
|
||||
Y("loop-extract-single", "Extract at most one loop into a new function");
|
||||
} // End anonymous namespace
|
||||
|
||||
@ -148,7 +148,7 @@ namespace {
|
||||
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
RegisterOpt<BlockExtractorPass>
|
||||
RegisterPass<BlockExtractorPass>
|
||||
XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ namespace {
|
||||
bool doInitialization(Module& M);
|
||||
};
|
||||
|
||||
RegisterOpt<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
|
||||
RegisterPass<LowerSetJmp> X("lowersetjmp", "Lower Set Jump");
|
||||
} // end anonymous namespace
|
||||
|
||||
// run - Run the transformation on the program. We grab the function
|
||||
|
@ -46,7 +46,7 @@ namespace {
|
||||
bool SimplifyFunction(Function *F);
|
||||
void DeleteBasicBlock(BasicBlock *BB);
|
||||
};
|
||||
RegisterOpt<PruneEH> X("prune-eh", "Remove unused exception handling info");
|
||||
RegisterPass<PruneEH> X("prune-eh", "Remove unused exception handling info");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createPruneEHPass() { return new PruneEH(); }
|
||||
|
@ -44,7 +44,7 @@ namespace {
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<RaiseAllocations>
|
||||
RegisterPass<RaiseAllocations>
|
||||
X("raiseallocs", "Raise allocations from calls to instructions");
|
||||
} // end anonymous namespace
|
||||
|
||||
|
@ -366,8 +366,8 @@ private:
|
||||
};
|
||||
|
||||
// Register the pass
|
||||
RegisterOpt<SimplifyLibCalls>
|
||||
X("simplify-libcalls","Simplify well-known library calls");
|
||||
RegisterPass<SimplifyLibCalls>
|
||||
X("simplify-libcalls", "Simplify well-known library calls");
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace {
|
||||
AU.setPreservesAll();
|
||||
}
|
||||
};
|
||||
RegisterOpt<StripSymbols> X("strip", "Strip all symbols from a module");
|
||||
RegisterPass<StripSymbols> X("strip", "Strip all symbols from a module");
|
||||
}
|
||||
|
||||
ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) {
|
||||
@ -75,7 +75,8 @@ bool StripSymbols::runOnModule(Module &M) {
|
||||
// If we're not just stripping debug info, strip all symbols from the
|
||||
// functions and the names from any internal globals.
|
||||
if (!OnlyDebugInfo) {
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
|
||||
I != E; ++I)
|
||||
if (I->hasInternalLinkage())
|
||||
I->setName(""); // Internal symbols can't participate in linkage
|
||||
|
||||
|
@ -35,7 +35,7 @@ namespace {
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<FunctionProfiler> X("insert-function-profiling",
|
||||
RegisterPass<FunctionProfiler> X("insert-function-profiling",
|
||||
"Insert instrumentation for function profiling");
|
||||
RegisterAnalysisGroup<RSProfilers, FunctionProfiler> XG;
|
||||
|
||||
@ -81,7 +81,7 @@ namespace {
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<BlockProfiler> Y("insert-block-profiling",
|
||||
RegisterPass<BlockProfiler> Y("insert-block-profiling",
|
||||
"Insert instrumentation for block profiling");
|
||||
RegisterAnalysisGroup<RSProfilers, BlockProfiler> YG;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ namespace {
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<EdgeProfiler> X("insert-edge-profiling",
|
||||
RegisterPass<EdgeProfiler> X("insert-edge-profiling",
|
||||
"Insert instrumentation for edge profiling");
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ namespace {
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<EmitFunctionTable>
|
||||
RegisterPass<EmitFunctionTable>
|
||||
X("emitfuncs", "Emit a function table for the reoptimizer");
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ namespace {
|
||||
};
|
||||
|
||||
static RegisterAnalysisGroup<RSProfilers> A("Profiling passes");
|
||||
static RegisterOpt<NullProfilerRS> NP("insert-null-profiling-rs",
|
||||
static RegisterPass<NullProfilerRS> NP("insert-null-profiling-rs",
|
||||
"Measure profiling framework overhead");
|
||||
static RegisterAnalysisGroup<RSProfilers, NullProfilerRS, true> NPT;
|
||||
|
||||
@ -160,7 +160,7 @@ namespace {
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
||||
};
|
||||
|
||||
RegisterOpt<ProfilerRS> X("insert-rs-profiling-framework",
|
||||
RegisterPass<ProfilerRS> X("insert-rs-profiling-framework",
|
||||
"Insert random sampling instrumentation framework");
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace {
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<TraceBasicBlocks> X("trace-basic-blocks",
|
||||
RegisterPass<TraceBasicBlocks> X("trace-basic-blocks",
|
||||
"Insert instrumentation for basic block tracing");
|
||||
}
|
||||
|
||||
|
@ -104,8 +104,8 @@ namespace {
|
||||
};
|
||||
|
||||
// Register the passes...
|
||||
RegisterOpt<FunctionTracer> X("tracem","Insert Function trace code only");
|
||||
RegisterOpt<BasicBlockTracer> Y("trace","Insert BB and Function trace code");
|
||||
RegisterPass<FunctionTracer> X("tracem","Insert Function trace code only");
|
||||
RegisterPass<BasicBlockTracer> Y("trace","Insert BB and Function trace code");
|
||||
} // end anonymous namespace
|
||||
|
||||
/// Just trace functions
|
||||
|
@ -80,7 +80,7 @@ namespace {
|
||||
bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI);
|
||||
};
|
||||
|
||||
RegisterOpt<RPR> X("raise", "Raise Pointer References");
|
||||
RegisterPass<RPR> X("raise", "Raise Pointer References");
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +102,7 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<ADCE> X("adce", "Aggressive Dead Code Elimination");
|
||||
RegisterPass<ADCE> X("adce", "Aggressive Dead Code Elimination");
|
||||
} // End of anonymous namespace
|
||||
|
||||
FunctionPass *llvm::createAggressiveDCEPass() { return new ADCE(); }
|
||||
|
@ -68,7 +68,7 @@ namespace {
|
||||
void PlaceBlocks(BasicBlock *BB);
|
||||
};
|
||||
|
||||
RegisterOpt<BlockPlacement> X("block-placement",
|
||||
RegisterPass<BlockPlacement> X("block-placement",
|
||||
"Profile Guided Basic Block Placement");
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace {
|
||||
void SimplifyPredecessors(SwitchInst *SI);
|
||||
void RevectorBlockTo(BasicBlock *FromBB, BasicBlock *ToBB);
|
||||
};
|
||||
RegisterOpt<CondProp> X("condprop", "Conditional Propagation");
|
||||
RegisterPass<CondProp> X("condprop", "Conditional Propagation");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createCondPropagationPass() {
|
||||
|
@ -39,7 +39,8 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<ConstantPropagation> X("constprop","Simple constant propagation");
|
||||
RegisterPass<ConstantPropagation> X("constprop",
|
||||
"Simple constant propagation");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createConstantPropagationPass() {
|
||||
|
@ -286,7 +286,7 @@ namespace {
|
||||
bool SimplifyBasicBlock(BasicBlock &BB, const RegionInfo &RI);
|
||||
bool SimplifyInstruction(Instruction *Inst, const RegionInfo &RI);
|
||||
};
|
||||
RegisterOpt<CEE> X("cee", "Correlated Expression Elimination");
|
||||
RegisterPass<CEE> X("cee", "Correlated Expression Elimination");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createCorrelatedExpressionEliminationPass() {
|
||||
|
@ -50,7 +50,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<DeadInstElimination> X("die", "Dead Instruction Elimination");
|
||||
RegisterPass<DeadInstElimination> X("die", "Dead Instruction Elimination");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createDeadInstEliminationPass() {
|
||||
@ -71,7 +71,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<DCE> Y("dce", "Dead Code Elimination");
|
||||
RegisterPass<DCE> Y("dce", "Dead Code Elimination");
|
||||
}
|
||||
|
||||
bool DCE::runOnFunction(Function &F) {
|
||||
|
@ -54,7 +54,7 @@ namespace {
|
||||
AU.addPreserved<AliasAnalysis>();
|
||||
}
|
||||
};
|
||||
RegisterOpt<DSE> X("dse", "Dead Store Elimination");
|
||||
RegisterPass<DSE> X("dse", "Dead Store Elimination");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); }
|
||||
|
@ -51,7 +51,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<GCSE> X("gcse", "Global Common Subexpression Elimination");
|
||||
RegisterPass<GCSE> X("gcse", "Global Common Subexpression Elimination");
|
||||
}
|
||||
|
||||
// createGCSEPass - The public interface to this file...
|
||||
|
@ -92,7 +92,7 @@ namespace {
|
||||
|
||||
void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
|
||||
};
|
||||
RegisterOpt<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
|
||||
RegisterPass<IndVarSimplify> X("indvars", "Canonicalize Induction Variables");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createIndVarSimplifyPass() {
|
||||
|
@ -264,7 +264,7 @@ namespace {
|
||||
Value *EvaluateInDifferentType(Value *V, const Type *Ty);
|
||||
};
|
||||
|
||||
RegisterOpt<InstCombiner> X("instcombine", "Combine redundant instructions");
|
||||
RegisterPass<InstCombiner> X("instcombine", "Combine redundant instructions");
|
||||
}
|
||||
|
||||
// getComplexity: Assign a complexity or rank value to LLVM Values...
|
||||
|
@ -197,7 +197,7 @@ namespace {
|
||||
std::map<Value*, AllocaInst*> &Val2AlMap);
|
||||
};
|
||||
|
||||
RegisterOpt<LICM> X("licm", "Loop Invariant Code Motion");
|
||||
RegisterPass<LICM> X("licm", "Loop Invariant Code Motion");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createLICMPass() { return new LICM(); }
|
||||
|
@ -194,8 +194,7 @@ private:
|
||||
Loop *L, bool isOnlyStride);
|
||||
void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
|
||||
};
|
||||
RegisterOpt<LoopStrengthReduce> X("loop-reduce",
|
||||
"Loop Strength Reduction");
|
||||
RegisterPass<LoopStrengthReduce> X("loop-reduce", "Loop Strength Reduction");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) {
|
||||
|
@ -60,7 +60,7 @@ namespace {
|
||||
AU.addPreserved<LoopInfo>();
|
||||
}
|
||||
};
|
||||
RegisterOpt<LoopUnroll> X("loop-unroll", "Unroll loops");
|
||||
RegisterPass<LoopUnroll> X("loop-unroll", "Unroll loops");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createLoopUnrollPass() { return new LoopUnroll(); }
|
||||
|
@ -103,7 +103,7 @@ namespace {
|
||||
std::vector<Instruction*> &Worklist);
|
||||
void RemoveLoopFromHierarchy(Loop *L);
|
||||
};
|
||||
RegisterOpt<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
|
||||
RegisterPass<LoopUnswitch> X("loop-unswitch", "Unswitch loops");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createLoopUnswitchPass() { return new LoopUnswitch(); }
|
||||
|
@ -56,7 +56,7 @@ namespace {
|
||||
const StructType *getRootRecordType(unsigned NumRoots);
|
||||
};
|
||||
|
||||
RegisterOpt<LowerGC>
|
||||
RegisterPass<LowerGC>
|
||||
X("lowergc", "Lower GC intrinsics, for GCless code generators");
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ private:
|
||||
std::vector<Instruction*> instrsToRemove;
|
||||
};
|
||||
|
||||
RegisterOpt<LowerPacked>
|
||||
RegisterPass<LowerPacked>
|
||||
X("lower-packed",
|
||||
"lowers packed operations to operations on smaller packed datatypes");
|
||||
|
||||
|
@ -90,7 +90,7 @@ namespace {
|
||||
void RemoveDeadBinaryOp(Value *V);
|
||||
};
|
||||
|
||||
RegisterOpt<Reassociate> X("reassociate", "Reassociate expressions");
|
||||
RegisterPass<Reassociate> X("reassociate", "Reassociate expressions");
|
||||
}
|
||||
|
||||
// Public interface to the Reassociate pass
|
||||
|
@ -76,7 +76,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<RegToMem> X("reg2mem", "Demote all values to stack slots");
|
||||
RegisterPass<RegToMem> X("reg2mem", "Demote all values to stack slots");
|
||||
}
|
||||
|
||||
// createDemoteRegisterToMemory - Provide an entry point to create this pass.
|
||||
|
@ -1075,7 +1075,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
|
||||
RegisterPass<SCCP> X("sccp", "Sparse Conditional Constant Propagation");
|
||||
} // end anonymous namespace
|
||||
|
||||
|
||||
@ -1183,7 +1183,7 @@ namespace {
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
|
||||
RegisterOpt<IPSCCP>
|
||||
RegisterPass<IPSCCP>
|
||||
Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation");
|
||||
} // end anonymous namespace
|
||||
|
||||
|
@ -70,7 +70,7 @@ namespace {
|
||||
void ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset);
|
||||
};
|
||||
|
||||
RegisterOpt<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
|
||||
RegisterPass<SROA> X("scalarrepl", "Scalar Replacement of Aggregates");
|
||||
}
|
||||
|
||||
// Public interface to the ScalarReplAggregates pass
|
||||
|
@ -35,7 +35,7 @@ namespace {
|
||||
struct CFGSimplifyPass : public FunctionPass {
|
||||
virtual bool runOnFunction(Function &F);
|
||||
};
|
||||
RegisterOpt<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
|
||||
RegisterPass<CFGSimplifyPass> X("simplifycfg", "Simplify the CFG");
|
||||
}
|
||||
|
||||
// Public interface to the CFGSimplification pass
|
||||
|
@ -47,7 +47,7 @@ namespace {
|
||||
inline bool shouldEliminateUnconditionalBranch(TerminatorInst *TI);
|
||||
inline void eliminateUnconditionalBranch(BranchInst *BI);
|
||||
};
|
||||
RegisterOpt<TailDup> X("tailduplicate", "Tail Duplication");
|
||||
RegisterPass<TailDup> X("tailduplicate", "Tail Duplication");
|
||||
}
|
||||
|
||||
// Public interface to the Tail Duplication pass
|
||||
|
@ -75,7 +75,7 @@ namespace {
|
||||
bool CanMoveAboveCall(Instruction *I, CallInst *CI);
|
||||
Value *CanTransformAccumulatorRecursion(Instruction *I, CallInst *CI);
|
||||
};
|
||||
RegisterOpt<TailCallElim> X("tailcallelim", "Tail Call Elimination");
|
||||
RegisterPass<TailCallElim> X("tailcallelim", "Tail Call Elimination");
|
||||
}
|
||||
|
||||
// Public interface to the TailCallElimination pass
|
||||
|
@ -47,7 +47,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<BreakCriticalEdges> X("break-crit-edges",
|
||||
RegisterPass<BreakCriticalEdges> X("break-crit-edges",
|
||||
"Break critical edges in CFG");
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
|
||||
RegisterPass<LCSSA> X("lcssa", "Loop-Closed SSA Form Pass");
|
||||
}
|
||||
|
||||
FunctionPass *llvm::createLCSSAPass() { return new LCSSA(); }
|
||||
|
@ -89,7 +89,7 @@ namespace {
|
||||
std::vector<BasicBlock*> &PredBlocks);
|
||||
};
|
||||
|
||||
RegisterOpt<LoopSimplify>
|
||||
RegisterPass<LoopSimplify>
|
||||
X("loopsimplify", "Canonicalize natural loops", true);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ namespace {
|
||||
bool runOnBasicBlock(BasicBlock &BB);
|
||||
};
|
||||
|
||||
RegisterOpt<LowerAllocations>
|
||||
RegisterPass<LowerAllocations>
|
||||
X("lowerallocs", "Lower allocations from instructions to calls");
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ namespace {
|
||||
unsigned JumpBufAlign;
|
||||
};
|
||||
|
||||
RegisterOpt<LowerInvoke>
|
||||
RegisterPass<LowerInvoke>
|
||||
X("lowerinvoke", "Lower invoke and unwind, for unwindless code generators");
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ namespace {
|
||||
bool runOnFunction(Function &F);
|
||||
};
|
||||
|
||||
RegisterOpt<LowerSelect>
|
||||
RegisterPass<LowerSelect>
|
||||
X("lowerselect", "Lower select instructions to branches");
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<LowerSwitch>
|
||||
RegisterPass<LowerSwitch>
|
||||
X("lowerswitch", "Lower SwitchInst's to branches");
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace {
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<PromotePass> X("mem2reg", "Promote Memory to Register");
|
||||
RegisterPass<PromotePass> X("mem2reg", "Promote Memory to Register");
|
||||
} // end of anonymous namespace
|
||||
|
||||
bool PromotePass::runOnFunction(Function &F) {
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "llvm/Type.h"
|
||||
using namespace llvm;
|
||||
|
||||
static RegisterOpt<UnifyFunctionExitNodes>
|
||||
static RegisterPass<UnifyFunctionExitNodes>
|
||||
X("mergereturn", "Unify function exit nodes");
|
||||
|
||||
int UnifyFunctionExitNodes::stub;
|
||||
|
@ -162,9 +162,9 @@ public:
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
static RegisterOpt<PrintModulePass>
|
||||
static RegisterPass<PrintModulePass>
|
||||
X("printm", "Print module to stderr");
|
||||
static RegisterOpt<PrintFunctionPass>
|
||||
static RegisterPass<PrintFunctionPass>
|
||||
Y("print","Print function to stderr");
|
||||
|
||||
static void WriteAsOperandInternal(std::ostream &Out, const Value *V,
|
||||
|
@ -239,7 +239,7 @@ namespace { // Anonymous namespace for class
|
||||
}
|
||||
};
|
||||
|
||||
RegisterOpt<Verifier> X("verify", "Module Verifier");
|
||||
RegisterPass<Verifier> X("verify", "Module Verifier");
|
||||
} // End anonymous namespace
|
||||
|
||||
|
||||
|
@ -420,7 +420,7 @@ namespace {
|
||||
class BlockExtractorPass : public ModulePass {
|
||||
bool runOnModule(Module &M);
|
||||
};
|
||||
RegisterOpt<BlockExtractorPass>
|
||||
RegisterPass<BlockExtractorPass>
|
||||
XX("extract-bbs", "Extract Basic Blocks From Module (for bugpoint use)");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user