diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2015-09-11 18:54:38 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2015-09-11 18:54:38 +0000 |
commit | bc497c93f5182757dc220b7bea5bd9801a47138b (patch) | |
tree | e5f99720b31fc40c71de9456539f24225bfeb543 /llvm/lib/Target | |
parent | 660195a7925bf42b556239deda2883326a0f376b (diff) | |
download | bcm5719-llvm-bc497c93f5182757dc220b7bea5bd9801a47138b.tar.gz bcm5719-llvm-bc497c93f5182757dc220b7bea5bd9801a47138b.zip |
Use function attribute "stackrealign" to decide whether stack
realignment should be forced.
With this commit, we can now force stack realignment when doing LTO and
do so on a per-function basis. Also, add a new cl::opt option
"stackrealign" to CommandFlags.h which is used to force stack
realignment via llc's command line.
Out-of-tree projects currently using -force-align-stack to force stack
realignment should make changes to attach the attribute to the functions
in the IR.
Differential Revision: http://reviews.llvm.org/D11814
llvm-svn: 247450
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86FrameLowering.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp index 05ab69cb870..9e098101192 100644 --- a/llvm/lib/Target/X86/X86FrameLowering.cpp +++ b/llvm/lib/Target/X86/X86FrameLowering.cpp @@ -499,7 +499,7 @@ uint64_t X86FrameLowering::calculateMaxStackAlign(const MachineFunction &MF) con const MachineFrameInfo *MFI = MF.getFrameInfo(); uint64_t MaxAlign = MFI->getMaxAlignment(); // Desired stack alignment. unsigned StackAlign = getStackAlignment(); - if (ForceStackAlign) { + if (MF.getFunction()->hasFnAttribute("stackrealign")) { if (MFI->hasCalls()) MaxAlign = (StackAlign > MaxAlign) ? StackAlign : MaxAlign; else if (MaxAlign < SlotSize) |