[llvm] [Verifier][AMDGPU] No store to const addrspace (PR #109181)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 11:41:34 PDT 2024


================
@@ -0,0 +1,9 @@
+; RUN: not opt -mtriple=amdgcn --passes=lint --lint-abort-on-error %s -o - |& FileCheck %s
+
+define amdgpu_kernel void @store_const(ptr addrspace(4) %out, i32 %a, i32 %b) addrspace(4) {
+; CHECK: Undefined behavior: Write to const memory
+; CHECK-NEXT: store i32 %r, ptr addrspace(4) %out
+  %r = add i32 %a, %b
+  store i32 %r, ptr addrspace(4) %out
+  ret void
+}
----------------
arsenm wrote:

test atomicrmw, cmpxchg, and a memset, memcpy? Also at least the addrspace(6) case 

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


More information about the llvm-commits mailing list