[llvm] 4b89e8a - [AMDGPU] Temporarily disable FeatureBackOffBarrier for GFX11
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 11 10:00:04 PST 2023
Author: Jay Foad
Date: 2023-01-11T17:47:56Z
New Revision: 4b89e8adda02eb9a8ee412638a810424f246e958
URL: https://github.com/llvm/llvm-project/commit/4b89e8adda02eb9a8ee412638a810424f246e958
DIFF: https://github.com/llvm/llvm-project/commit/4b89e8adda02eb9a8ee412638a810424f246e958.diff
LOG: [AMDGPU] Temporarily disable FeatureBackOffBarrier for GFX11
Enabling this feature exposed some incorrect codegen, where a workgroup-
scope barrier fails to properly synchronise two waves from the same
workgroup running on different SIMDs of the same CU.
Disabling FeatureBackOffBarrier causes an s_waitcnt to be emitted before
the barrier which works around the problem.
Differential Revision: https://reviews.llvm.org/D141379
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPU.td
llvm/test/CodeGen/AMDGPU/back-off-barrier-subtarget-feature.ll
llvm/test/CodeGen/AMDGPU/waitcnt-preexisting-vscnt.mir
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td
index b076411f59eaa..73ec5670f6358 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPU.td
+++ b/llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -1312,7 +1312,6 @@ def FeatureISAVersion11_Common : FeatureSet<
FeaturePackedTID,
FeatureVcmpxPermlaneHazard,
FeatureVALUTransUseHazard,
- FeatureBackOffBarrier,
FeatureMADIntraFwdBug]>;
def FeatureISAVersion11_0_0 : FeatureSet<
diff --git a/llvm/test/CodeGen/AMDGPU/back-off-barrier-subtarget-feature.ll b/llvm/test/CodeGen/AMDGPU/back-off-barrier-subtarget-feature.ll
index 804aa8968c30d..d399e9219f09a 100644
--- a/llvm/test/CodeGen/AMDGPU/back-off-barrier-subtarget-feature.ll
+++ b/llvm/test/CodeGen/AMDGPU/back-off-barrier-subtarget-feature.ll
@@ -47,8 +47,8 @@ define void @back_off_barrier_no_fence(ptr %in, ptr %out) #0 {
; GFX11-BACKOFF-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX11-BACKOFF-NEXT: s_waitcnt_vscnt null, 0x0
; GFX11-BACKOFF-NEXT: flat_load_b32 v0, v[0:1]
-; GFX11-BACKOFF-NEXT: s_barrier
; GFX11-BACKOFF-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
+; GFX11-BACKOFF-NEXT: s_barrier
; GFX11-BACKOFF-NEXT: flat_store_b32 v[2:3], v0
; GFX11-BACKOFF-NEXT: s_waitcnt lgkmcnt(0)
; GFX11-BACKOFF-NEXT: s_waitcnt_vscnt null, 0x0
diff --git a/llvm/test/CodeGen/AMDGPU/waitcnt-preexisting-vscnt.mir b/llvm/test/CodeGen/AMDGPU/waitcnt-preexisting-vscnt.mir
index 04a6850944b5e..5f04e8cff880e 100644
--- a/llvm/test/CodeGen/AMDGPU/waitcnt-preexisting-vscnt.mir
+++ b/llvm/test/CodeGen/AMDGPU/waitcnt-preexisting-vscnt.mir
@@ -64,7 +64,7 @@ body: |
; GFX11-NEXT: S_WAITCNT 0
; GFX11-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
; GFX11-NEXT: GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
- ; GFX11-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 1
+ ; GFX11-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
; GFX11-NEXT: S_BARRIER
; GFX11-NEXT: $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
; GFX11-NEXT: S_WAITCNT 7
@@ -185,7 +185,7 @@ body: |
; GFX11-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
; GFX11-NEXT: GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
; GFX11-NEXT: S_WAITCNT 0
- ; GFX11-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 1
+ ; GFX11-NEXT: S_WAITCNT_VSCNT undef $sgpr_null, 0
; GFX11-NEXT: S_BARRIER
; GFX11-NEXT: $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
; GFX11-NEXT: S_WAITCNT 7
More information about the llvm-commits
mailing list