Skip to content

Commit f4950f6

Browse files
authored
AMDGPU: Add missing verifier tests for load/store AGPR case (#155815)
1 parent 1ec0688 commit f4950f6

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# RUN: not --crash llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx90a -run-pass=none -filetype=null %s 2>&1 | FileCheck -implicit-check-not=Bad %s
2+
3+
---
4+
name: invalid_mixed_agpr_vgpr_ops_ds_atomic
5+
tracksRegLiveness: true
6+
body: |
7+
bb.0:
8+
9+
%addr:vgpr_32 = IMPLICIT_DEF
10+
%vgpr:vgpr_32 = IMPLICIT_DEF
11+
%agpr:agpr_32 = IMPLICIT_DEF
12+
%a_or_v:av_32 = IMPLICIT_DEF
13+
14+
; CHECK: Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR
15+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
16+
%4:agpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %vgpr, %vgpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
17+
18+
; CHECK: Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR
19+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
20+
%5:vgpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %agpr, %vgpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
21+
22+
; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
23+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
24+
%6:vgpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %vgpr, %agpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
25+
26+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
27+
%7:av_32 = DS_CMPST_RTN_B32_gfx9 %addr, %vgpr, %vgpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
28+
29+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
30+
%8:vgpr_32 = DS_CMPST_RTN_B32_gfx9 %vgpr, %a_or_v, %vgpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
31+
32+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
33+
%9:vgpr_32 = DS_CMPST_RTN_B32_gfx9 %vgpr, %vgpr, %a_or_v, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
34+
35+
; CHECK: *** Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR ***
36+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
37+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
38+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
39+
%10:av_32 = DS_CMPST_RTN_B32_gfx9 %addr, %agpr, %agpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
40+
41+
; CHECK: *** Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR ***
42+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
43+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
44+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
45+
%11:agpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %a_or_v, %agpr, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
46+
47+
; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
48+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
49+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
50+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
51+
%12:agpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %agpr, %a_or_v, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
52+
53+
; CHECK: *** Bad machine code: Invalid register class: vdata and vdst should be both VGPR or AGPR ***
54+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
55+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
56+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
57+
%13:agpr_32 = DS_CMPST_RTN_B32_gfx9 %addr, %a_or_v, %a_or_v, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
58+
59+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
60+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
61+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
62+
%14:av_32 = DS_CMPST_RTN_B32_gfx9 %addr, %a_or_v, %a_or_v, 0, 0, implicit $exec :: (load store seq_cst monotonic (s32), addrspace 3)
63+
64+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
65+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
66+
DS_WRITE2_B32_gfx9 %addr, %a_or_v, %a_or_v, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
67+
68+
; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
69+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
70+
DS_WRITE2_B32_gfx9 %addr, %agpr, %vgpr, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
71+
72+
; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
73+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
74+
DS_WRITE2_B32_gfx9 %addr, %vgpr, %agpr, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
75+
76+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
77+
DS_WRITE2_B32_gfx9 %addr, %vgpr, %a_or_v, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
78+
79+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
80+
DS_WRITE2_B32_gfx9 %addr, %a_or_v, %vgpr, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
81+
82+
; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
83+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
84+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
85+
DS_WRITE2_B32_gfx9 %addr, %agpr, %a_or_v, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
86+
87+
; CHECK: *** Bad machine code: Invalid register class: both data operands should be VGPR or AGPR ***
88+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
89+
; CHECK: *** Bad machine code: Illegal virtual register for instruction ***
90+
DS_WRITE2_B32_gfx9 %addr, %a_or_v, %agpr, 10, 24, 0, implicit $exec :: (store (s32), addrspace 3), (store (s32), addrspace 3)
91+
92+
...

0 commit comments

Comments
 (0)