llvm.org GIT mirror llvm / 9f43f26
[RABasic] Properly initialize the pass Use the initializeXXX method to initialize the RABasic pass in the pipeline. This enables us to take advantage of the .mir infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304602 91177308-0d34-0410-b5e6-96231b3b80d8 Quentin Colombet 3 years ago
5 changed file(s) with 23 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
139139 /// Greedy register allocator.
140140 extern char &RAGreedyID;
141141
142 /// Basic register allocator.
143 extern char &RABasicID;
144
142145 /// VirtRegRewriter pass. Rewrite virtual registers to physical registers as
143146 /// assigned in VirtRegMap.
144147 extern char &VirtRegRewriterID;
303303 void initializeProfileSummaryInfoWrapperPassPass(PassRegistry&);
304304 void initializePromoteLegacyPassPass(PassRegistry&);
305305 void initializePruneEHPass(PassRegistry&);
306 void initializeRABasicPass(PassRegistry &);
306307 void initializeRAGreedyPass(PassRegistry&);
307308 void initializeReassociateLegacyPassPass(PassRegistry&);
308309 void initializeRegBankSelectPass(PassRegistry&);
7676 initializePostRASchedulerPass(Registry);
7777 initializePreISelIntrinsicLoweringLegacyPassPass(Registry);
7878 initializeProcessImplicitDefsPass(Registry);
79 initializeRABasicPass(Registry);
7980 initializeRAGreedyPass(Registry);
8081 initializeRegisterCoalescerPass(Registry);
8182 initializeRenameIndependentSubregsPass(Registry);
120120
121121 } // end anonymous namespace
122122
123 char &llvm::RABasicID = RABasic::ID;
124
125 INITIALIZE_PASS_BEGIN(RABasic, "regallocbasic", "Basic Register Allocator",
126 false, false)
127 INITIALIZE_PASS_DEPENDENCY(LiveDebugVariables)
128 INITIALIZE_PASS_DEPENDENCY(SlotIndexes)
129 INITIALIZE_PASS_DEPENDENCY(LiveIntervals)
130 INITIALIZE_PASS_DEPENDENCY(RegisterCoalescer)
131 INITIALIZE_PASS_DEPENDENCY(MachineScheduler)
132 INITIALIZE_PASS_DEPENDENCY(LiveStacks)
133 INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree)
134 INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)
135 INITIALIZE_PASS_DEPENDENCY(VirtRegMap)
136 INITIALIZE_PASS_DEPENDENCY(LiveRegMatrix)
137 INITIALIZE_PASS_END(RABasic, "regallocbasic", "Basic Register Allocator", false,
138 false)
139
123140 RABasic::RABasic(): MachineFunctionPass(ID) {
124 initializeLiveDebugVariablesPass(*PassRegistry::getPassRegistry());
125 initializeLiveIntervalsPass(*PassRegistry::getPassRegistry());
126 initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
127 initializeRegisterCoalescerPass(*PassRegistry::getPassRegistry());
128 initializeMachineSchedulerPass(*PassRegistry::getPassRegistry());
129 initializeLiveStacksPass(*PassRegistry::getPassRegistry());
130 initializeMachineDominatorTreePass(*PassRegistry::getPassRegistry());
131 initializeMachineLoopInfoPass(*PassRegistry::getPassRegistry());
132 initializeVirtRegMapPass(*PassRegistry::getPassRegistry());
133 initializeLiveRegMatrixPass(*PassRegistry::getPassRegistry());
134141 }
135142
136143 void RABasic::getAnalysisUsage(AnalysisUsage &AU) const {
0 # RUN: llc -run-pass=greedy -debug-pass=Arguments -o - %s | FileCheck %s
1 # RUN: llc -run-pass=regallocbasic -debug-pass=Arguments -o - %s | FileCheck %s
12
23 # Check that passes are initialized correctly, so that it's possible to
34 # use -run-pass.