diff options
| author | Jessica Paquette <jpaquette@apple.com> | 2018-04-12 16:16:18 +0000 |
|---|---|---|
| committer | Jessica Paquette <jpaquette@apple.com> | 2018-04-12 16:16:18 +0000 |
| commit | 8aa6cd5cb99901219ac7461b1c74784179007913 (patch) | |
| tree | f1b20f0a9c2b0de0b30637b928c6d7486a072051 /llvm/lib | |
| parent | 12e2afd2fa960277636b0951890e3f8dbcb532b8 (diff) | |
| download | bcm5719-llvm-8aa6cd5cb99901219ac7461b1c74784179007913.tar.gz bcm5719-llvm-8aa6cd5cb99901219ac7461b1c74784179007913.zip | |
[AArch64] Move AFI->setRedZone(false) to top of emitPrologue
AFI->setRedZone(false) was put in the wrong place before, and so it only fired
on functions that didn't have stack frames. This moves that to the top of
emitPrologue to make sure that every function without a redzone has it set
correctly.
This also adds a function representing one of the early exit cases (GHC calling
convention) to the MachineOutliner noredzone test to ensure that we can outline
from functions like these, where we never use a redzone.
llvm-svn: 329922
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp index b01a1ae5798..8575e59cd59 100644 --- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp @@ -527,6 +527,11 @@ void AArch64FrameLowering::emitPrologue(MachineFunction &MF, bool needsFrameMoves = MMI.hasDebugInfo() || F.needsUnwindTableEntry(); bool HasFP = hasFP(MF); + // At this point, we're going to decide whether or not the function uses a + // redzone. In most cases, the function doesn't have a redzone so let's + // assume that's false and set it to true in the case that there's a redzone. + AFI->setHasRedZone(false); + // Debug location must be unknown since the first debug location is used // to determine the end of the prologue. DebugLoc DL; @@ -551,7 +556,6 @@ void AArch64FrameLowering::emitPrologue(MachineFunction &MF, AFI->setHasRedZone(true); ++NumRedZoneFunctions; } else { - AFI->setHasRedZone(false); emitFrameOffset(MBB, MBBI, DL, AArch64::SP, AArch64::SP, -NumBytes, TII, MachineInstr::FrameSetup); |

