Skip to content

Commit 3236473

Browse files
committed
[AMDGPU] Add mir test that demonstrates wrong SDWA selection
1 parent 5b23645 commit 3236473

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# RUN: llc -mtriple=amdgcn -mcpu=gfx1030 -run-pass=si-peephole-sdwa -o - %s | FileCheck -check-prefix=NOHAZARD %s
2+
3+
---
4+
name: sdwa_opsel_hazard
5+
body: |
6+
; NOHAZARD-LABEL: name: sdwa_opsel_hazard
7+
8+
; NOHAZARD: [[GLOBAL_LOAD_DWORD_SADDR:%[0-9]+]]:vgpr_32 = GLOBAL_LOAD_DWORD_SADDR killed %{{[0-9]+}}, %{{[0-9]+}}, 0, 0, implicit $exec
9+
; NOHAZARD: [[V_LSHLREV_B32_sdwa:%[0-9]+]]:vgpr_32 = V_LSHLREV_B32_sdwa 0, %{{[0-9]+}}, 0, undef [[GLOBAL_LOAD_DWORD_SADDR]], 0, 6, 0, 6, 5, implicit $exec
10+
bb.0:
11+
successors: %bb.2(0x40000000)
12+
%0:sreg_32 = IMPLICIT_DEF
13+
%1:sreg_64_xexec_xnull = IMPLICIT_DEF
14+
%2:vgpr_32 = IMPLICIT_DEF
15+
%3:vgpr_32 = GLOBAL_LOAD_DWORD_SADDR killed %1, %2, 0, 0, implicit $exec
16+
S_BRANCH %bb.2
17+
18+
bb.1:
19+
%5:vgpr_32 = V_AND_B32_e64 undef %6, 255, implicit $exec
20+
%7:vgpr_32 = V_LSHLREV_B32_e64 2, killed undef %5, implicit $exec
21+
S_ENDPGM 0
22+
23+
bb.2:
24+
successors: %bb.1(0x40000000)
25+
26+
%6:vgpr_32 = V_LSHRREV_B32_e64 16, undef %3, implicit $exec
27+
28+
S_BRANCH %bb.1
29+
30+
...
31+

0 commit comments

Comments
 (0)