compiler/arm/c-call: Relieve register pressure immediately before CALL-OUT.
commit8f5ece1408f05b12e8fc6979e21af2faa706350c
authorAlastair Bridgewater <nyef@kana.lisphacker.com>
Wed, 22 Jan 2014 17:11:56 +0000 (22 12:11 -0500)
committerAlastair Bridgewater <nyef@kana.lisphacker.com>
Sat, 10 May 2014 19:12:16 +0000 (10 15:12 -0400)
tree36b9294fa9489c6a55ac1cf77423a07ad214c16a
parent6972d40e3951b2b54f56f56213b558bbc536d723
compiler/arm/c-call: Relieve register pressure immediately before CALL-OUT.

  * The REPRESENT phase of the compiler emits a SAP-MOVE VOP for
the FUNCTION parameter to CALL-OUT, because it has to coerce it
from a SAP-REG (even if it's possibly been spilled) to a SAP-STACK.

  * In high register pressure scenarios (more than three
parameters to an alien function), the value has already been
spilled to the number stack, so the SAP-MOVE VOP doesn't actually
generate any code, but because the compiler doesn't decide to
spill the value until during the PACK phase, it has to assume that
the SAP-REG TN for the SAP-MOVE is live (lifetime analysis is done
pre-PACK).  Unfortunately, our register pressure is so high that
we don't have enough registers for this.

  * But we could still take the FUNCTION in a SAP-REG if we wanted
to, and this would completely eliminate the VOP introduced by
REPRESENT, meaning that our register pressure relaxes just enough
that we can handle an alien function with four register parameters
(the maximum number of register parameters, the rest are passed on
the stack).

  * Accept both SAP-REG and SAP-STACK for the FUNCTION argument,
using SC-CASE to determine how to load the value into its target
register for the call.
src/compiler/arm/c-call.lisp