[llvm] 4fdaac0 - [PowerPC][NFC] Remove Darwin specific logic in frame finalization.
Sean Fertile via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 21 06:32:46 PST 2020
Author: Sean Fertile
Date: 2020-02-21T09:32:24-05:00
New Revision: 4fdaac0e1eb8e75fe59de0bd01cf72329dacbdb4
URL: https://github.com/llvm/llvm-project/commit/4fdaac0e1eb8e75fe59de0bd01cf72329dacbdb4
DIFF: https://github.com/llvm/llvm-project/commit/4fdaac0e1eb8e75fe59de0bd01cf72329dacbdb4.diff
LOG: [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.
Added:
Modified:
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
index 6c49fce838ae..de79752541dd 100644
--- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
@@ -1990,19 +1990,13 @@ void PPCFrameLowering::processFunctionBeforeFrameFinalized(MachineFunction &MF,
// to the stack pointer and hence does not need an adjustment here.
// Only CR2 (the first nonvolatile spilled) has an associated frame
// index so that we have a single uniform save area.
- if (spillsCR(MF) && !(Subtarget.isPPC64() && Subtarget.isSVR4ABI())) {
+ if (spillsCR(MF) && Subtarget.is32BitELFABI()) {
// Adjust the frame index of the CR spill slot.
- for (unsigned i = 0, e = CSI.size(); i != e; ++i) {
- 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)))) {
- int FI = CSI[i].getFrameIdx();
-
+ for (const auto &CSInfo : CSI) {
+ if (CSInfo.getReg() == PPC::CR2) {
+ int FI = CSInfo.getFrameIdx();
MFI.setObjectOffset(FI, LowerBound + MFI.getObjectOffset(FI));
+ break;
}
}
More information about the llvm-commits
mailing list