[clang] [llvm] [SPIRV][RFC] Rework / extend support for memory scopes (PR #106429)

Vyacheslav Levytskyy via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 02:21:50 PDT 2024


================
@@ -5,8 +5,8 @@
 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
 
 ; CHECK:     %[[#Int:]] = OpTypeInt 32 0
-; CHECK-DAG: %[[#Scope_Device:]] = OpConstant %[[#Int]] 1{{$}}
-; CHECK-DAG: %[[#MemSem_Relaxed:]] = OpConstant %[[#Int]] 0
+; CHECK-DAG: %[[#Scope_AllSvmDevices:]] = OpConstant %[[#Int]] 0{{$}}
----------------
VyacheslavLevytskyy wrote:

I'm not 100% sure, just as an idea -- maybe a choice of Const0 or ConstZero would be a better way than slightly misleading use of Scope_AllSvmDevices in the place of MemSem_Relaxed. Motivation for the idea is that `OpAtomicSMax %[[#Int]] %[[#Pointer]] %[[#Scope_AllSvmDevices]] %[[#Scope_AllSvmDevices]] %[[#Value]]` looks just wrong and I'm not sure that even the comment below will help to avoid confusions.

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


More information about the cfe-commits mailing list