Use target-specific nodes for calls. This allows the fastcc code to not have
authorChris Lattner <sabre@nondot.org>
Sat, 14 May 2005 08:48:15 +0000 (08:48 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 14 May 2005 08:48:15 +0000 (08:48 +0000)
commit239738a1620815b83097a4ac1bba9609c9eb2af8
treede8403cb841c0d339a54a57680de8804e34e7f02
parent2789bde57f4245f4418a2d8d54e7f372b71f0a7d
Use target-specific nodes for calls.  This allows the fastcc code to not have
to do ugly hackery to avoid emitting code like this:

   call foo
   mov vreg, EAX
   adjcallstackup ...

If foo is a fastcc call and if vreg gets spilled, we might end up with this:

   call foo
   mov [ESP+offset], EAX     ;; Offset doesn't consider the 12!
   sub ESP, 12

Which is bad.  The previous hacky code to deal with this was A) gross B) not
good enough.  In particular, it could miss cases and emit the bad code above.
Now we always emit this:

   call foo
   adjcallstackup ...
   mov vreg, EAX

directly.

This makes fastcc with callees poping the stack work much better.  Next
stop (finally!) really is tail calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22021 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelPattern.cpp