- if (addPass(&MachineSchedulerID))
- printAndVerify("After Machine Scheduling");
-
- // Add the selected register allocation pass.
- addPass(RegAllocPass);
- printAndVerify("After Register Allocation, before rewriter");
-
- // Allow targets to change the register assignments before rewriting.
- if (addPreRewrite())
- printAndVerify("After pre-rewrite passes");
-
- // Finally rewrite virtual registers.
- addPass(&VirtRegRewriterID);
- printAndVerify("After Virtual Register Rewriter");
-
- // FinalizeRegAlloc is convenient until MachineInstrBundles is more mature,
- // but eventually, all users of it should probably be moved to addPostRA and
- // it can go away. Currently, it's the intended place for targets to run
- // FinalizeMachineBundles, because passes other than MachineScheduling an
- // RegAlloc itself may not be aware of bundles.
- if (addFinalizeRegAlloc())
- printAndVerify("After RegAlloc finalization");
-
- // Perform stack slot coloring and post-ra machine LICM.
- //
- // FIXME: Re-enable coloring with register when it's capable of adding
- // kill markers.
- addPass(&StackSlotColoringID);