[X86] Make sure it is safe to clobber EFLAGS, if need be, when choosing
authorQuentin Colombet <qcolombet@apple.com>
Tue, 26 Apr 2016 23:44:14 +0000 (23:44 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Tue, 26 Apr 2016 23:44:14 +0000 (23:44 +0000)
commit4ff3cfb6733235b8fbf1f08f1f53bedc37d86e9f
tree14fd75d48238c04d5990750ba6ae85a51fc62b7e
parent9491371f6ff345a820ff98e398b194604fd341dc
[X86] Make sure it is safe to clobber EFLAGS, if need be, when choosing
the prologue.

Do not use basic blocks that have EFLAGS live-in as prologue if we need
to realign the stack. Realigning the stack uses AND instruction and this
clobbers EFLAGS.

An other alternative would have been to save and restore EFLAGS around
the stack realignment code, but this is likely inefficient.

Fixes PR27531.

llvm-svn: 267634
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/lib/Target/X86/X86FrameLowering.h
llvm/test/CodeGen/X86/i686-win-shrink-wrapping.ll [new file with mode: 0644]