Skip to content

Commit 42b0884

Browse files
authored
[AMDGPU] Handle V_PERMLANE64_B32 in fixVcmpxPermlaneHazards (#79125)
Fixes #78856
1 parent 82f424f commit 42b0884

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ static bool isSendMsgTraceDataOrGDS(const SIInstrInfo &TII,
163163
static bool isPermlane(const MachineInstr &MI) {
164164
unsigned Opcode = MI.getOpcode();
165165
return Opcode == AMDGPU::V_PERMLANE16_B32_e64 ||
166+
Opcode == AMDGPU::V_PERMLANE64_B32 ||
166167
Opcode == AMDGPU::V_PERMLANEX16_B32_e64 ||
167168
Opcode == AMDGPU::V_PERMLANE16_VAR_B32_e64 ||
168169
Opcode == AMDGPU::V_PERMLANEX16_VAR_B32_e64;

llvm/test/CodeGen/AMDGPU/vcmpx-permlane-hazard.mir

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,26 @@ body: |
168168
$vgpr1 = V_PERMLANE16_B32_e64 0, killed $vgpr1, 0, killed $sgpr1, 0, killed $sgpr0, $vgpr1, 0, implicit $exec
169169
S_ENDPGM 0
170170
...
171+
172+
# GCN-LABEL: name: hazard_vcmpx_permlane64
173+
# GCN: V_CMPX_LE_F32_nosdst_e32
174+
# GCN: S_ADD_U32
175+
# GCN-NEXT: $vgpr1 = V_MOV_B32_e32 killed $vgpr1, implicit $exec
176+
# GCN-NEXT: V_PERMLANE64_B32
177+
---
178+
name: hazard_vcmpx_permlane64
179+
body: |
180+
bb.0:
181+
successors: %bb.1
182+
$vgpr0 = V_MOV_B32_e32 0, implicit $exec
183+
V_CMPX_LE_F32_nosdst_e32 0, $vgpr0, implicit-def $exec, implicit $mode, implicit $exec
184+
S_BRANCH %bb.1
185+
186+
bb.1:
187+
$vgpr1 = IMPLICIT_DEF
188+
$vgpr2 = IMPLICIT_DEF
189+
$sgpr0 = IMPLICIT_DEF
190+
$sgpr1 = S_ADD_U32 $sgpr0, 0, implicit-def $scc
191+
$vgpr1 = V_PERMLANE64_B32 killed $vgpr1, implicit $exec
192+
S_ENDPGM 0
193+
...

0 commit comments

Comments
 (0)