[Statepoints 2/4] Statepoint infrastructure for garbage collection: MI & x86-64 Backend
authorPhilip Reames <listmail@philipreames.com>
Mon, 1 Dec 2014 22:52:56 +0000 (22:52 +0000)
committerPhilip Reames <listmail@philipreames.com>
Mon, 1 Dec 2014 22:52:56 +0000 (22:52 +0000)
commit78cc6fcb01a7306a380aeb65f411c89d6aa5532d
tree19515a69d384d25199f8bc26b13ab1d2b14e9cc0
parent204e21b51a87e9e0738865cfea2025199a694e96
[Statepoints 2/4] Statepoint infrastructure for garbage collection: MI & x86-64 Backend

This is the second patch in a small series.  This patch contains the MachineInstruction and x86-64 backend pieces required to lower Statepoints.  It does not include the code to actually generate the STATEPOINT machine instruction and as a result, the entire patch is currently dead code.  I will be submitting the SelectionDAG parts within the next 24-48 hours.  Since those pieces are by far the most complicated, I wanted to minimize the size of that patch.  That patch will include the tests which exercise the functionality in this patch.  The entire series can be seen as one combined whole in http://reviews.llvm.org/D5683.

The STATEPOINT psuedo node is generated after all gc values are explicitly spilled to stack slots.  The purpose of this node is to wrap an actual call instruction while recording the spill locations of the meta arguments used for garbage collection and other purposes.  The STATEPOINT is modeled as modifing all of those locations to prevent backend optimizations from forwarding the value from before the STATEPOINT to after the STATEPOINT.  (Doing so would break relocation semantics for collectors which wish to relocate roots.)

The implementation of STATEPOINT is closely modeled on PATCHPOINT.  Eventually, much of the code in this patch will be removed.  The long term plan is to merge the functionality provided by statepoints and patchpoints.  Merging their implementations in the backend is likely to be a good starting point.

Reviewed by: atrick, ributzka

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223085 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/llvm/CodeGen/StackMaps.h
include/llvm/Target/Target.td
include/llvm/Target/TargetFrameLowering.h
include/llvm/Target/TargetOpcodes.h
lib/CodeGen/InlineSpiller.cpp
lib/CodeGen/LocalStackSlotAllocation.cpp
lib/CodeGen/PrologEpilogInserter.cpp
lib/CodeGen/StackMaps.cpp
lib/CodeGen/TargetLoweringBase.cpp
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86FrameLowering.h
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86MCInstLower.cpp
utils/TableGen/CodeGenTarget.cpp