diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-02-19 23:50:45 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-02-19 23:50:45 +0000 |
commit | 45a52fa097edb9ae619116e68274c908aea66519 (patch) | |
tree | f4fd3403ee5a2d76fb9f735f1433ec5216c2a7ad /llvm/lib/Target/X86/X86RegisterInfo.cpp | |
parent | 4c96e99235b32b594abaf93e5c16c81aae7acb3c (diff) | |
download | bcm5719-llvm-45a52fa097edb9ae619116e68274c908aea66519.tar.gz bcm5719-llvm-45a52fa097edb9ae619116e68274c908aea66519.zip |
[ms-inline asm] Force the use of a base pointer if the MachineFunction includes
MS-style inline assembly.
This is a follow-on to r175334. Forcing a FP to be emitted doesn't ensure it
will be used. Therefore, force the base pointer as well. We now treat MS
inline assembly in the same way we treat functions with dynamic stack
realignment and VLAs. This guarantees the BP will be used to reference
parameters and locals.
rdar://13218191
llvm-svn: 175576
Diffstat (limited to 'llvm/lib/Target/X86/X86RegisterInfo.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86RegisterInfo.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index 401eefb16af..fbe6331e845 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp @@ -389,8 +389,10 @@ bool X86RegisterInfo::hasBasePointer(const MachineFunction &MF) const { return false; // When we need stack realignment and there are dynamic allocas, we can't - // reference off of the stack pointer, so we reserve a base pointer. - if (needsStackRealignment(MF) && MFI->hasVarSizedObjects()) + // reference off of the stack pointer, so we reserve a base pointer. This + // is also true if the function contain MS-style inline assembly. + if ((needsStackRealignment(MF) && MFI->hasVarSizedObjects()) || + MF.hasMSInlineAsm()) return true; return false; |