mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 16:25:18 +00:00
Be less aggressive about hinting in RAFast.
In particular, don't spill dirty registers only to satisfy a hint. It is not worth it. The attached test case provides an example where the fast allocator would spill a register when other registers are available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -487,14 +487,12 @@ void RAFast::allocVirtReg(MachineInstr *MI, LiveRegEntry &LRE, unsigned Hint) {
|
||||
|
||||
// Take hint when possible.
|
||||
if (Hint) {
|
||||
switch(calcSpillCost(Hint)) {
|
||||
default:
|
||||
definePhysReg(MI, Hint, regFree);
|
||||
// Fall through.
|
||||
case 0:
|
||||
// Ignore the hint if we would have to spill a dirty register.
|
||||
unsigned Cost = calcSpillCost(Hint);
|
||||
if (Cost < spillDirty) {
|
||||
if (Cost)
|
||||
definePhysReg(MI, Hint, regFree);
|
||||
return assignVirtToPhysReg(LRE, Hint);
|
||||
case spillImpossible:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user