mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 07:24:47 +00:00
RegAllocGreedy: Allow target to specify register class ordering.
Specify an allocation order with a register class. This is used by register allocators with a greedy heuristic. This is usefull as it is sometimes beneficial to color more constrained classes first. Differential Revision: http://reviews.llvm.org/D8626 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233743 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -538,8 +538,9 @@ void RAGreedy::enqueue(PQueue &CurQueue, LiveInterval *LI) {
|
||||
// Giant live ranges fall back to the global assignment heuristic, which
|
||||
// prevents excessive spilling in pathological cases.
|
||||
bool ReverseLocal = TRI->reverseLocalAssignment();
|
||||
const TargetRegisterClass &RC = *MRI->getRegClass(Reg);
|
||||
bool ForceGlobal = !ReverseLocal &&
|
||||
(Size / SlotIndex::InstrDist) > (2 * MRI->getRegClass(Reg)->getNumRegs());
|
||||
(Size / SlotIndex::InstrDist) > (2 * RC.getNumRegs());
|
||||
|
||||
if (ExtraRegInfo[Reg].Stage == RS_Assign && !ForceGlobal && !LI->empty() &&
|
||||
LIS->intervalIsInOneMBB(*LI)) {
|
||||
@@ -554,8 +555,8 @@ void RAGreedy::enqueue(PQueue &CurQueue, LiveInterval *LI) {
|
||||
// large blocks on targets with many physical registers.
|
||||
Prio = Indexes->getZeroIndex().getInstrDistance(LI->endIndex());
|
||||
}
|
||||
}
|
||||
else {
|
||||
Prio |= RC.AllocationPriority << 24;
|
||||
} else {
|
||||
// Allocate global and split ranges in long->short order. Long ranges that
|
||||
// don't fit should be spilled (or split) ASAP so they don't create
|
||||
// interference. Mark a bit to prioritize global above local ranges.
|
||||
|
Reference in New Issue
Block a user