[X86, Win64] Use a frame pointer if pushf is emitted
authorDavid Majnemer <david.majnemer@gmail.com>
Sun, 27 Dec 2015 06:07:26 +0000 (06:07 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sun, 27 Dec 2015 06:07:26 +0000 (06:07 +0000)
commit134207508213455c8969a2e07115798619989154
treedcc2a1d9e7c6c943bb2ba0a7e4109ed5e62bfd9a
parent7de4c3d125873917212a999cf1041f76fd56003e
[X86, Win64] Use a frame pointer if pushf is emitted

A frame pointer must be used if stack pointer is modified after the
prologue.  LLVM will emit pushf/popf if we need to save/restore the
FLAGS register, requiring us to have a frame pointer for the function.

There is a small twist: this sequence might exist in user code via
inline-assembly.  For now, conservatively assume that such functions
require a frame pointer.  For real world justification, please see
clang's implementation of __readeflags.

This fixes PR25945.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256456 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/2009-06-03-Win64SpillXMM.ll
test/CodeGen/X86/inline-sse.ll
test/CodeGen/X86/pr11415.ll
test/CodeGen/X86/win64_frame.ll
test/CodeGen/X86/x86-win64-shrink-wrapping.ll
test/DebugInfo/COFF/asm.ll