[PATCH] [Statepoints] Support for "patchable" statepoints.

Sanjoy Das sanjoy at playingwithpointers.com
Wed May 6 19:56:39 PDT 2015


Hi reames, pgavlin, swaroop.sridhar, AndyAyers,

This change adds two new fields to LLVM, an "i64 ID" and an "i32
PatchBytes".  The ID field gets propagated to the ID field in the
generated StackMap section.  If the PatchBytes field is non-zero then
`PatchBytes` bytes of nops are emitted instead of the call part of the
statepoint sequence (the spill and reload code remain unchanged).
This is useful in situations where a language runtime requires
complete control over code generation.

This change brings statepoints one step closer to patchpoints.  With
some additional work (that is not part of this patch) it should be
possible to get rid of `TargetOpcode::STATEPOINT` altogether.

PlaceSafepoints generates `statepoint` wrappers with both `ID` and
`NumPatchBytes` set to `0`.  This can be made more sophisticated
later.

Note that this conflicts with D9501, and will be rebased and adjusted
once D9501 is in.

http://reviews.llvm.org/D9546

Files:
  docs/Statepoints.rst
  include/llvm/CodeGen/StackMaps.h
  include/llvm/IR/IRBuilder.h
  include/llvm/IR/Intrinsics.td
  include/llvm/IR/Statepoint.h
  lib/CodeGen/SelectionDAG/StatepointLowering.cpp
  lib/CodeGen/StackMaps.cpp
  lib/IR/IRBuilder.cpp
  lib/IR/Verifier.cpp
  lib/Target/X86/X86MCInstLower.cpp
  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/Transforms/CodeGenPrepare/statepoint-relocate.ll
  test/Transforms/InstCombine/gc.relocate.ll
  test/Transforms/InstCombine/statepoint.ll
  test/Transforms/PlaceSafepoints/basic.ll
  test/Transforms/PlaceSafepoints/call-in-loop.ll
  test/Transforms/PlaceSafepoints/finite-loops.ll
  test/Transforms/PlaceSafepoints/invokes.ll
  test/Transforms/PlaceSafepoints/split-backedge.ll
  test/Transforms/PlaceSafepoints/statepoint-frameescape.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-statepoint.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: D9546.25119.patch
Type: text/x-patch
Size: 113971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150507/f88fc3e3/attachment.bin>


More information about the llvm-commits mailing list