[clang] [Clang][AMDGPU] Add a new builtin type for buffer rsrc (PR #94830)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 13 15:06:52 PDT 2024


================
@@ -0,0 +1,69 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
+ // REQUIRES: amdgpu-registered-target
+ // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu verde -emit-llvm -o - %s | FileCheck %s
+ // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu tonga -emit-llvm -o - %s | FileCheck %s
+ // RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1100 -emit-llvm -o - %s | FileCheck %s
+
+typedef struct AA_ty {
+  int x;
+  __amdgcn_buffer_rsrc_t r;
+} AA;
+
+AA getAA(void *p);
+__amdgcn_buffer_rsrc_t getBuffer(void *p);
+void consumeBuffer(__amdgcn_buffer_rsrc_t);
+
+// CHECK-LABEL: @consumeBufferPtr(
----------------
arsenm wrote:

The interesting check here is the IR type in the function signature which are missing. Also should test it as a return value (and return value in a struct)

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


More information about the cfe-commits mailing list