[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)
commit3516669a50bb64ee7d27c0bbc00b2439477071bf
treeccbf04a744404c99d92d4c89df279bd056f1d989
parent570706dd7cb27bc3fcd05221a5168a6d85199410
[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>

llvm-svn: 214580
llvm/lib/Target/X86/X86CallingConv.td
llvm/lib/Target/X86/X86FastISel.cpp
llvm/lib/Target/X86/X86FloatingPoint.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrCompiler.td
llvm/lib/Target/X86/X86InstrFPStack.td
llvm/lib/Target/X86/X86RegisterInfo.td
llvm/test/CodeGen/X86/inline-asm-fpstack.ll