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

Alex Voicu via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 16 05:25:21 PDT 2024


================
@@ -251,6 +251,24 @@ SPIRV::MemorySemantics::MemorySemantics getMemSemantics(AtomicOrdering Ord) {
   llvm_unreachable(nullptr);
 }
 
+SPIRV::Scope::Scope getMemScope(const LLVMContext &Ctx, SyncScope::ID ID) {
+  SmallVector<StringRef> SSNs;
+  Ctx.getSyncScopeNames(SSNs);
+
+  StringRef MemScope = SSNs[ID];
+  if (MemScope.empty() || MemScope == "all_svm_devices")
----------------
AlexVlx wrote:

On consideration, I think I'm with @arsenm on this one, both `singlethread` and the empty string (system) have a defined meaning in LLVM, with all else being target specific. So, IMHO, for these we actually should think about LLVM's default, and how the target implements those, whilst for everything else we should defer to the target.

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


More information about the cfe-commits mailing list