Introduce an example statepoint GC strategy
authorPhilip Reames <listmail@philipreames.com>
Wed, 7 Jan 2015 19:07:50 +0000 (19:07 +0000)
committerPhilip Reames <listmail@philipreames.com>
Wed, 7 Jan 2015 19:07:50 +0000 (19:07 +0000)
commit28fa9e1e9f5d3a5ff003fe1c8e18af8c40019e39
tree2d210aa673a015fef0b9191677f051a8dcf8602d
parentc694182380539b93bc153e0e79a141372b4d5dac
Introduce an example statepoint GC strategy

This change includes the most basic possible GCStrategy for a GC which is using the statepoint lowering code. At the moment, this GCStrategy doesn't really do much - aside from actually generate correct stackmaps that is - but I went ahead and added a few extra correctness checks as proof of concept. It's mostly here to provide documentation on how to do one, and to provide a point for various optimization legality hooks I'd like to add going forward. (For context, see the TODOs in InstCombine around gc.relocate.)

Most of the validation logic added here as proof of concept will soon move in to the Verifier.  That move is dependent on http://reviews.llvm.org/D6811

There was discussion in the review thread about addrspace(1) being reserved for something.  I'm going to follow up on a seperate llvmdev thread.  If needed, I'll update all the code at once.

Note that I am deliberately not making a GCStrategy required to use gc.statepoints with this change. I want to give folks out of tree - including myself - a chance to migrate. In a week or two, I'll make having a GCStrategy be required for gc.statepoints. To this end, I added the gc tag to one of the test cases but not others.

Differential Revision: http://reviews.llvm.org/D6808

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225365 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GCStrategy.h
include/llvm/CodeGen/GCs.h
include/llvm/CodeGen/LinkAllCodegenComponents.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/CMakeLists.txt
lib/CodeGen/GCStrategy.cpp
lib/CodeGen/SelectionDAG/StatepointLowering.cpp
test/CodeGen/X86/statepoint-forward.ll