Extend the statepoint intrinsic to allow statepoints to be marked as transitions...
authorPat Gavlin <pagavlin@microsoft.com>
Fri, 8 May 2015 18:07:42 +0000 (18:07 +0000)
committerPat Gavlin <pagavlin@microsoft.com>
Fri, 8 May 2015 18:07:42 +0000 (18:07 +0000)
commit5c7f7462e40e98bf6fa02baadec7337586192b7e
tree5868772d7096ffa7d97d6bb0bc12a0c0b7a48b0a
parentc417f302cbfe67ac25521b391199ec3ea1fa1f0b
Extend the statepoint intrinsic to allow statepoints to be marked as transitions from GC-aware code to code that is not GC-aware.

This changes the shape of the statepoint intrinsic from:

  @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 unused, ...call args, i32 # deopt args, ...deopt args, ...gc args)

to:

  @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 flags, ...call args, i32 # transition args, ...transition args, i32 # deopt args, ...deopt args, ...gc args)

This extension offers the backend the opportunity to insert (somewhat) arbitrary code to manage the transition from GC-aware code to code that is not GC-aware and back.

In order to support the injection of transition code, this extension wraps the STATEPOINT ISD node generated by the usual lowering lowering with two additional nodes: GC_TRANSITION_START and GC_TRANSITION_END. The transition arguments that were passed passed to the intrinsic (if any) are lowered and provided as operands to these nodes and may be used by the backend during code generation.

Eventually, the lowering of the GC_TRANSITION_{START,END} nodes should be informed by the GC strategy in use for the function containing the intrinsic call; for now, these nodes are instead replaced with no-ops.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236888 91177308-0d34-0410-b5e6-96231b3b80d8
43 files changed:
docs/Statepoints.rst
include/llvm/CodeGen/ISDOpcodes.h
include/llvm/IR/Statepoint.h
lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
lib/CodeGen/SelectionDAG/StatepointLowering.cpp
lib/IR/IRBuilder.cpp
lib/IR/Verifier.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
test/Analysis/ValueTracking/memory-dereferenceable.ll
test/CodeGen/Generic/overloaded-intrinsic-name.ll
test/CodeGen/X86/statepoint-allocas.ll
test/CodeGen/X86/statepoint-call-lowering.ll
test/CodeGen/X86/statepoint-forward.ll
test/CodeGen/X86/statepoint-gctransition-call-lowering.ll [new file with mode: 0644]
test/CodeGen/X86/statepoint-invoke.ll
test/CodeGen/X86/statepoint-stack-usage.ll
test/CodeGen/X86/statepoint-stackmap-format.ll
test/Transforms/CodeGenPrepare/statepoint-relocate.ll
test/Transforms/InstCombine/gc.relocate.ll
test/Transforms/InstCombine/statepoint.ll
test/Transforms/PlaceSafepoints/basic.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll
test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll
test/Transforms/RewriteStatepointsForGC/base-pointers.ll
test/Transforms/RewriteStatepointsForGC/basics.ll
test/Transforms/RewriteStatepointsForGC/constants.ll
test/Transforms/RewriteStatepointsForGC/live-vector.ll
test/Transforms/RewriteStatepointsForGC/liveness-basics.ll
test/Transforms/RewriteStatepointsForGC/preprocess.ll
test/Transforms/RewriteStatepointsForGC/relocate_invoke_result.ll
test/Transforms/RewriteStatepointsForGC/relocation.ll
test/Verifier/invalid-statepoint2.ll
test/Verifier/statepoint.ll