[PATCH] D42257: AMDGPU/MemoryModel: Fix monotonic atomic loads
Konstantin Zhuravlyov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 18 11:44:24 PST 2018
kzhuravl created this revision.
kzhuravl added reviewers: b-sumner, t-tye.
Herald added subscribers: tpr, dstuttard, yaxunl, nhaehnle, wdng, arsenm.
Those should have glc bit set for system and agent synchronization scopes
https://reviews.llvm.org/D42257
Files:
lib/Target/AMDGPU/SIMemoryLegalizer.cpp
test/CodeGen/AMDGPU/memory-legalizer-load.ll
Index: test/CodeGen/AMDGPU/memory-legalizer-load.ll
===================================================================
--- test/CodeGen/AMDGPU/memory-legalizer-load.ll
+++ test/CodeGen/AMDGPU/memory-legalizer-load.ll
@@ -21,7 +21,7 @@
; GCN-LABEL: {{^}}system_monotonic
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
-; GCN: flat_load_dword [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
+; GCN: flat_load_dword [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}] glc{{$}}
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
; GCN-NOT: buffer_wbinvl1_vol
; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
@@ -133,7 +133,7 @@
; GCN-LABEL: {{^}}agent_monotonic
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
-; GCN: flat_load_dword [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}]{{$}}
+; GCN: flat_load_dword [[RET:v[0-9]+]], v[{{[0-9]+}}:{{[0-9]+}}] glc{{$}}
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
; GCN-NOT: buffer_wbinvl1_vol
; GCN: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, [[RET]]
Index: lib/Target/AMDGPU/SIMemoryLegalizer.cpp
===================================================================
--- lib/Target/AMDGPU/SIMemoryLegalizer.cpp
+++ lib/Target/AMDGPU/SIMemoryLegalizer.cpp
@@ -398,7 +398,8 @@
if (MOI.isAtomic()) {
if (MOI.getSSID() == SyncScope::System ||
MOI.getSSID() == MMI->getAgentSSID()) {
- if (MOI.getOrdering() == AtomicOrdering::Acquire ||
+ if (MOI.getOrdering() == AtomicOrdering::Monotonic ||
+ MOI.getOrdering() == AtomicOrdering::Acquire ||
MOI.getOrdering() == AtomicOrdering::SequentiallyConsistent)
Changed |= enableGLCBit(MI);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42257.130469.patch
Type: text/x-patch
Size: 1626 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180118/5e42f809/attachment.bin>
More information about the llvm-commits
mailing list