Skip to content

Commit 4fdaac0

Browse files
committed
[PowerPC][NFC] Remove Darwin specific logic in frame finalization.
Remove some cumbersome Darwin specific logic for updating the frame offsets of the condition-register spill slots. The containing function has an early return if the subtarget is not ELF based which makes the Darwin logic dead.
1 parent b55c58a commit 4fdaac0

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

llvm/lib/Target/PowerPC/PPCFrameLowering.cpp

+5-11
Original file line numberDiff line numberDiff line change
@@ -1990,19 +1990,13 @@ void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
19901990
// to the stack pointer and hence does not need an adjustment here.
19911991
// Only CR2 (the first nonvolatile spilled) has an associated frame
19921992
// index so that we have a single uniform save area.
1993-
if (spillsCR(MF) && !(Subtarget.isPPC64() && Subtarget.isSVR4ABI())) {
1993+
if (spillsCR(MF) && Subtarget.is32BitELFABI()) {
19941994
// Adjust the frame index of the CR spill slot.
1995-
for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
1996-
unsigned Reg = CSI[i].getReg();
1997-
1998-
if ((Subtarget.isSVR4ABI() && Reg == PPC::CR2)
1999-
// Leave Darwin logic as-is.
2000-
|| (!Subtarget.isSVR4ABI() &&
2001-
(PPC::CRBITRCRegClass.contains(Reg) ||
2002-
PPC::CRRCRegClass.contains(Reg)))) {
2003-
int FI = CSI[i].getFrameIdx();
2004-
1995+
for (const auto &CSInfo : CSI) {
1996+
if (CSInfo.getReg() == PPC::CR2) {
1997+
int FI = CSInfo.getFrameIdx();
20051998
MFI.setObjectOffset(FI, LowerBound + MFI.getObjectOffset(FI));
1999+
break;
20062000
}
20072001
}
20082002

0 commit comments

Comments
 (0)