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)
commit4ac17a30267b2d00024d67a5f1ec27cee1554547
treeb6552330b401c046acc904d6c2b9267b09656ff1
parentc1d42ad99a3b1e07ab293dfca9d390b92faf08dc
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

llvm-svn: 225365
llvm/include/llvm/CodeGen/GCStrategy.h
llvm/include/llvm/CodeGen/GCs.h
llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/CMakeLists.txt
llvm/lib/CodeGen/GCStrategy.cpp
llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
llvm/test/CodeGen/X86/statepoint-forward.ll