[all-commits] [llvm/llvm-project] e990e5: [LangRef] Require elementtype attribute for gc.sta...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Feb 4 00:47:49 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e990e591c97653e50a77097c0cb2cd26f2ce5413
      https://github.com/llvm/llvm-project/commit/e990e591c97653e50a77097c0cb2cd26f2ce5413
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-02-04 (Fri, 04 Feb 2022)

  Changed paths:
    M llvm/docs/LangRef.rst

  Log Message:
  -----------
  [LangRef] Require elementtype attribute for gc.statepoint intrinsic

The gc.statepoint intrinsic currently determines the target function
type based on the pointer element type of the argument. In order to
support opaque pointers, require that the argument is annotated with
an elementtype attribute.

Here's an example of the change:

    ; Before:
      %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0)

    ; After:
      %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0)

    ; After with opaque pointers:
      %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0)

Differential Revision: https://reviews.llvm.org/D117890


  Commit: c680eeab30d61a34467c06bc83b93f33a9598f9f
      https://github.com/llvm/llvm-project/commit/c680eeab30d61a34467c06bc83b93f33a9598f9f
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-02-04 (Fri, 04 Feb 2022)

  Changed paths:
    M llvm/include/llvm/IR/IRBuilder.h
    M llvm/lib/IR/IRBuilder.cpp
    M llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
    M llvm/test/Transforms/RewriteStatepointsForGC/base-inference.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-inttoptr.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-vector-inseltpoison.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/basic.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/call-gc-result.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/deopt-intrinsic.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/deopt-lowering-attrs.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/intrinsics-bare.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/intrinsics.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/live-vector-nosplit-inseltpoison.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/live-vector-nosplit.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/patchable-statepoints.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/scalar-base-vector-2.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/scalar-base-vector.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/statepoint-attrs.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/statepoint-calling-conventions.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/statepoint-format.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/unordered-atomic-memcpy.ll

  Log Message:
  -----------
  [IRBuilder][RS4GC] Require FunctionCallee when creating statepoint

This makes the statepoint methods in IRBuilder accept a
FunctionCallee, which carries both the callee and function type.
This is used to add the elementtype attribute to the statepoint call.

RS4GC requires an additional tweak to actually preserve that attribute
-- previously the attributes on the call were completely overwritten.

Differential Revision: https://reviews.llvm.org/D118886


Compare: https://github.com/llvm/llvm-project/compare/3db39e74792d...c680eeab30d6


More information about the All-commits mailing list