llvm.org GIT mirror llvm / 107362c
RegAllocGreedy: Properly initialize this pass, so that -run-pass will work Reviewers: qcolombet, MatzeB Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D26572 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286895 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 3 years ago
5 changed file(s) with 34 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
122122 /// ShrinkWrap pass. Look for the best place to insert save and restore
123123 // instruction and update the MachineFunctionInfo with that information.
124124 extern char &ShrinkWrapID;
125
126 /// Greedy register allocator.
127 extern char &RAGreedyID;
125128
126129 /// VirtRegRewriter pass. Rewrite virtual registers to physical registers as
127130 /// assigned in VirtRegMap.
125125 void initializeEdgeBundlesPass(PassRegistry&);
126126 void initializeEfficiencySanitizerPass(PassRegistry&);
127127 void initializeEliminateAvailableExternallyLegacyPassPass(PassRegistry &);
128 void initializeRAGreedyPass(PassRegistry&);
128129 void initializeGVNHoistLegacyPassPass(PassRegistry &);
129130 void initializeExpandISelPseudosPass(PassRegistry&);
130131 void initializeExpandPostRAPass(PassRegistry&);
7070 initializePostRASchedulerPass(Registry);
7171 initializePreISelIntrinsicLoweringLegacyPassPass(Registry);
7272 initializeProcessImplicitDefsPass(Registry);
73 initializeRAGreedyPass(Registry);
7374 initializeRegisterCoalescerPass(Registry);
7475 initializeRenameIndependentSubregsPass(Registry);
7576 initializeShrinkWrapPass(Registry);
422422 } // end anonymous namespace
423423
424424 char RAGreedy::ID = 0;
425 char &llvm::RAGreedyID = RAGreedy::ID;
426
427 INITIALIZE_PASS_BEGIN(RAGreedy, "greedy",
428 "Greedy Register Allocator", false, false)
429 INITIALIZE_PASS_DEPENDENCY(LiveDebugVariables)
430 INITIALIZE_PASS_DEPENDENCY(SlotIndexes)
431 INITIALIZE_PASS_DEPENDENCY(LiveIntervals)
432 INITIALIZE_PASS_DEPENDENCY(RegisterCoalescer)
433 INITIALIZE_PASS_DEPENDENCY(MachineScheduler)
434 INITIALIZE_PASS_DEPENDENCY(LiveStacks)
435 INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree)
436 INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo)
437 INITIALIZE_PASS_DEPENDENCY(VirtRegMap)
438 INITIALIZE_PASS_DEPENDENCY(LiveRegMatrix)
439 INITIALIZE_PASS_DEPENDENCY(EdgeBundles)
440 INITIALIZE_PASS_DEPENDENCY(SpillPlacement)
441 INITIALIZE_PASS_END(RAGreedy, "greedy",
442 "Greedy Register Allocator", false, false)
425443
426444 #ifndef NDEBUG
427445 const char *const RAGreedy::StageName[] = {
445463 }
446464
447465 RAGreedy::RAGreedy(): MachineFunctionPass(ID) {
448 initializeLiveDebugVariablesPass(*PassRegistry::getPassRegistry());
449 initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
450 initializeLiveIntervalsPass(*PassRegistry::getPassRegistry());
451 initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
452 initializeRegisterCoalescerPass(*PassRegistry::getPassRegistry());
453 initializeMachineSchedulerPass(*PassRegistry::getPassRegistry());
454 initializeLiveStacksPass(*PassRegistry::getPassRegistry());
455 initializeMachineDominatorTreePass(*PassRegistry::getPassRegistry());
456 initializeMachineLoopInfoPass(*PassRegistry::getPassRegistry());
457 initializeVirtRegMapPass(*PassRegistry::getPassRegistry());
458 initializeLiveRegMatrixPass(*PassRegistry::getPassRegistry());
459 initializeEdgeBundlesPass(*PassRegistry::getPassRegistry());
460 initializeSpillPlacementPass(*PassRegistry::getPassRegistry());
461466 }
462467
463468 void RAGreedy::getAnalysisUsage(AnalysisUsage &AU) const {
0 # RUN: llc -run-pass=greedy -debug-pass=Arguments -o - %s 2>&1 | FileCheck %s
1
2 # Check that passes are initialized correctly, so that it's possible to
3 # use -run-pass.
4
5 ---
6 # CHECK: name: foo
7 name: foo
8 body: |
9 bb.0:
10 ...