mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Reintroduce VirtRegRewriter.
OK, not really. We don't want to reintroduce the old rewriter hacks. This patch extracts virtual register rewriting as a separate pass that runs after the register allocator. This is possible now that CodeGen/Passes.cpp can configure the full optimizing register allocator pipeline. The rewriter pass uses register assignments in VirtRegMap to rewrite virtual registers to physical registers, and it inserts kill flags based on live intervals. These finalization steps are the same for the optimizing register allocators: RABasic, RAGreedy, and PBQP. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158244 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -146,6 +146,7 @@ void RABasic::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.addRequired<AliasAnalysis>();
|
||||
AU.addPreserved<AliasAnalysis>();
|
||||
AU.addRequired<LiveIntervals>();
|
||||
AU.addPreserved<LiveIntervals>();
|
||||
AU.addPreserved<SlotIndexes>();
|
||||
AU.addRequired<LiveDebugVariables>();
|
||||
AU.addPreserved<LiveDebugVariables>();
|
||||
@ -335,18 +336,7 @@ bool RABasic::runOnMachineFunction(MachineFunction &mf) {
|
||||
}
|
||||
#endif // !NDEBUG
|
||||
|
||||
// Run rewriter
|
||||
VRM->rewrite(LIS->getSlotIndexes());
|
||||
|
||||
// Write out new DBG_VALUE instructions.
|
||||
getAnalysis<LiveDebugVariables>().emitDebugValues(VRM);
|
||||
|
||||
// All machine operands and other references to virtual registers have been
|
||||
// replaced. Remove the virtual registers and release all the transient data.
|
||||
VRM->clearAllVirt();
|
||||
MRI->clearVirtRegs();
|
||||
releaseMemory();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user