summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86ExpandPseudo.cpp
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2015-05-27 06:28:41 +0000
committerQuentin Colombet <qcolombet@apple.com>2015-05-27 06:28:41 +0000
commitaa8020752ef813a4dd07d11733589e3ae036984d (patch)
tree810d2f9ee51e9cbf30980d9949dc75d272146d9f /llvm/lib/Target/X86/X86ExpandPseudo.cpp
parent8083588a7eaedef8b8ec02cae37aefdaa3847355 (diff)
downloadbcm5719-llvm-aa8020752ef813a4dd07d11733589e3ae036984d.tar.gz
bcm5719-llvm-aa8020752ef813a4dd07d11733589e3ae036984d.zip
[X86] Implement the support for shrink-wrapping.
With this patch the x86 backend is now shrink-wrapping capable and this functionality can be tested by using the -enable-shrink-wrap switch. The next step is to make more test and enable shrink-wrapping by default for x86. Related to <rdar://problem/20821487> llvm-svn: 238293
Diffstat (limited to 'llvm/lib/Target/X86/X86ExpandPseudo.cpp')
-rw-r--r--llvm/lib/Target/X86/X86ExpandPseudo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ExpandPseudo.cpp b/llvm/lib/Target/X86/X86ExpandPseudo.cpp
index 29ca3736aca..1b00997e750 100644
--- a/llvm/lib/Target/X86/X86ExpandPseudo.cpp
+++ b/llvm/lib/Target/X86/X86ExpandPseudo.cpp
@@ -88,8 +88,9 @@ bool X86ExpandPseudo::ExpandMI(MachineBasicBlock &MBB,
// standard x86_64 and NaCl use 64-bit frame/stack pointers, x32 - 32-bit.
const bool Uses64BitFramePtr =
STI->isTarget64BitLP64() || STI->isTargetNaCl64();
- bool UseLEAForSP =
- X86FL->useLEAForSPInProlog(*MBB.getParent());
+ // Check if we should use LEA for SP.
+ bool UseLEAForSP = STI->useLeaForSP() &&
+ X86FL->canUseLEAForSPInEpilogue(*MBB.getParent());
unsigned StackPtr = TRI->getStackRegister();
// Check for possible merge with preceding ADD instruction.
StackAdj += X86FrameLowering::mergeSPUpdates(MBB, MBBI, StackPtr, true);
OpenPOWER on IntegriCloud