mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
80-column, tab characters, comment fixups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4ffd83b92b
commit
3756feaadc
@ -222,7 +222,7 @@ unsigned PPCFrameLowering::determineFrameLayout(MachineFunction &MF,
|
||||
if (!DisableRedZone &&
|
||||
(Subtarget.isPPC64() || // 32-bit SVR4, no stack-
|
||||
!Subtarget.isSVR4ABI() || // allocated locals.
|
||||
FrameSize == 0) &&
|
||||
FrameSize == 0) &&
|
||||
FrameSize <= 224 && // Fits in red zone.
|
||||
!MFI->hasVarSizedObjects() && // No dynamic alloca.
|
||||
!MFI->adjustsStack() && // No calls.
|
||||
@ -281,8 +281,8 @@ bool PPCFrameLowering::needsFP(const MachineFunction &MF) const {
|
||||
|
||||
// Naked functions have no stack frame pushed, so we don't have a frame
|
||||
// pointer.
|
||||
if (MF.getFunction()->getAttributes().hasAttribute(AttributeSet::FunctionIndex,
|
||||
Attribute::Naked))
|
||||
if (MF.getFunction()->getAttributes().hasAttribute(
|
||||
AttributeSet::FunctionIndex, Attribute::Naked))
|
||||
return false;
|
||||
|
||||
return MF.getTarget().Options.DisableFramePointerElim(MF) ||
|
||||
@ -426,7 +426,8 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
assert(FPIndex && "No Frame Pointer Save Slot!");
|
||||
FPOffset = FFI->getObjectOffset(FPIndex);
|
||||
} else {
|
||||
FPOffset = PPCFrameLowering::getFramePointerSaveOffset(isPPC64, isDarwinABI);
|
||||
FPOffset =
|
||||
PPCFrameLowering::getFramePointerSaveOffset(isPPC64, isDarwinABI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -712,7 +713,8 @@ void PPCFrameLowering::emitEpilogue(MachineFunction &MF,
|
||||
assert(FPIndex && "No Frame Pointer Save Slot!");
|
||||
FPOffset = FFI->getObjectOffset(FPIndex);
|
||||
} else {
|
||||
FPOffset = PPCFrameLowering::getFramePointerSaveOffset(isPPC64, isDarwinABI);
|
||||
FPOffset =
|
||||
PPCFrameLowering::getFramePointerSaveOffset(isPPC64, isDarwinABI);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1106,10 +1108,10 @@ void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
||||
unsigned Reg = CSI[i].getReg();
|
||||
|
||||
if ((Subtarget.isSVR4ABI() && Reg == PPC::CR2)
|
||||
// Leave Darwin logic as-is.
|
||||
|| (!Subtarget.isSVR4ABI() &&
|
||||
(PPC::CRBITRCRegClass.contains(Reg) ||
|
||||
PPC::CRRCRegClass.contains(Reg)))) {
|
||||
// Leave Darwin logic as-is.
|
||||
|| (!Subtarget.isSVR4ABI() &&
|
||||
(PPC::CRBITRCRegClass.contains(Reg) ||
|
||||
PPC::CRRCRegClass.contains(Reg)))) {
|
||||
int FI = CSI[i].getFrameIdx();
|
||||
|
||||
FFI->setObjectOffset(FI, LowerBound + FFI->getObjectOffset(FI));
|
||||
@ -1192,9 +1194,9 @@ PPCFrameLowering::addScavengingSpillSlot(MachineFunction &MF,
|
||||
|
||||
bool
|
||||
PPCFrameLowering::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
const std::vector<CalleeSavedInfo> &CSI,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
MachineBasicBlock::iterator MI,
|
||||
const std::vector<CalleeSavedInfo> &CSI,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
|
||||
// Currently, this function only handles SVR4 32- and 64-bit ABIs.
|
||||
// Return false otherwise to maintain pre-existing behavior.
|
||||
@ -1237,21 +1239,21 @@ PPCFrameLowering::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
CRSpilled = true;
|
||||
FuncInfo->setSpillsCR();
|
||||
|
||||
// 32-bit: FP-relative. Note that we made sure CR2-CR4 all have
|
||||
// the same frame index in PPCRegisterInfo::hasReservedSpillSlot.
|
||||
CRMIB = BuildMI(*MF, DL, TII.get(PPC::MFCR), PPC::R12)
|
||||
// 32-bit: FP-relative. Note that we made sure CR2-CR4 all have
|
||||
// the same frame index in PPCRegisterInfo::hasReservedSpillSlot.
|
||||
CRMIB = BuildMI(*MF, DL, TII.get(PPC::MFCR), PPC::R12)
|
||||
.addReg(Reg, RegState::ImplicitKill);
|
||||
|
||||
MBB.insert(MI, CRMIB);
|
||||
MBB.insert(MI, addFrameReference(BuildMI(*MF, DL, TII.get(PPC::STW))
|
||||
.addReg(PPC::R12,
|
||||
getKillRegState(true)),
|
||||
CSI[i].getFrameIdx()));
|
||||
MBB.insert(MI, CRMIB);
|
||||
MBB.insert(MI, addFrameReference(BuildMI(*MF, DL, TII.get(PPC::STW))
|
||||
.addReg(PPC::R12,
|
||||
getKillRegState(true)),
|
||||
CSI[i].getFrameIdx()));
|
||||
}
|
||||
} else {
|
||||
const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg);
|
||||
TII.storeRegToStackSlot(MBB, MI, Reg, true,
|
||||
CSI[i].getFrameIdx(), RC, TRI);
|
||||
CSI[i].getFrameIdx(), RC, TRI);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@ -1260,8 +1262,8 @@ PPCFrameLowering::spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
static void
|
||||
restoreCRs(bool isPPC64, bool is31,
|
||||
bool CR2Spilled, bool CR3Spilled, bool CR4Spilled,
|
||||
MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
|
||||
const std::vector<CalleeSavedInfo> &CSI, unsigned CSIIndex) {
|
||||
MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
|
||||
const std::vector<CalleeSavedInfo> &CSI, unsigned CSIIndex) {
|
||||
|
||||
MachineFunction *MF = MBB.getParent();
|
||||
const PPCInstrInfo &TII =
|
||||
@ -1275,8 +1277,8 @@ restoreCRs(bool isPPC64, bool is31,
|
||||
else {
|
||||
// 32-bit: FP-relative
|
||||
MBB.insert(MI, addFrameReference(BuildMI(*MF, DL, TII.get(PPC::LWZ),
|
||||
PPC::R12),
|
||||
CSI[CSIIndex].getFrameIdx()));
|
||||
PPC::R12),
|
||||
CSI[CSIIndex].getFrameIdx()));
|
||||
RestoreOp = PPC::MTOCRF;
|
||||
MoveReg = PPC::R12;
|
||||
}
|
||||
@ -1337,9 +1339,9 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
||||
|
||||
bool
|
||||
PPCFrameLowering::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
MachineBasicBlock::iterator MI,
|
||||
const std::vector<CalleeSavedInfo> &CSI,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
MachineBasicBlock::iterator MI,
|
||||
const std::vector<CalleeSavedInfo> &CSI,
|
||||
const TargetRegisterInfo *TRI) const {
|
||||
|
||||
// Currently, this function only handles SVR4 32- and 64-bit ABIs.
|
||||
// Return false otherwise to maintain pre-existing behavior.
|
||||
@ -1387,20 +1389,20 @@ PPCFrameLowering::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
// When we first encounter a non-CR register after seeing at
|
||||
// least one CR register, restore all spilled CRs together.
|
||||
if ((CR2Spilled || CR3Spilled || CR4Spilled)
|
||||
&& !(PPC::CR2 <= Reg && Reg <= PPC::CR4)) {
|
||||
&& !(PPC::CR2 <= Reg && Reg <= PPC::CR4)) {
|
||||
bool is31 = needsFP(*MF);
|
||||
restoreCRs(Subtarget.isPPC64(), is31,
|
||||
CR2Spilled, CR3Spilled, CR4Spilled,
|
||||
MBB, I, CSI, CSIIndex);
|
||||
CR2Spilled = CR3Spilled = CR4Spilled = false;
|
||||
MBB, I, CSI, CSIIndex);
|
||||
CR2Spilled = CR3Spilled = CR4Spilled = false;
|
||||
}
|
||||
|
||||
// Default behavior for non-CR saves.
|
||||
const TargetRegisterClass *RC = TRI->getMinimalPhysRegClass(Reg);
|
||||
TII.loadRegFromStackSlot(MBB, I, Reg, CSI[i].getFrameIdx(),
|
||||
RC, TRI);
|
||||
RC, TRI);
|
||||
assert(I != MBB.begin() &&
|
||||
"loadRegFromStackSlot didn't insert any code!");
|
||||
"loadRegFromStackSlot didn't insert any code!");
|
||||
}
|
||||
|
||||
// Insert in reverse order.
|
||||
@ -1416,9 +1418,8 @@ PPCFrameLowering::restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
||||
if (CR2Spilled || CR3Spilled || CR4Spilled) {
|
||||
bool is31 = needsFP(*MF);
|
||||
restoreCRs(Subtarget.isPPC64(), is31, CR2Spilled, CR3Spilled, CR4Spilled,
|
||||
MBB, I, CSI, CSIIndex);
|
||||
MBB, I, CSI, CSIIndex);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user