Introduce a "gc-live" bundle for the gc arguments of a statepoint
authorPhilip Reames <listmail@philipreames.com>
Wed, 3 Jun 2020 21:56:24 +0000 (14:56 -0700)
committerPhilip Reames <listmail@philipreames.com>
Wed, 3 Jun 2020 22:00:24 +0000 (15:00 -0700)
commit0e7c77053f560d391fecbec5d5e0e42082865c8a
treec31e078e63ea3b665cb15903735b6b2cc83e6fa6
parent27fca57546c2828e2684c02b7aa677cbd6603bfd
Introduce a "gc-live" bundle for the gc arguments of a statepoint

Currently, gc.relocates are defined in terms of indices into the statepoint's operand list. Given the gc args are at the end of a variable length list of operands, this makes interpreting their indices by hand a tad challenging. We can simplify the statepoint sequence and improve readability quite a bit by pulling these new operands into their own named operand bundle.

This patch defines a new operand bundle tag "gc-live". The semantics of the bundle are the same as the existing gc arguments of a statepoint. This patch simply introduces the definition and codegen for the bundle, future patches will migrate RS4GC to emitting the new form.

Interestingly, with this done and the recent migration to using deopt and gc-transition bundles, we really don't have much left in the statepoint itself. It really looks like the existing ID and flags fields are redundant; we have (existing!) attributes for all of them. I think we'll be able to reduce the gc.statepoint signature to simply a wrapped call (e.g. actual target and actual arguments).

Differential Revision: https://reviews.llvm.org/D80937
llvm/docs/LangRef.rst
llvm/docs/Statepoints.rst
llvm/include/llvm/IR/LLVMContext.h
llvm/include/llvm/IR/Statepoint.h
llvm/lib/IR/LLVMContext.cpp
llvm/lib/IR/Verifier.cpp
llvm/test/Bitcode/operand-bundles-bc-analyzer.ll
llvm/test/CodeGen/X86/statepoint-gc-live.ll [new file with mode: 0644]