diff options
| author | Matthias Braun <matze@braunis.de> | 2018-01-10 22:36:28 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2018-01-10 22:36:28 +0000 |
| commit | e3a8db7ba1f8c18ccaddbdc84e19af8eead6df4d (patch) | |
| tree | 2c66857c7f3253e28194d4153539b7f35c30605b /llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | |
| parent | f23ccf06c6abe9fe65b7f6793202e1e551a95cfc (diff) | |
| download | bcm5719-llvm-e3a8db7ba1f8c18ccaddbdc84e19af8eead6df4d.tar.gz bcm5719-llvm-e3a8db7ba1f8c18ccaddbdc84e19af8eead6df4d.zip | |
Revert "AArch64: Fix emergency spillslot being out of reach for large callframes"
Revert for now as the testcase is hitting a pre-existing verifier error
that manifest as a failure when expensive checks are enabled (or
-verify-machineinstrs) is used.
This reverts commit r322200.
llvm-svn: 322231
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64FrameLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp index ea4bfe7e8d9..d66f7b59a4b 100644 --- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp @@ -142,12 +142,6 @@ static cl::opt<bool> EnableRedZone("aarch64-redzone", STATISTIC(NumRedZoneFunctions, "Number of functions using red zone"); -/// This is the biggest offset to the stack pointer we can encode in aarch64 -/// instructions (without using a separate calculation and a temp register). -/// Note that the exception here are vector stores/loads which cannot encode any -/// displacements (see estimateRSStackSizeLimit(), isAArch64FrameOffsetLegal()). -static const unsigned DefaultSafeSPDisplacement = 255; - /// Look at each instruction that references stack frames and return the stack /// size limit beyond which some of these instructions will require a scratch /// register during their expansion later. @@ -173,7 +167,7 @@ static unsigned estimateRSStackSizeLimit(MachineFunction &MF) { } } } - return DefaultSafeSPDisplacement; + return 255; } bool AArch64FrameLowering::canUseRedZone(const MachineFunction &MF) const { @@ -197,25 +191,11 @@ bool AArch64FrameLowering::hasFP(const MachineFunction &MF) const { const MachineFrameInfo &MFI = MF.getFrameInfo(); const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo(); // Retain behavior of always omitting the FP for leaf functions when possible. - if (MFI.hasCalls() && MF.getTarget().Options.DisableFramePointerElim(MF)) - return true; - if (MFI.hasVarSizedObjects() || MFI.isFrameAddressTaken() || - MFI.hasStackMap() || MFI.hasPatchPoint() || - RegInfo->needsStackRealignment(MF)) - return true; - // With large callframes around we may need to use FP to access the scavenging - // emergency spillslot. - // - // Unfortunately some calls to hasFP() like machine verifier -> - // getReservedReg() -> hasFP in the middle of global isel are too early - // to know the max call frame size. Hopefully conservatively returning "true" - // in those cases is fine. - // DefaultSafeSPDisplacement is fine as we only emergency spill GP regs. - if (!MFI.isMaxCallFrameSizeComputed() || - MFI.getMaxCallFrameSize() > DefaultSafeSPDisplacement) - return true; - - return false; + return (MFI.hasCalls() && + MF.getTarget().Options.DisableFramePointerElim(MF)) || + MFI.hasVarSizedObjects() || MFI.isFrameAddressTaken() || + MFI.hasStackMap() || MFI.hasPatchPoint() || + RegInfo->needsStackRealignment(MF); } /// hasReservedCallFrame - Under normal circumstances, when a frame pointer is |

