================
@@ -493,55 +491,40 @@
AMDGPUTargetCodeGenInfo::getGlobalVarAddressSpace(CodeGenModule &CGM,
return DefaultGlobalAS;
}
-llvm::SyncScope::ID
-AMDGPUTargetCodeGenInfo::getLLVMSyncScopeID(const LangOptions &LangOpts,
- SyncScope Scope,
- llvm::AtomicOrdering Ordering,
- llvm::LLVMContext &Ctx) const {
- std::string Name;
+StringRef AMDGPUTargetCodeGenInfo::getLLVMSyncScopeStr(
+ const LangOptions &LangOpts, SyncScope Scope,
+ llvm::AtomicOrdering Ordering) const {
+
+ // OpenCL assumes by default that atomic scopes are per-address space for
+ // non-sequentially consistent operations.
+ bool IsOneAs = (Scope >= SyncScope::OpenCLWorkGroup &&
+ Scope <= SyncScope::OpenCLSubGroup &&
+ Ordering != llvm::AtomicOrdering::SequentiallyConsistent);
+
switch (Scope) {
case SyncScope::HIPSingleThread:
case SyncScope::SingleScope:
- Name = "singlethread";
- break;
+ return IsOneAs ? "singlethread-one-as" : "singlethread";
case SyncScope::HIPWavefront:
case SyncScope::OpenCLSubGroup:
case SyncScope::WavefrontScope:
- Name = "wavefront";
- break;
+ return IsOneAs ? "wavefront-one-as" : "wavefront";
case SyncScope::HIPCluster:
case SyncScope::ClusterScope:
- Name = "cluster";
- break;
+ return IsOneAs ? "cluster-one-as" : "cluster";
----------------
Pierre-vh wrote:
I'm not sure I understand. Can you elaborate on what kind of issue that causes ?
https://github.com/llvm/llvm-project/pull/177343
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits