================
@@ -0,0 +1,24 @@
+// REQUIRES: amdgpu-registered-target
+// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -cl-std=CL2.0 -O0 -emit-llvm -o -
%s | FileCheck %s --check-prefix=AMDGCN
+// RUN: %clang_cc1 -triple spir64-unknown-unknown -cl-std=CL2.0 -O0 -emit-llvm
-o - %s | FileCheck %s --check-prefix=SPIR
+
+kernel void constant_load(global int *out, constant int *in) {
+ out[0] = in[0];
+}
+
+// AMDGCN-LABEL: define{{.*}}@constant_load(
+// AMDGCN: load i32, ptr addrspace(4) %{{.*}}, align 4, !invariant.load
[[INVARIANT:![0-9]+]]
+// SPIR-LABEL: define{{.*}}@constant_load(
+// SPIR: load i32, ptr addrspace(2) %{{.*}}, align 4, !invariant.load
[[INVARIANT:![0-9]+]]
+
+kernel void global_const_load(global int *out, global const int *in) {
+ out[0] = in[0];
+}
+
----------------
arsenm wrote:
Also check the Cuda case?
https://github.com/llvm/llvm-project/pull/218356
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits