My previous commit had an incomplete message, it should have been:
authorChris Lattner <sabre@nondot.org>
Wed, 16 Jan 2008 05:56:59 +0000 (05:56 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 16 Jan 2008 05:56:59 +0000 (05:56 +0000)
commit7ff79c2d9d5e0c014ca8283cd38f5fbf3dd67790
tree9fa33b732507848b56458b5d43d0a75f3ed48fcf
parent142fb3fee8ebdcf5a501f6fc7d4dfe909e9c478e
My previous commit had an incomplete message, it should have been:

make the 'fp return in ST(0)' optimization smart enough to
look through token factor nodes.  THis allows us to compile
testcases like CodeGen/X86/fp-stack-retcopy.ll into:

_carg:
subl $12, %esp
call L_foo$stub
fstpl (%esp)
fldl (%esp)
addl $12, %esp
ret

instead of:

_carg:
subl $28, %esp
call L_foo$stub
fstpl 16(%esp)
movsd 16(%esp), %xmm0
movsd %xmm0, 8(%esp)
fldl 8(%esp)
addl $28, %esp
ret

Still not optimal, but much better and this is a trivial patch.  Fixing
the rest requires invasive surgery that is is not llvm 2.2 material.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46054 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/fp-stack-retcopy.ll [new file with mode: 0644]