[X86] Simplify X87 stackifier pass.
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 1 Aug 2014 22:19:41 +0000 (22:19 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 1 Aug 2014 22:19:41 +0000 (22:19 +0000)
commit306030f8aa52ace8fd57a9b9aca06bedac3b32de
treeabfa3d9bb2821650351eb5785bfc5d0e49f28c9c
parentc36cba412ac9b05e4f9ef0c4d34f956978c98492
[X86] Simplify X87 stackifier pass.

Stop using ST registers for function returns and inline-asm instructions and use
FP registers instead. This allows removing a large amount of code in the
stackifier pass that was needed to track register liveness and handle copies
between ST and FP registers and function calls returning floating point values.

It also fixes a bug which manifests when an ST register defined by an
inline-asm instruction was live across another inline-asm instruction, as shown
in the following sequence of machine instructions:

1. INLINEASM <es:frndint> $0:[regdef], %ST0<imp-def,tied5>
2. INLINEASM <es:fldcw $0>
3. %FP0<def> = COPY %ST0

<rdar://problem/16952634>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214580 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86CallingConv.td
lib/Target/X86/X86FastISel.cpp
lib/Target/X86/X86FloatingPoint.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrCompiler.td
lib/Target/X86/X86InstrFPStack.td
lib/Target/X86/X86RegisterInfo.td
test/CodeGen/X86/inline-asm-fpstack.ll