diff options
author | Luo, Yuanke <yuanke.luo@intel.com> | 2019-08-10 02:49:02 +0000 |
---|---|---|
committer | Luo, Yuanke <yuanke.luo@intel.com> | 2019-08-10 02:49:02 +0000 |
commit | c6c86f4f81fb9130499f2b75764b8227cddc2375 (patch) | |
tree | ee2bb05b025fe16dfbede5a55d4f5556ee58d6e7 /llvm/lib/Target/X86/X86FrameLowering.cpp | |
parent | 92e160ababd1e9e976fa1c573bbe906997bb206d (diff) | |
download | bcm5719-llvm-c6c86f4f81fb9130499f2b75764b8227cddc2375.tar.gz bcm5719-llvm-c6c86f4f81fb9130499f2b75764b8227cddc2375.zip |
[X86] Fix stack probe issue on windows32.
Summary:
On windows if the frame size exceed 4096 bytes, compiler need to
generate a call to _alloca_probe. X86CallFrameOptimization pass
changes the reserved stack size and cause of stack probe function
not be inserted. This patch fix the issue by detecting the call
frame size, if the size exceed 4096 bytes, drop X86CallFrameOptimization.
Reviewers: craig.topper, wxiao3, annita.zhang, rnk, RKSimon
Reviewed By: rnk
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65923
llvm-svn: 368503
Diffstat (limited to 'llvm/lib/Target/X86/X86FrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86FrameLowering.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp index aff686e9cae..47be92e5972 100644 --- a/llvm/lib/Target/X86/X86FrameLowering.cpp +++ b/llvm/lib/Target/X86/X86FrameLowering.cpp @@ -1022,14 +1022,7 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF, X86FI->getCalleeSavedFrameSize() - TailCallReturnAddrDelta); bool UseStackProbe = !STI.getTargetLowering()->getStackProbeSymbolName(MF).empty(); - - // The default stack probe size is 4096 if the function has no stackprobesize - // attribute. - unsigned StackProbeSize = 4096; - if (Fn.hasFnAttribute("stack-probe-size")) - Fn.getFnAttribute("stack-probe-size") - .getValueAsString() - .getAsInteger(0, StackProbeSize); + unsigned StackProbeSize = STI.getTargetLowering()->getStackProbeSize(MF); // Re-align the stack on 64-bit if the x86-interrupt calling convention is // used and an error code was pushed, since the x86-64 ABI requires a 16-byte |