[llvm] [NVPTX] Annotate CUDA kernel pointer arguments with .ptr .space .align attributes. (PR #79646)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 10:36:03 PST 2024


================
@@ -0,0 +1,34 @@
+; RUN: llc < %s -march=nvptx64 -mcpu=sm_72 2>&1 | FileCheck %s
+; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_72 | %ptxas-verify %}
+
+%struct.Large = type { [16 x double] }
+
+; CHECK: .param .u64 .ptr .global .align 16 func_align_param_0,
+; CHECK: .param .u64 func_align_param_1,
----------------
Artem-B wrote:

> We generate .ptr .global .align only when the alignment is specified.

That's the part I do not understand. An argument being a pointer is one thing. Whether it has alignment or not is another. If it's a pointer, generate `.ptr`. If it has alignement specified, generate `.align N`.

Why would generation of `.ptr` need to depend on whether we know that pointer alignment? It does not stop being a pointer if we do not know its alignment.


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


More information about the llvm-commits mailing list