From e990e591c97653e50a77097c0cb2cd26f2ce5413 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 21 Jan 2022 15:46:00 +0100 Subject: [PATCH] [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 --- llvm/docs/LangRef.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 920834b..41e4714 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -12251,7 +12251,7 @@ Syntax: declare token @llvm.experimental.gc.statepoint(i64 , i32 , - func_type , + func_type* elementtype(func_type) , i64 <#call args>, i64 , ... (call parameters), i64 0, i64 0) @@ -12287,11 +12287,12 @@ statepoint still represents a call or invoke to 'target', and the nop sequence after patching is expected to represent an operation equivalent to a call or invoke to 'target'. -The 'target' operand is the function actually being called. The -target can be specified as either a symbolic LLVM function, or as an -arbitrary Value of appropriate function type. Note that the function -type must match the signature of the callee and the types of the 'call -parameters' arguments. +The 'target' operand is the function actually being called. The operand +must have an :ref:`elementtype ` attribute specifying +the function type of the target. The target can be specified as either +a symbolic LLVM function, or as an arbitrary Value of pointer type. Note +that the function type must match the signature of the callee and the +types of the 'call parameters' arguments. The '#call args' operand is the number of arguments to the actual call. It must exactly match the number of arguments passed in the -- 2.7.4