[llvm] r366314 - AMDGPU/GFX10: Apply the VMEM-to-scalar-write hazard also to writes to EXEC
Nicolai Haehnle via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 17 04:22:57 PDT 2019
Author: nha
Date: Wed Jul 17 04:22:57 2019
New Revision: 366314
URL: http://llvm.org/viewvc/llvm-project?rev=366314&view=rev
Log:
AMDGPU/GFX10: Apply the VMEM-to-scalar-write hazard also to writes to EXEC
Summary: Change-Id: I854fbf7d48e937bef9f8f3f5d0c8aeb970652630
Reviewers: rampitec, mareko
Subscribers: arsenm, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64807
Change-Id: I4405b3a7f84186acea5a78d291bff71056e745fc
Modified:
llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.end.cf.i32.ll
llvm/trunk/test/CodeGen/AMDGPU/vmem-to-salu-hazard.mir
llvm/trunk/test/CodeGen/AMDGPU/wave32.ll
Modified: llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp?rev=366314&r1=366313&r2=366314&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp Wed Jul 17 04:22:57 2019
@@ -920,7 +920,7 @@ bool GCNHazardRecognizer::fixVMEMtoScala
for (const MachineOperand &Def : MI->defs()) {
MachineOperand *Op = I->findRegisterUseOperand(Def.getReg(), false, TRI);
- if (!Op || (Op->isImplicit() && Op->getReg() == AMDGPU::EXEC))
+ if (!Op)
continue;
return true;
}
Modified: llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.end.cf.i32.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.end.cf.i32.ll?rev=366314&r1=366313&r2=366314&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.end.cf.i32.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.end.cf.i32.ll Wed Jul 17 04:22:57 2019
@@ -14,6 +14,7 @@ define amdgpu_kernel void @test_wave32(i
; GCN-NEXT: v_mov_b32_e32 v0, 0
; GCN-NEXT: global_store_dword v[0:1], v0, off
; GCN-NEXT: BB0_2: ; %bb
+; GCN-NEXT: v_nop
; GCN-NEXT: s_or_b32 exec_lo, exec_lo, s0
; GCN-NEXT: v_mov_b32_e32 v0, 0
; GCN-NEXT: global_store_dword v[0:1], v0, off
Modified: llvm/trunk/test/CodeGen/AMDGPU/vmem-to-salu-hazard.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/vmem-to-salu-hazard.mir?rev=366314&r1=366313&r2=366314&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/vmem-to-salu-hazard.mir (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/vmem-to-salu-hazard.mir Wed Jul 17 04:22:57 2019
@@ -92,6 +92,7 @@ body: |
...
# GCN-LABEL: name: vmem_write_exec_impread
# GCN: BUFFER_LOAD_DWORD_OFFEN
+# GCN: V_NOP
# GCN-NEXT: S_MOV_B64
---
name: vmem_write_exec_impread
@@ -208,3 +209,16 @@ body: |
$vgpr1 = BUFFER_LOAD_DWORD_OFFEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, 0, 0, implicit $exec
S_BRANCH %bb.0
...
+# GCN-LABEL: name: ds_write_exec
+# GCN: DS_WRITE_B32_gfx9
+# GCN-NEXT: V_NOP
+# GCN-NEXT: S_MOV_B32
+---
+name: ds_write_exec
+body: |
+ bb.0:
+ $vgpr0 = IMPLICIT_DEF
+ $vgpr1 = IMPLICIT_DEF
+ DS_WRITE_B32_gfx9 $vgpr0, $vgpr1, 0, 0, implicit $exec
+ $exec_lo = S_MOV_B32 -1
+...
Modified: llvm/trunk/test/CodeGen/AMDGPU/wave32.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/wave32.ll?rev=366314&r1=366313&r2=366314&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/wave32.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/wave32.ll Wed Jul 17 04:22:57 2019
@@ -1073,6 +1073,7 @@ declare void @external_void_func_void()
; GFX1064-NEXT: s_or_saveexec_b64 [[COPY_EXEC0:s\[[0-9]+:[0-9]+\]]], -1{{$}}
; GFX1032-NEXT: s_or_saveexec_b32 [[COPY_EXEC0:s[0-9]]], -1{{$}}
; GCN-NEXT: buffer_store_dword v32, off, s[0:3], s32 ; 4-byte Folded Spill
+; GCN-NEXT: v_nop
; GFX1064-NEXT: s_mov_b64 exec, [[COPY_EXEC0]]
; GFX1032-NEXT: s_mov_b32 exec_lo, [[COPY_EXEC0]]
@@ -1095,6 +1096,7 @@ declare void @external_void_func_void()
; GFX1064: s_or_saveexec_b64 [[COPY_EXEC1:s\[[0-9]+:[0-9]+\]]], -1{{$}}
; GFX1032: s_or_saveexec_b32 [[COPY_EXEC1:s[0-9]]], -1{{$}}
; GCN-NEXT: buffer_load_dword v32, off, s[0:3], s32 ; 4-byte Folded Reload
+; GCN-NEXT: v_nop
; GFX1064-NEXT: s_mov_b64 exec, [[COPY_EXEC1]]
; GFX1032-NEXT: s_mov_b32 exec_lo, [[COPY_EXEC1]]
; GCN-NEXT: s_waitcnt vmcnt(0)
More information about the llvm-commits
mailing list