Skip to content

Commit c4b2b16

Browse files
committed
Use the scope instead of the language
1 parent c1c5d1e commit c4b2b16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/CodeGen/Targets/AMDGPU.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,10 @@ AMDGPUTargetCodeGenInfo::getLLVMSyncScopeID(const LangOptions &LangOpts,
537537
break;
538538
}
539539

540-
if (LangOpts.OpenCL &&
540+
// OpenCL assumes by default that atomic scopes are per-address space for
541+
// non-sequentially consistent operations.
542+
if (Scope >= SyncScope::OpenCLWorkGroup &&
543+
Scope <= SyncScope::OpenCLSubGroup &&
541544
Ordering != llvm::AtomicOrdering::SequentiallyConsistent) {
542545
if (!Name.empty())
543546
Name = Twine(Twine(Name) + Twine("-")).str();

0 commit comments

Comments
 (0)