[PATCH] Extend the statepoint intrinsic to allow statepoints to be marked as transitions from GC-aware code to code that is not GC-aware.

Pat Gavlin pagavlin at microsoft.com
Tue May 5 09:20:33 PDT 2015


Hi reames, AndyAyers, swaroop.sridhar,

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.

http://reviews.llvm.org/D9501

Files:
  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
  lib/Transforms/Scalar/PlaceSafepoints.cpp
  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-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

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9501.24953.patch
Type: text/x-patch
Size: 91907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150505/82f608e9/attachment.bin>


More information about the llvm-commits mailing list