llvm.org GIT mirror llvm / d13db2c
Fix batch of converting RegisterPass<> to INTIALIZE_PASS(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8 Owen Anderson 10 years ago
99 changed file(s) with 230 addition(s) and 222 deletion(s). Raw diff Collapse all Expand all
7373 }
7474
7575 char AAEval::ID = 0;
76 static RegisterPass
77 X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true);
76 INITIALIZE_PASS(AAEval, "aa-eval",
77 "Exhaustive Alias Analysis Precision Evaluator", false, true);
7878
7979 FunctionPass *llvm::createAAEvalPass() { return new AAEval(); }
8080
599599 }
600600
601601 char AliasSetPrinter::ID = 0;
602 static RegisterPass
603 X("print-alias-sets", "Alias Set Printer", false, true);
602 INITIALIZE_PASS(AliasSetPrinter, "print-alias-sets",
603 "Alias Set Printer", false, true);
4040 }
4141
4242 char CFGViewer::ID = 0;
43 static RegisterPass
44 V0("view-cfg", "View CFG of function", false, true);
43 INITIALIZE_PASS(CFGViewer, "view-cfg", "View CFG of function", false, true);
4544
4645 namespace {
4746 struct CFGOnlyViewer : public FunctionPass {
4747 }
4848 };
4949 char PrintDbgInfo::ID = 0;
50 static RegisterPass X("print-dbginfo",
51 "Print debug info in human readable form");
50 INITIALIZE_PASS(PrintDbgInfo, "print-dbginfo",
51 "Print debug info in human readable form", false, false);
5252 }
5353
5454 FunctionPass *llvm::createDbgInfoPrinterPass() { return new PrintDbgInfo(); }
110110 } // end anonymous namespace
111111
112112 char DomViewer::ID = 0;
113 RegisterPass A("view-dom",
114 "View dominance tree of function");
113 INITIALIZE_PASS(DomViewer, "view-dom",
114 "View dominance tree of function", false, false);
115115
116116 char DomOnlyViewer::ID = 0;
117 RegisterPass B("view-dom-only",
118 "View dominance tree of function "
119 "(with no function bodies)");
117 INITIALIZE_PASS(DomOnlyViewer, "view-dom-only",
118 "View dominance tree of function (with no function bodies)",
119 false, false);
120120
121121 char PostDomViewer::ID = 0;
122 RegisterPass C("view-postdom",
123 "View postdominance tree of function");
122 INITIALIZE_PASS(PostDomViewer, "view-postdom",
123 "View postdominance tree of function", false, false);
124124
125125 char PostDomOnlyViewer::ID = 0;
126 RegisterPass D("view-postdom-only",
127 "View postdominance tree of function "
128 "(with no function bodies)");
126 INITIALIZE_PASS(PostDomOnlyViewer, "view-postdom-only",
127 "View postdominance tree of function "
128 "(with no function bodies)",
129 false, false);
129130
130131 namespace {
131132 struct DomPrinter
158159
159160
160161 char DomPrinter::ID = 0;
161 RegisterPass E("dot-dom",
162 "Print dominance tree of function "
163 "to 'dot' file");
162 INITIALIZE_PASS(DomPrinter, "dot-dom",
163 "Print dominance tree of function to 'dot' file",
164 false, false);
164165
165166 char DomOnlyPrinter::ID = 0;
166 RegisterPass F("dot-dom-only",
167 "Print dominance tree of function "
168 "to 'dot' file "
169 "(with no function bodies)");
167 INITIALIZE_PASS(DomOnlyPrinter, "dot-dom-only",
168 "Print dominance tree of function to 'dot' file "
169 "(with no function bodies)",
170 false, false);
170171
171172 char PostDomPrinter::ID = 0;
172 RegisterPass G("dot-postdom",
173 "Print postdominance tree of function "
174 "to 'dot' file");
173 INITIALIZE_PASS(PostDomPrinter, "dot-postdom",
174 "Print postdominance tree of function to 'dot' file",
175 false, false);
175176
176177 char PostDomOnlyPrinter::ID = 0;
177 RegisterPass H("dot-postdom-only",
178 "Print postdominance tree of function "
179 "to 'dot' file "
180 "(with no function bodies)");
178 INITIALIZE_PASS(PostDomOnlyPrinter, "dot-postdom-only",
179 "Print postdominance tree of function to 'dot' file "
180 "(with no function bodies)",
181 false, false);
181182
182183 // Create methods available outside of this file, to use them
183184 // "include/llvm/LinkAllPasses.h". Otherwise the pass would be deleted by
2828 using namespace llvm;
2929
3030 char IVUsers::ID = 0;
31 static RegisterPass
32 X("iv-users", "Induction Variable Users", false, true);
31 INITIALIZE_PASS(IVUsers, "iv-users", "Induction Variable Users", false, true);
3332
3433 Pass *llvm::createIVUsersPass() {
3534 return new IVUsers();
6363 }
6464
6565 char InstCount::ID = 0;
66 static RegisterPass
67 X("instcount", "Counts the various types of Instructions", false, true);
66 INITIALIZE_PASS(InstCount, "instcount",
67 "Counts the various types of Instructions", false, true);
6868
6969 FunctionPass *llvm::createInstCountPass() { return new InstCount(); }
7070
1515 using namespace llvm;
1616
1717 char IntervalPartition::ID = 0;
18 static RegisterPass
19 X("intervals", "Interval Partition Construction", true, true);
18 INITIALIZE_PASS(IntervalPartition, "intervals",
19 "Interval Partition Construction", true, true);
2020
2121 //===----------------------------------------------------------------------===//
2222 // IntervalPartition Implementation
2626 using namespace llvm;
2727
2828 char LazyValueInfo::ID = 0;
29 static RegisterPass
30 X("lazy-value-info", "Lazy Value Information Analysis", false, true);
29 INITIALIZE_PASS(LazyValueInfo, "lazy-value-info",
30 "Lazy Value Information Analysis", false, true);
3131
3232 namespace llvm {
3333 FunctionPass *createLazyValueInfoPass() { return new LazyValueInfo(); }
166166 }
167167
168168 char Lint::ID = 0;
169 static RegisterPass
170 X("lint", "Statically lint-checks LLVM IR", false, true);
169 INITIALIZE_PASS(Lint, "lint", "Statically lint-checks LLVM IR", false, true);
171170
172171 // Assert - We know that cond should be true, if not print an error message.
173172 #define Assert(C, M) \
2121 }
2222
2323 char LiveValues::ID = 0;
24 static RegisterPass
25 X("live-values", "Value Liveness Analysis", false, true);
24 INITIALIZE_PASS(LiveValues, "live-values",
25 "Value Liveness Analysis", false, true);
2626
2727 LiveValues::LiveValues() : FunctionPass(&ID) {}
2828
4545 return new LoopDependenceAnalysis();
4646 }
4747
48 static RegisterPass
49 R("lda", "Loop Dependence Analysis", false, true);
48 INITIALIZE_PASS(LoopDependenceAnalysis, "lda",
49 "Loop Dependence Analysis", false, true);
5050 char LoopDependenceAnalysis::ID = 0;
5151
5252 //===----------------------------------------------------------------------===//
3737 cl::desc("Verify loop info (time consuming)"));
3838
3939 char LoopInfo::ID = 0;
40 static RegisterPass
41 X("loops", "Natural Loop Information", true, true);
40 INITIALIZE_PASS(LoopInfo, "loops", "Natural Loop Information", true, true);
4241
4342 //===----------------------------------------------------------------------===//
4443 // Loop implementation
4545 char MemoryDependenceAnalysis::ID = 0;
4646
4747 // Register this pass...
48 static RegisterPass X("memdep",
49 "Memory Dependence Analysis", false, true);
48 INITIALIZE_PASS(MemoryDependenceAnalysis, "memdep",
49 "Memory Dependence Analysis", false, true);
5050
5151 MemoryDependenceAnalysis::MemoryDependenceAnalysis()
5252 : FunctionPass(&ID), PredCache(0) {
4141 }
4242
4343 char ModuleDebugInfoPrinter::ID = 0;
44 static RegisterPass
45 X("module-debuginfo",
46 "Decodes module-level debug info", false, true);
44 INITIALIZE_PASS(ModuleDebugInfoPrinter, "module-debuginfo",
45 "Decodes module-level debug info", false, true);
4746
4847 ModulePass *llvm::createModuleDebugInfoPrinterPass() {
4948 return new ModuleDebugInfoPrinter();
262262 }
263263 }
264264
265 static RegisterPass X("pointertracking",
266 "Track pointer bounds", false, true);
265 INITIALIZE_PASS(PointerTracking, "pointertracking",
266 "Track pointer bounds", false, true);
2727
2828 char PostDominatorTree::ID = 0;
2929 char PostDominanceFrontier::ID = 0;
30 static RegisterPass
31 F("postdomtree", "Post-Dominator Tree Construction", true, true);
30 INITIALIZE_PASS(PostDominatorTree, "postdomtree",
31 "Post-Dominator Tree Construction", true, true);
3232
3333 bool PostDominatorTree::runOnFunction(Function &F) {
3434 DT->recalculate(F);
365365 char ProfileVerifierPassT::ID = 0;
366366 }
367367
368 static RegisterPass
369 X("profile-verifier", "Verify profiling information", false, true);
368 INITIALIZE_PASS(ProfileVerifierPass, "profile-verifier",
369 "Verify profiling information", false, true);
370370
371371 namespace llvm {
372372 FunctionPass *createProfileVerifierPass() {
102102 "derived loop"),
103103 cl::init(100));
104104
105 static RegisterPass
106 R("scalar-evolution", "Scalar Evolution Analysis", false, true);
105 INITIALIZE_PASS(ScalarEvolution, "scalar-evolution",
106 "Scalar Evolution Analysis", false, true);
107107 char ScalarEvolution::ID = 0;
108108
109109 //===----------------------------------------------------------------------===//
2424 using namespace llvm;
2525
2626 char CalculateSpillWeights::ID = 0;
27 static RegisterPass X("calcspillweights",
28 "Calculate spill weights");
27 INITIALIZE_PASS(CalculateSpillWeights, "calcspillweights",
28 "Calculate spill weights", false, false);
2929
3030 void CalculateSpillWeights::getAnalysisUsage(AnalysisUsage &au) const {
3131 au.addRequired();
4343 }
4444 char DeadMachineInstructionElim::ID = 0;
4545
46 static RegisterPass
47 Y("dead-mi-elimination",
48 "Remove dead machine instructions");
46 INITIALIZE_PASS(DeadMachineInstructionElim, "dead-mi-elimination",
47 "Remove dead machine instructions", false, false);
4948
5049 FunctionPass *llvm::createDeadMachineInstructionElimPass() {
5150 return new DeadMachineInstructionElim();
5454
5555 }
5656
57 static RegisterPass
58 X("collector-metadata", "Create Garbage Collector Module Metadata");
57 INITIALIZE_PASS(GCModuleInfo, "collector-metadata",
58 "Create Garbage Collector Module Metadata", false, false);
5959
6060 // -----------------------------------------------------------------------------
6161
229229 char IfConverter::ID = 0;
230230 }
231231
232 static RegisterPass
233 X("if-converter", "If Converter");
232 INITIALIZE_PASS(IfConverter, "if-converter", "If Converter", false, false);
234233
235234 FunctionPass *llvm::createIfConverterPass() { return new IfConverter(); }
236235
5454 STATISTIC(numSplits , "Number of intervals split");
5555
5656 char LiveIntervals::ID = 0;
57 static RegisterPass X("liveintervals", "Live Interval Analysis");
57 INITIALIZE_PASS(LiveIntervals, "liveintervals",
58 "Live Interval Analysis", false, false);
5859
5960 void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
6061 AU.setPreservesCFG();
2424 using namespace llvm;
2525
2626 char LiveStacks::ID = 0;
27 static RegisterPass X("livestacks", "Live Stack Slot Analysis");
27 INITIALIZE_PASS(LiveStacks, "livestacks",
28 "Live Stack Slot Analysis", false, false);
2829
2930 void LiveStacks::getAnalysisUsage(AnalysisUsage &AU) const {
3031 AU.setPreservesAll();
4141 using namespace llvm;
4242
4343 char LiveVariables::ID = 0;
44 static RegisterPass X("livevars", "Live Variable Analysis");
44 INITIALIZE_PASS(LiveVariables, "livevars",
45 "Live Variable Analysis", false, false);
4546
4647
4748 void LiveVariables::getAnalysisUsage(AnalysisUsage &AU) const {
8484 } // end anonymous namespace
8585
8686 char MachineCSE::ID = 0;
87 static RegisterPass
88 X("machine-cse", "Machine Common Subexpression Elimination");
87 INITIALIZE_PASS(MachineCSE, "machine-cse",
88 "Machine Common Subexpression Elimination", false, false);
8989
9090 FunctionPass *llvm::createMachineCSEPass() { return new MachineCSE(); }
9191
188188 } // end anonymous namespace
189189
190190 char MachineLICM::ID = 0;
191 static RegisterPass
192 X("machinelicm", "Machine Loop Invariant Code Motion");
191 INITIALIZE_PASS(MachineLICM, "machinelicm",
192 "Machine Loop Invariant Code Motion", false, false);
193193
194194 FunctionPass *llvm::createMachineLICMPass(bool PreRegAlloc) {
195195 return new MachineLICM(PreRegAlloc);
2727 using namespace llvm::dwarf;
2828
2929 // Handle the Pass registration stuff necessary to use TargetData's.
30 static RegisterPass
31 X("machinemoduleinfo", "Machine Module Information");
30 INITIALIZE_PASS(MachineModuleInfo, "machinemoduleinfo",
31 "Machine Module Information", false, false);
3232 char MachineModuleInfo::ID = 0;
3333
3434 // Out of line virtual method.
6464 } // end anonymous namespace
6565
6666 char MachineSinking::ID = 0;
67 static RegisterPass
68 X("machine-sink", "Machine code sinking");
67 INITIALIZE_PASS(MachineSinking, "machine-sink",
68 "Machine code sinking", false, false);
6969
7070 FunctionPass *llvm::createMachineSinkingPass() { return new MachineSinking(); }
7171
6262 }
6363
6464 char OptimizeExts::ID = 0;
65 static RegisterPass
66 X("opt-exts", "Optimize sign / zero extensions");
65 INITIALIZE_PASS(OptimizeExts, "opt-exts",
66 "Optimize sign / zero extensions", false, false);
6767
6868 FunctionPass *llvm::createOptimizeExtsPass() { return new OptimizeExts(); }
6969
5353 }
5454
5555 char OptimizePHIs::ID = 0;
56 static RegisterPass
57 X("opt-phis", "Optimize machine instruction PHIs");
56 INITIALIZE_PASS(OptimizePHIs, "opt-phis",
57 "Optimize machine instruction PHIs", false, false);
5858
5959 FunctionPass *llvm::createOptimizePHIsPass() { return new OptimizePHIs(); }
6060
2525 using namespace llvm;
2626
2727 char ProcessImplicitDefs::ID = 0;
28 static RegisterPass X("processimpdefs",
29 "Process Implicit Definitions.");
28 INITIALIZE_PASS(ProcessImplicitDefs, "processimpdefs",
29 "Process Implicit Definitions.", false, false);
3030
3131 void ProcessImplicitDefs::getAnalysisUsage(AnalysisUsage &AU) const {
3232 AU.setPreservesCFG();
3939
4040 char PEI::ID = 0;
4141
42 static RegisterPass
43 X("prologepilog", "Prologue/Epilogue Insertion");
42 INITIALIZE_PASS(PEI, "prologepilog",
43 "Prologue/Epilogue Insertion", false, false);
4444
4545 /// createPrologEpilogCodeInserter - This function returns a pass that inserts
4646 /// prolog and epilog code, and eliminates abstract frame references.
357357 char RALinScan::ID = 0;
358358 }
359359
360 static RegisterPass
361 X("linearscan-regalloc", "Linear Scan Register Allocator");
360 INITIALIZE_PASS(RALinScan, "linearscan-regalloc",
361 "Linear Scan Register Allocator", false, false);
362362
363363 void RALinScan::ComputeRelatedRegClasses() {
364364 // First pass, add all reg classes to the union, and determine at least one
2929 using namespace llvm;
3030
3131 char RenderMachineFunction::ID = 0;
32 static RegisterPass
33 X("rendermf", "Render machine functions (and related info) to HTML pages");
32 INITIALIZE_PASS(RenderMachineFunction, "rendermf",
33 "Render machine functions (and related info) to HTML pages",
34 false, false);
3435
3536 static cl::opt
3637 outputFileSuffix("rmf-file-suffix",
3939 }
4040
4141 char SlotIndexes::ID = 0;
42 static RegisterPass X("slotindexes", "Slot index numbering");
42 INITIALIZE_PASS(SlotIndexes, "slotindexes",
43 "Slot index numbering", false, false);
4344
4445 IndexListEntry* IndexListEntry::getEmptyKeyEntry() {
4546 return &*IndexListEntryEmptyKey;
2828 using namespace llvm;
2929
3030 char LoopSplitter::ID = 0;
31 static RegisterPass
32 X("loop-splitting", "Split virtual regists across loop boundaries.");
31 INITIALIZE_PASS(LoopSplitter, "loop-splitting",
32 "Split virtual regists across loop boundaries.", false, false);
3333
3434 namespace llvm {
3535
7070 } // end anonymous namespace
7171
7272 char StackProtector::ID = 0;
73 static RegisterPass
74 X("stack-protector", "Insert stack protectors");
73 INITIALIZE_PASS(StackProtector, "stack-protector",
74 "Insert stack protectors", false, false);
7575
7676 FunctionPass *llvm::createStackProtectorPass(const TargetLowering *tli) {
7777 return new StackProtector(tli);
145145
146146 char StackSlotColoring::ID = 0;
147147
148 static RegisterPass
149 X("stack-slot-coloring", "Stack Slot Coloring");
148 INITIALIZE_PASS(StackSlotColoring, "stack-slot-coloring",
149 "Stack Slot Coloring", false, false);
150150
151151 FunctionPass *llvm::createStackSlotColoringPass(bool RegColor) {
152152 return new StackSlotColoring(RegColor);
5050 };
5151 }
5252 char UnreachableBlockElim::ID = 0;
53 static RegisterPass
54 X("unreachableblockelim", "Remove unreachable blocks from the CFG");
53 INITIALIZE_PASS(UnreachableBlockElim, "unreachableblockelim",
54 "Remove unreachable blocks from the CFG", false, false);
5555
5656 FunctionPass *llvm::createUnreachableBlockEliminationPass() {
5757 return new UnreachableBlockElim();
4747
4848 char VirtRegMap::ID = 0;
4949
50 static RegisterPass
51 X("virtregmap", "Virtual Register Map");
50 INITIALIZE_PASS(VirtRegMap, "virtregmap", "Virtual Register Map", false, false);
5251
5352 bool VirtRegMap::runOnMachineFunction(MachineFunction &mf) {
5453 MRI = &mf.getRegInfo();
3333 // Handle the Pass registration stuff necessary to use TargetData's.
3434
3535 // Register the default SparcV9 implementation...
36 static RegisterPass X("targetdata", "Target Data Layout", false,
37 true);
36 INITIALIZE_PASS(TargetData, "targetdata", "Target Data Layout", false, true);
3837 char TargetData::ID = 0;
3938
4039 //===----------------------------------------------------------------------===//
3636 }
3737
3838 char Hello::ID = 0;
39 static RegisterPass X("hello", "Hello World Pass");
39 INITIALIZE_PASS(Hello, "hello", "Hello World Pass", false, false);
4040
4141 namespace {
4242 // Hello2 - The second implementation with getAnalysisUsage implemented.
5959 }
6060
6161 char Hello2::ID = 0;
62 static RegisterPass
63 Y("hello2", "Hello World Pass (with getAnalysisUsage implemented)");
62 INITIALIZE_PASS(Hello2, "hello2",
63 "Hello World Pass (with getAnalysisUsage implemented)",
64 false, false);
8383 }
8484
8585 char ArgPromotion::ID = 0;
86 static RegisterPass
87 X("argpromotion", "Promote 'by reference' arguments to scalars");
86 INITIALIZE_PASS(ArgPromotion, "argpromotion",
87 "Promote 'by reference' arguments to scalars", false, false);
8888
8989 Pass *llvm::createArgumentPromotionPass(unsigned maxElements) {
9090 return new ArgPromotion(maxElements);
4040 }
4141
4242 char ConstantMerge::ID = 0;
43 static RegisterPass
44 X("constmerge", "Merge Duplicate Global Constants");
43 INITIALIZE_PASS(ConstantMerge, "constmerge",
44 "Merge Duplicate Global Constants", false, false);
4545
4646 ModulePass *llvm::createConstantMergePass() { return new ConstantMerge(); }
4747
150150
151151
152152 char DAE::ID = 0;
153 static RegisterPass
154 X("deadargelim", "Dead Argument Elimination");
153 INITIALIZE_PASS(DAE, "deadargelim", "Dead Argument Elimination", false, false);
155154
156155 namespace {
157156 /// DAH - DeadArgumentHacking pass - Same as dead argument elimination, but
166165 }
167166
168167 char DAH::ID = 0;
169 static RegisterPass
170 Y("deadarghaX0r", "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)");
168 INITIALIZE_PASS(DAH, "deadarghaX0r",
169 "Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)",
170 false, false);
171171
172172 /// createDeadArgEliminationPass - This pass removes arguments from functions
173173 /// which are not used by the body of the function.
4444 }
4545
4646 char DTE::ID = 0;
47 static RegisterPass X("deadtypeelim", "Dead Type Elimination");
47 INITIALIZE_PASS(DTE, "deadtypeelim", "Dead Type Elimination", false, false);
4848
4949 ModulePass *llvm::createDeadTypeEliminationPass() {
5050 return new DTE();
6868 }
6969
7070 char FunctionAttrs::ID = 0;
71 static RegisterPass
72 X("functionattrs", "Deduce function attributes");
71 INITIALIZE_PASS(FunctionAttrs, "functionattrs",
72 "Deduce function attributes", false, false);
7373
7474 Pass *llvm::createFunctionAttrsPass() { return new FunctionAttrs(); }
7575
5050 }
5151
5252 char GlobalDCE::ID = 0;
53 static RegisterPass X("globaldce", "Dead Global Elimination");
53 INITIALIZE_PASS(GlobalDCE, "globaldce",
54 "Dead Global Elimination", false, false);
5455
5556 ModulePass *llvm::createGlobalDCEPass() { return new GlobalDCE(); }
5657
7373 }
7474
7575 char GlobalOpt::ID = 0;
76 static RegisterPass X("globalopt", "Global Variable Optimizer");
76 INITIALIZE_PASS(GlobalOpt, "globalopt",
77 "Global Variable Optimizer", false, false);
7778
7879 ModulePass *llvm::createGlobalOptimizerPass() { return new GlobalOpt(); }
7980
4444 }
4545
4646 char IPCP::ID = 0;
47 static RegisterPass
48 X("ipconstprop", "Interprocedural constant propagation");
47 INITIALIZE_PASS(IPCP, "ipconstprop",
48 "Interprocedural constant propagation", false, false);
4949
5050 ModulePass *llvm::createIPConstantPropagationPass() { return new IPCP(); }
5151
6060 }
6161
6262 char AlwaysInliner::ID = 0;
63 static RegisterPass
64 X("always-inline", "Inliner for always_inline functions");
63 INITIALIZE_PASS(AlwaysInliner, "always-inline",
64 "Inliner for always_inline functions", false, false);
6565
6666 Pass *llvm::createAlwaysInlinerPass() { return new AlwaysInliner(); }
6767
5555 }
5656
5757 char SimpleInliner::ID = 0;
58 static RegisterPass
59 X("inline", "Function Integration/Inlining");
58 INITIALIZE_PASS(SimpleInliner, "inline",
59 "Function Integration/Inlining", false, false);
6060
6161 Pass *llvm::createFunctionInliningPass() { return new SimpleInliner(); }
6262
6262 } // end anonymous namespace
6363
6464 char InternalizePass::ID = 0;
65 static RegisterPass
66 X("internalize", "Internalize Global Symbols");
65 INITIALIZE_PASS(InternalizePass, "internalize",
66 "Internalize Global Symbols", false, false);
6767
6868 InternalizePass::InternalizePass(bool AllButMain)
6969 : ModulePass(&ID), AllButMain(AllButMain){
4949 }
5050
5151 char LoopExtractor::ID = 0;
52 static RegisterPass
53 X("loop-extract", "Extract loops into new functions");
52 INITIALIZE_PASS(LoopExtractor, "loop-extract",
53 "Extract loops into new functions", false, false);
5454
5555 namespace {
5656 /// SingleLoopExtractor - For bugpoint.
6161 } // End anonymous namespace
6262
6363 char SingleLoopExtractor::ID = 0;
64 static RegisterPass
65 Y("loop-extract-single", "Extract at most one loop into a new function");
64 INITIALIZE_PASS(SingleLoopExtractor, "loop-extract-single",
65 "Extract at most one loop into a new function", false, false);
6666
6767 // createLoopExtractorPass - This pass extracts all natural loops from the
6868 // program into a function if it can.
158158 }
159159
160160 char BlockExtractorPass::ID = 0;
161 static RegisterPass
162 XX("extract-blocks", "Extract Basic Blocks From Module (for bugpoint use)");
161 INITIALIZE_PASS(BlockExtractorPass, "extract-blocks",
162 "Extract Basic Blocks From Module (for bugpoint use)",
163 false, false);
163164
164165 // createBlockExtractorPass - This pass extracts all blocks (except those
165166 // specified in the argument list) from the functions in the module.
121121 } // end anonymous namespace
122122
123123 char LowerSetJmp::ID = 0;
124 static RegisterPass X("lowersetjmp", "Lower Set Jump");
124 INITIALIZE_PASS(LowerSetJmp, "lowersetjmp", "Lower Set Jump", false, false);
125125
126126 // run - Run the transformation on the program. We grab the function
127127 // prototypes for longjmp and setjmp. If they are used in the program,
110110 }
111111
112112 char MergeFunctions::ID = 0;
113 static RegisterPass X("mergefunc", "Merge Functions");
113 INITIALIZE_PASS(MergeFunctions, "mergefunc", "Merge Functions", false, false);
114114
115115 ModulePass *llvm::createMergeFunctionsPass() {
116116 return new MergeFunctions();
3939 }
4040
4141 char PartialInliner::ID = 0;
42 static RegisterPass X("partial-inliner", "Partial Inliner");
42 INITIALIZE_PASS(PartialInliner, "partial-inliner",
43 "Partial Inliner", false, false);
4344
4445 ModulePass* llvm::createPartialInliningPass() { return new PartialInliner(); }
4546
5555 }
5656
5757 char PartSpec::ID = 0;
58 static RegisterPass
59 X("partialspecialization", "Partial Specialization");
58 INITIALIZE_PASS(PartSpec, "partialspecialization",
59 "Partial Specialization", false, false);
6060
6161 // Specialize F by replacing the arguments (keys) in replacements with the
6262 // constants (values). Replace all calls to F with those constants with
4747 }
4848
4949 char PruneEH::ID = 0;
50 static RegisterPass
51 X("prune-eh", "Remove unused exception handling info");
50 INITIALIZE_PASS(PruneEH, "prune-eh",
51 "Remove unused exception handling info", false, false);
5252
5353 Pass *llvm::createPruneEHPass() { return new PruneEH(); }
5454
3535 } // end anonymous namespace
3636
3737 char StripDeadPrototypesPass::ID = 0;
38 static RegisterPass
39 X("strip-dead-prototypes", "Strip Unused Function Prototypes");
38 INITIALIZE_PASS(StripDeadPrototypesPass, "strip-dead-prototypes",
39 "Strip Unused Function Prototypes", false, false);
4040
4141 bool StripDeadPrototypesPass::runOnModule(Module &M) {
4242 bool MadeChange = false;
8888 }
8989
9090 char StripSymbols::ID = 0;
91 static RegisterPass
92 X("strip", "Strip all symbols from a module");
91 INITIALIZE_PASS(StripSymbols, "strip",
92 "Strip all symbols from a module", false, false);
9393
9494 ModulePass *llvm::createStripSymbolsPass(bool OnlyDebugInfo) {
9595 return new StripSymbols(OnlyDebugInfo);
9696 }
9797
9898 char StripNonDebugSymbols::ID = 0;
99 static RegisterPass
100 Y("strip-nondebug", "Strip all symbols, except dbg symbols, from a module");
99 INITIALIZE_PASS(StripNonDebugSymbols, "strip-nondebug",
100 "Strip all symbols, except dbg symbols, from a module",
101 false, false);
101102
102103 ModulePass *llvm::createStripNonDebugSymbolsPass() {
103104 return new StripNonDebugSymbols();
104105 }
105106
106107 char StripDebugDeclare::ID = 0;
107 static RegisterPass
108 Z("strip-debug-declare", "Strip all llvm.dbg.declare intrinsics");
108 INITIALIZE_PASS(StripDebugDeclare, "strip-debug-declare",
109 "Strip all llvm.dbg.declare intrinsics", false, false);
109110
110111 ModulePass *llvm::createStripDebugDeclarePass() {
111112 return new StripDebugDeclare();
112113 }
113114
114115 char StripDeadDebugInfo::ID = 0;
115 static RegisterPass
116 A("strip-dead-debug-info", "Strip debug info for unused symbols");
116 INITIALIZE_PASS(StripDeadDebugInfo, "strip-dead-debug-info",
117 "Strip debug info for unused symbols", false, false);
117118
118119 ModulePass *llvm::createStripDeadDebugInfoPass() {
119120 return new StripDeadDebugInfo();
6161 }
6262
6363 char SRETPromotion::ID = 0;
64 static RegisterPass
65 X("sretpromotion", "Promote sret arguments to multiple ret values");
64 INITIALIZE_PASS(SRETPromotion, "sretpromotion",
65 "Promote sret arguments to multiple ret values", false, false);
6666
6767 Pass *llvm::createStructRetPromotionPass() {
6868 return new SRETPromotion();
5959
6060
6161 char InstCombiner::ID = 0;
62 static RegisterPass
63 X("instcombine", "Combine redundant instructions");
62 INITIALIZE_PASS(InstCombiner, "instcombine",
63 "Combine redundant instructions", false, false);
6464
6565 void InstCombiner::getAnalysisUsage(AnalysisUsage &AU) const {
6666 AU.addPreservedID(LCSSAID);
4242 }
4343
4444 char EdgeProfiler::ID = 0;
45 static RegisterPass
46 X("insert-edge-profiling", "Insert instrumentation for edge profiling");
45 INITIALIZE_PASS(EdgeProfiler, "insert-edge-profiling",
46 "Insert instrumentation for edge profiling", false, false);
4747
4848 ModulePass *llvm::createEdgeProfilerPass() { return new EdgeProfiler(); }
4949
4949 }
5050
5151 char OptimalEdgeProfiler::ID = 0;
52 static RegisterPass
53 X("insert-optimal-edge-profiling",
54 "Insert optimal instrumentation for edge profiling");
52 INITIALIZE_PASS(OptimalEdgeProfiler, "insert-optimal-edge-profiling",
53 "Insert optimal instrumentation for edge profiling",
54 false, false);
5555
5656 ModulePass *llvm::createOptimalEdgeProfilerPass() {
5757 return new OptimalEdgeProfiler();
440440 } // end anonymous namespace.
441441
442442 char ABCD::ID = 0;
443 static RegisterPass X("abcd", "ABCD: Eliminating Array Bounds Checks on Demand");
444
443 INITIALIZE_PASS(ABCD, "abcd",
444 "ABCD: Eliminating Array Bounds Checks on Demand",
445 false, false);
445446
446447 bool ABCD::runOnFunction(Function &F) {
447448 modified = false;
4444 }
4545
4646 char ADCE::ID = 0;
47 static RegisterPass X("adce", "Aggressive Dead Code Elimination");
47 INITIALIZE_PASS(ADCE, "adce", "Aggressive Dead Code Elimination", false, false);
4848
4949 bool ADCE::runOnFunction(Function& F) {
5050 SmallPtrSet alive;
7373 }
7474
7575 char BlockPlacement::ID = 0;
76 static RegisterPass
77 X("block-placement", "Profile Guided Basic Block Placement");
76 INITIALIZE_PASS(BlockPlacement, "block-placement",
77 "Profile Guided Basic Block Placement", false, false);
7878
7979 FunctionPass *llvm::createBlockPlacementPass() { return new BlockPlacement(); }
8080
8181 }
8282
8383 char CodeGenPrepare::ID = 0;
84 static RegisterPass X("codegenprepare",
85 "Optimize for code generation");
84 INITIALIZE_PASS(CodeGenPrepare, "codegenprepare",
85 "Optimize for code generation", false, false);
8686
8787 FunctionPass *llvm::createCodeGenPreparePass(const TargetLowering *TLI) {
8888 return new CodeGenPrepare(TLI);
4444 }
4545
4646 char ConstantPropagation::ID = 0;
47 static RegisterPass
48 X("constprop", "Simple constant propagation");
47 INITIALIZE_PASS(ConstantPropagation, "constprop",
48 "Simple constant propagation", false, false);
4949
5050 FunctionPass *llvm::createConstantPropagationPass() {
5151 return new ConstantPropagation();
5555 }
5656
5757 char DeadInstElimination::ID = 0;
58 static RegisterPass
59 X("die", "Dead Instruction Elimination");
58 INITIALIZE_PASS(DeadInstElimination, "die",
59 "Dead Instruction Elimination", false, false);
6060
6161 Pass *llvm::createDeadInstEliminationPass() {
6262 return new DeadInstElimination();
8080 }
8181
8282 char DCE::ID = 0;
83 static RegisterPass Y("dce", "Dead Code Elimination");
83 INITIALIZE_PASS(DCE, "dce", "Dead Code Elimination", false, false);
8484
8585 bool DCE::runOnFunction(Function &F) {
8686 // Start out with all of the instructions in the worklist...
8181 }
8282
8383 char DSE::ID = 0;
84 static RegisterPass X("dse", "Dead Store Elimination");
84 INITIALIZE_PASS(DSE, "dse", "Dead Store Elimination", false, false);
8585
8686 FunctionPass *llvm::createDeadStoreEliminationPass() { return new DSE(); }
8787
3131 }
3232
3333 char GEPSplitter::ID = 0;
34 static RegisterPass X("split-geps",
35 "split complex GEPs into simple GEPs");
34 INITIALIZE_PASS(GEPSplitter, "split-geps",
35 "split complex GEPs into simple GEPs", false, false);
3636
3737 FunctionPass *llvm::createGEPSplitterPass() {
3838 return new GEPSplitter();
715715 return new GVN(NoLoads);
716716 }
717717
718 static RegisterPass X("gvn",
719 "Global Value Numbering");
718 INITIALIZE_PASS(GVN, "gvn", "Global Value Numbering", false, false);
720719
721720 void GVN::dump(DenseMap& d) {
722721 errs() << "{\n";
116116 }
117117
118118 char IndVarSimplify::ID = 0;
119 static RegisterPass
120 X("indvars", "Canonicalize Induction Variables");
119 INITIALIZE_PASS(IndVarSimplify, "indvars",
120 "Canonicalize Induction Variables", false, false);
121121
122122 Pass *llvm::createIndVarSimplifyPass() {
123123 return new IndVarSimplify();
110110 }
111111
112112 char JumpThreading::ID = 0;
113 static RegisterPass
114 X("jump-threading", "Jump Threading");
113 INITIALIZE_PASS(JumpThreading, "jump-threading",
114 "Jump Threading", false, false);
115115
116116 // Public interface to the Jump Threading pass
117117 FunctionPass *llvm::createJumpThreadingPass() { return new JumpThreading(); }
221221 }
222222
223223 char LICM::ID = 0;
224 static RegisterPass X("licm", "Loop Invariant Code Motion");
224 INITIALIZE_PASS(LICM, "licm", "Loop Invariant Code Motion", false, false);
225225
226226 Pass *llvm::createLICMPass() { return new LICM(); }
227227
5454 }
5555
5656 char LoopDeletion::ID = 0;
57 static RegisterPass X("loop-deletion", "Delete dead loops");
57 INITIALIZE_PASS(LoopDeletion, "loop-deletion",
58 "Delete dead loops", false, false);
5859
5960 Pass* llvm::createLoopDeletionPass() {
6061 return new LoopDeletion();
196196 }
197197
198198 char LoopIndexSplit::ID = 0;
199 static RegisterPass
200 X("loop-index-split", "Index Split Loops");
199 INITIALIZE_PASS(LoopIndexSplit, "loop-index-split",
200 "Index Split Loops", false, false);
201201
202202 Pass *llvm::createLoopIndexSplitPass() {
203203 return new LoopIndexSplit();
7878 }
7979
8080 char LoopRotate::ID = 0;
81 static RegisterPass X("loop-rotate", "Rotate Loops");
81 INITIALIZE_PASS(LoopRotate, "loop-rotate", "Rotate Loops", false, false);
8282
8383 Pass *llvm::createLoopRotatePass() { return new LoopRotate(); }
8484
37423742 }
37433743
37443744 char LoopStrengthReduce::ID = 0;
3745 static RegisterPass
3746 X("loop-reduce", "Loop Strength Reduction");
3745 INITIALIZE_PASS(LoopStrengthReduce, "loop-reduce",
3746 "Loop Strength Reduction", false, false);
37473747
37483748 Pass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) {
37493749 return new LoopStrengthReduce(TLI);
7070 }
7171
7272 char LoopUnroll::ID = 0;
73 static RegisterPass X("loop-unroll", "Unroll loops");
73 INITIALIZE_PASS(LoopUnroll, "loop-unroll", "Unroll loops", false, false);
7474
7575 Pass *llvm::createLoopUnrollPass() { return new LoopUnroll(); }
7676
159159 };
160160 }
161161 char LoopUnswitch::ID = 0;
162 static RegisterPass X("loop-unswitch", "Unswitch loops");
162 INITIALIZE_PASS(LoopUnswitch, "loop-unswitch", "Unswitch loops", false, false);
163163
164164 Pass *llvm::createLoopUnswitchPass(bool Os) {
165165 return new LoopUnswitch(Os);
330330 // createMemCpyOptPass - The public interface to this file...
331331 FunctionPass *llvm::createMemCpyOptPass() { return new MemCpyOpt(); }
332332
333 static RegisterPass X("memcpyopt",
334 "MemCpy Optimization");
333 INITIALIZE_PASS(MemCpyOpt, "memcpyopt", "MemCpy Optimization", false, false);
335334
336335
337336
102102 }
103103
104104 char Reassociate::ID = 0;
105 static RegisterPass X("reassociate", "Reassociate expressions");
105 INITIALIZE_PASS(Reassociate, "reassociate",
106 "Reassociate expressions", false, false);
106107
107108 // Public interface to the Reassociate pass
108109 FunctionPass *llvm::createReassociatePass() { return new Reassociate(); }
15991599 } // end anonymous namespace
16001600
16011601 char SCCP::ID = 0;
1602 static RegisterPass
1603 X("sccp", "Sparse Conditional Constant Propagation");
1602 INITIALIZE_PASS(SCCP, "sccp",
1603 "Sparse Conditional Constant Propagation", false, false);
16041604
16051605 // createSCCPPass - This is the public interface to this file.
16061606 FunctionPass *llvm::createSCCPPass() {
17071707 } // end anonymous namespace
17081708
17091709 char IPSCCP::ID = 0;
1710 static RegisterPass
1711 Y("ipsccp", "Interprocedural Sparse Conditional Constant Propagation");
1710 INITIALIZE_PASS(IPSCCP, "ipsccp",
1711 "Interprocedural Sparse Conditional Constant Propagation",
1712 false, false);
17121713
17131714 // createIPSCCPPass - This is the public interface to this file.
17141715 ModulePass *llvm::createIPSCCPPass() {
134134 }
135135
136136 char SROA::ID = 0;
137 static RegisterPass X("scalarrepl", "Scalar Replacement of Aggregates");
137 INITIALIZE_PASS(SROA, "scalarrepl",
138 "Scalar Replacement of Aggregates", false, false);
138139
139140 // Public interface to the ScalarReplAggregates pass
140141 FunctionPass *llvm::createScalarReplAggregatesPass(signed int Threshold) {
4848 }
4949
5050 char CFGSimplifyPass::ID = 0;
51 static RegisterPass X("simplifycfg", "Simplify the CFG");
51 INITIALIZE_PASS(CFGSimplifyPass, "simplifycfg",
52 "Simplify the CFG", false, false);
5253
5354 // Public interface to the CFGSimplification pass
5455 FunctionPass *llvm::createCFGSimplificationPass() {
4545 char SimplifyHalfPowrLibCalls::ID = 0;
4646 } // end anonymous namespace.
4747
48 static RegisterPass
49 X("simplify-libcalls-halfpowr", "Simplify half_powr library calls");
48 INITIALIZE_PASS(SimplifyHalfPowrLibCalls, "simplify-libcalls-halfpowr",
49 "Simplify half_powr library calls", false, false);
5050
5151 // Public interface to the Simplify HalfPowr LibCalls pass.
5252 FunctionPass *llvm::createSimplifyHalfPowrLibCallsPass() {
12521252 char SimplifyLibCalls::ID = 0;
12531253 } // end anonymous namespace.
12541254
1255 static RegisterPass
1256 X("simplify-libcalls", "Simplify well-known library calls");
1255 INITIALIZE_PASS(SimplifyLibCalls, "simplify-libcalls",
1256 "Simplify well-known library calls", false, false);
12571257
12581258 // Public interface to the Simplify LibCalls pass.
12591259 FunctionPass *llvm::createSimplifyLibCallsPass() {
5555 } // end anonymous namespace
5656
5757 char Sinking::ID = 0;
58 static RegisterPass
59 X("sink", "Code sinking");
58 INITIALIZE_PASS(Sinking, "sink", "Code sinking", false, false);
6059
6160 FunctionPass *llvm::createSinkingPass() { return new Sinking(); }
6261
5858 }
5959
6060 char TailDup::ID = 0;
61 static RegisterPass X("tailduplicate", "Tail Duplication");
61 INITIALIZE_PASS(TailDup, "tailduplicate", "Tail Duplication", false, false);
6262
6363 // Public interface to the Tail Duplication pass
6464 FunctionPass *llvm::createTailDuplicationPass() { return new TailDup(); }
8686 }
8787
8888 char TailCallElim::ID = 0;
89 static RegisterPass X("tailcallelim", "Tail Call Elimination");
89 INITIALIZE_PASS(TailCallElim, "tailcallelim",
90 "Tail Call Elimination", false, false);
9091
9192 // Public interface to the TailCallElimination pass
9293 FunctionPass *llvm::createTailCallEliminationPass() {
390390 FunctionPass *llvm::createSSIPass() { return new SSI(); }
391391
392392 char SSI::ID = 0;
393 static RegisterPass X("ssi", "Static Single Information Construction");
393 INITIALIZE_PASS(SSI, "ssi",
394 "Static Single Information Construction", false, false);
394395
395396 /// SSIEverything - A pass that runs createSSI on every non-void variable,
396397 /// intended for debugging.
427428 FunctionPass *llvm::createSSIEverythingPass() { return new SSIEverything(); }
428429
429430 char SSIEverything::ID = 0;
430 static RegisterPass
431 Y("ssi-everything", "Static Single Information Construction");
431 INITIALIZE_PASS(SSIEverything, "ssi-everything",
432 "Static Single Information Construction", false, false);
2323 using namespace llvm;
2424
2525 char UnifyFunctionExitNodes::ID = 0;
26 static RegisterPass
27 X("mergereturn", "Unify function exit nodes");
26 INITIALIZE_PASS(UnifyFunctionExitNodes, "mergereturn",
27 "Unify function exit nodes", false, false);
2828
2929 Pass *llvm::createUnifyFunctionExitNodesPass() {
3030 return new UnifyFunctionExitNodes();
5151 TEMPLATE_INSTANTIATION(class llvm::DominatorTreeBase);
5252
5353 char DominatorTree::ID = 0;
54 static RegisterPass
55 E("domtree", "Dominator Tree Construction", true, true);
54 INITIALIZE_PASS(DominatorTree, "domtree",
55 "Dominator Tree Construction", true, true);
5656
5757 bool DominatorTree::runOnFunction(Function &F) {
5858 DT->recalculate(F);
105105 //===----------------------------------------------------------------------===//
106106
107107 char DominanceFrontier::ID = 0;
108 static RegisterPass
109 G("domfrontier", "Dominance Frontier Construction", true, true);
108 INITIALIZE_PASS(DominanceFrontier, "domfrontier",
109 "Dominance Frontier Construction", true, true);
110110
111111 void DominanceFrontier::verifyAnalysis() const {
112112 if (!VerifyDomInfo) return;
7676 }
7777
7878 char PrintModulePass::ID = 0;
79 static RegisterPass
80 X("print-module", "Print module to stderr");
79 INITIALIZE_PASS(PrintModulePass, "print-module",
80 "Print module to stderr", false, false);
8181 char PrintFunctionPass::ID = 0;
82 static RegisterPass
83 Y("print-function","Print function to stderr");
82 INITIALIZE_PASS(PrintFunctionPass, "print-function",
83 "Print function to stderr", false, false);
8484
8585 /// createPrintModulePass - Create and return a pass that writes the
8686 /// module to the specified raw_ostream.