Allow explicit spill slots to be specified for a gc.statepoint
authorPhilip Reames <listmail@philipreames.com>
Fri, 27 Mar 2015 04:52:48 +0000 (04:52 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 27 Mar 2015 04:52:48 +0000 (04:52 +0000)
commit28ffcd3f1efe9154f49af695d5a1ff9a3959c58b
tree49cbc7fb916cc14281774e4b3403d805782ba0b9
parentb827c4b92386a49d7b9f69023c98b5218c4a8963
Allow explicit spill slots to be specified for a gc.statepoint

This patch adds support for explicitly provided spill slots in the GC arguments of a gc.statepoint.  This is somewhat analogous to gcroot, but leverages the STATEPOINT MI node and StackMap infrastructure.  The motivation for this is:
1) The stack spilling code for gc.statepoints hasn't advanced as fast as I'd like.  One major option is to give up on doing spilling in the backend and do it at the IR level instead.  We'd give up the ability to have gc values in registers, but that's a minor cost in practice.  We are not neccessarily moving in that direction, but having the ability to prototype such a thing cheaply is interesting.
2) I want to port the gcroot lowering to use the statepoint infastructure.  Given the metadata printers for gcroot expect a fixed set of stack roots, it's easiest to just reuse the explicit stack slots and pass them directly to the underlying statepoint.

I'm holding off on the documentation for the new feature until I'm reasonable sure this is going to stick around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233356 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/StatepointLowering.cpp
test/CodeGen/X86/statepoint-allocas.ll [new file with mode: 0644]