[llvm] [NVPTX] Basic support for "grid_constant" (PR #96125)

Akshay Deodhar via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 13:36:06 PDT 2024


================
@@ -1596,6 +1596,11 @@ def int_nvvm_ptr_gen_to_param: Intrinsic<[llvm_anyptr_ty],
                                    [IntrNoMem, IntrSpeculatable, IntrNoCallback],
                                    "llvm.nvvm.ptr.gen.to.param">;
 
+// sm70+, PTX7.7+
+def int_nvvm_ptr_param_to_gen: DefaultAttrsIntrinsic<[llvm_anyptr_ty],
+                                     [llvm_anyptr_ty],
+                                   [IntrNoMem, IntrSpeculatable, IntrNoCallback]>;
----------------
akshayrdeodhar wrote:

The name string is automatically generated based on the definition name, by replacing `_` with `.`. For example:
```
// @llvm.memcpy.element.unordered.atomic.*(dest, src, length, elementsize)
def int_memcpy_element_unordered_atomic
    : Intrinsic<[],
                [llvm_anyptr_ty, llvm_anyptr_ty, llvm_anyint_ty, llvm_i32_ty],
                [IntrArgMemOnly, IntrWillReturn, IntrNoSync,
                 NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>,
                 WriteOnly<ArgIndex<0>>, ReadOnly<ArgIndex<1>>,
                 ImmArg<ArgIndex<3>>]>;
```

However, for uniformity, it still might be better to explicitly mention the name. What would you suggest?

https://github.com/llvm/llvm-project/pull/96125


More information about the llvm-commits mailing list