mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Improve PPC VR (Altivec) register spilling
This change cleans up two issues with Altivec register spilling: 1. The spilling code was inefficient (using two instructions, and add and a load, when just one would do) 2. The code assumed that r0 would always be available (true for now, but this will change) The new code handles VR spilling just like GPR spills but forced into r+r mode. As a result, when any VR spills are present, we must now always allocate the register-scavenger spill slot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177231 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -193,6 +193,11 @@ static bool hasSpills(const MachineFunction &MF) {
|
||||
return FuncInfo->hasSpills();
|
||||
}
|
||||
|
||||
static bool hasNonRISpills(const MachineFunction &MF) {
|
||||
const PPCFunctionInfo *FuncInfo = MF.getInfo<PPCFunctionInfo>();
|
||||
return FuncInfo->hasNonRISpills();
|
||||
}
|
||||
|
||||
/// determineFrameLayout - Determine the size of the frame and maximum call
|
||||
/// frame size.
|
||||
unsigned PPCFrameLowering::determineFrameLayout(MachineFunction &MF,
|
||||
@ -1048,7 +1053,7 @@ PPCFrameLowering::addScavengingSpillSlot(MachineFunction &MF,
|
||||
// needed alignment padding.
|
||||
unsigned StackSize = determineFrameLayout(MF, false, true);
|
||||
MachineFrameInfo *MFI = MF.getFrameInfo();
|
||||
if (MFI->hasVarSizedObjects() || spillsCR(MF) ||
|
||||
if (MFI->hasVarSizedObjects() || spillsCR(MF) || hasNonRISpills(MF) ||
|
||||
(hasSpills(MF) && !isInt<16>(StackSize))) {
|
||||
const TargetRegisterClass *GPRC = &PPC::GPRCRegClass;
|
||||
const TargetRegisterClass *G8RC = &PPC::G8RCRegClass;
|
||||
|
Reference in New Issue
Block a user