[llvm] r375265 - AMDGPU: Fix SMEM WAR hazard for gfx10 readlane
Austin Kerbow via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 18 11:20:30 PDT 2019
Author: kerbowa
Date: Fri Oct 18 11:20:30 2019
New Revision: 375265
URL: http://llvm.org/viewvc/llvm-project?rev=375265&view=rev
Log:
AMDGPU: Fix SMEM WAR hazard for gfx10 readlane
Summary: Hazard recognizer fails to see hazard with V_READLANE_B32_gfx10.
Reviewers: rampitec
Reviewed By: rampitec
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69172
Modified:
llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
llvm/trunk/test/CodeGen/AMDGPU/smem-war-hazard.mir
Modified: llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp?rev=375265&r1=375264&r2=375265&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/GCNHazardRecognizer.cpp Fri Oct 18 11:20:30 2019
@@ -952,6 +952,7 @@ bool GCNHazardRecognizer::fixSMEMtoVecto
unsigned SDSTName;
switch (MI->getOpcode()) {
case AMDGPU::V_READLANE_B32:
+ case AMDGPU::V_READLANE_B32_gfx10:
case AMDGPU::V_READFIRSTLANE_B32:
SDSTName = AMDGPU::OpName::vdst;
break;
Modified: llvm/trunk/test/CodeGen/AMDGPU/smem-war-hazard.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/smem-war-hazard.mir?rev=375265&r1=375264&r2=375265&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/smem-war-hazard.mir (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/smem-war-hazard.mir Fri Oct 18 11:20:30 2019
@@ -304,6 +304,21 @@ body: |
S_ENDPGM 0
...
+# Workaround since spilling/restoring SGPRs use real opcodes.
+# GCN-LABEL: name: hazard_smem_war_readlane_gfx10
+# GCN: S_LOAD_DWORD_IMM
+# GCN: $sgpr_null = S_MOV_B32 0
+# GCN-NEXT: V_READLANE_B32_gfx10
+---
+name: hazard_smem_war_readlane_gfx10
+body: |
+ bb.0:
+ liveins: $sgpr0, $sgpr1, $sgpr3, $vgpr0
+ $sgpr2 = S_LOAD_DWORD_IMM $sgpr0_sgpr1, 0, 0, 0
+ $sgpr0 = V_READLANE_B32_gfx10 $vgpr0, $sgpr3
+ S_ENDPGM 0
+...
+
# GCN-LABEL: name: hazard_smem_war_readfirstlane
# GCN: S_LOAD_DWORD_IMM
# GCN: $sgpr_null = S_MOV_B32 0
More information about the llvm-commits
mailing list