diff options
author | Matthias Braun <matze@braunis.de> | 2017-05-05 22:04:05 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2017-05-05 22:04:05 +0000 |
commit | 4682ac6c83d83f24100fd5293fabd97009e27996 (patch) | |
tree | 607f8fe81402fe80ec5a2cd4cf5fb7de608d8367 /llvm/include | |
parent | 8c74673388f62f5f4bffc7e840d405c0914558a4 (diff) | |
download | bcm5719-llvm-4682ac6c83d83f24100fd5293fabd97009e27996.tar.gz bcm5719-llvm-4682ac6c83d83f24100fd5293fabd97009e27996.zip |
ARM: Compute MaxCallFrame size early
This exposes a method in MachineFrameInfo that calculates
MaxCallFrameSize and calls it after instruction selection in the ARM
target.
This avoids
ARMBaseRegisterInfo::canRealignStack()/ARMFrameLowering::hasReservedCallFrame()
giving different answers in early/late phases of codegen.
The testcase shows a particular nasty example result of that where we
would fail to properly align an alloca.
Differential Revision: https://reviews.llvm.org/D32622
llvm-svn: 302303
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/CodeGen/MachineFrameInfo.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineFrameInfo.h b/llvm/include/llvm/CodeGen/MachineFrameInfo.h index 61be9f775c9..689f3cd9fd1 100644 --- a/llvm/include/llvm/CodeGen/MachineFrameInfo.h +++ b/llvm/include/llvm/CodeGen/MachineFrameInfo.h @@ -520,6 +520,14 @@ public: bool hasTailCall() const { return HasTailCall; } void setHasTailCall() { HasTailCall = true; } + /// Computes the maximum size of a callframe and the AdjustsStack property. + /// This only works for targets defining + /// TargetInstrInfo::getCallFrameSetupOpcode(), getCallFrameDestroyOpcode(), + /// and getFrameSize(). + /// This is usually computed by the prologue epilogue inserter but some + /// targets may call this to compute it earlier. + void computeMaxCallFrameSize(const MachineFunction &MF); + /// Return the maximum size of a call frame that must be /// allocated for an outgoing function call. This is only available if /// CallFrameSetup/Destroy pseudo instructions are used by the target, and |