annotate llvm/test/CodeGen/AMDGPU/sdwa-ops.mir @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents 1d019706d866
children 5f17cb93ff66
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=si-peephole-sdwa -o - %s | FileCheck -check-prefix=GFX9 %s
anatofuz
parents:
diff changeset
2 # RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs -run-pass=si-peephole-sdwa -o - %s | FileCheck -check-prefix=GFX9 %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 # test for 3 consecutive _sdwa's
anatofuz
parents:
diff changeset
5 # GFX9-LABEL: name: test1_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
6 # GFX9: = nsw V_ADD_CO_U32_sdwa
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 # GFX9-NEXT: = nuw V_ADDC_U32_e32
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
8 # GFX9: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
9 # GFX9-NEXT: V_ADDC_U32_e32
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
10 # GFX9: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
11 # GFX9-NEXT: V_ADDC_U32_e32
anatofuz
parents:
diff changeset
12 ---
anatofuz
parents:
diff changeset
13 name: test1_add_co_sdwa
anatofuz
parents:
diff changeset
14 tracksRegLiveness: true
anatofuz
parents:
diff changeset
15 registers:
anatofuz
parents:
diff changeset
16 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
17 liveins:
anatofuz
parents:
diff changeset
18 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
19 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
20 body: |
anatofuz
parents:
diff changeset
21 bb.0:
anatofuz
parents:
diff changeset
22 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
25 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
26 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
27 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
anatofuz
parents:
diff changeset
28 %30:vreg_64 = COPY $sgpr0_sgpr1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
29 %63:vgpr_32, %65:sreg_64_xexec = nsw V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
30 %64:vgpr_32, dead %66:sreg_64_xexec = nuw V_ADDC_U32_e64 %30.sub1, %0, killed %65, 0, implicit $exec
150
anatofuz
parents:
diff changeset
31 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %64, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
32 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 %161:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
35 %163:vgpr_32, %165:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %161, 0, implicit $exec
150
anatofuz
parents:
diff changeset
36 %164:vgpr_32, dead %166:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, killed %165, 0, implicit $exec
anatofuz
parents:
diff changeset
37 %162:vreg_64 = REG_SEQUENCE %163, %subreg.sub0, %164, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
38 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %162, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 %171:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
41 %173:vgpr_32, %175:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %171, 0, implicit $exec
150
anatofuz
parents:
diff changeset
42 %174:vgpr_32, dead %176:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, killed %175, 0, implicit $exec
anatofuz
parents:
diff changeset
43 %172:vreg_64 = REG_SEQUENCE %173, %subreg.sub0, %174, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
44 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %172, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 ...
anatofuz
parents:
diff changeset
47
anatofuz
parents:
diff changeset
48 # test for VCC interference on sdwa, should generate 1 xform only
anatofuz
parents:
diff changeset
49 # GFX9-LABEL: name: test2_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
50 # GFX9: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
51 # GFX9: V_ADDC_U32_e32
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
52 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
53 # GFX9-NOT: V_ADDC_U32_e32
anatofuz
parents:
diff changeset
54 ---
anatofuz
parents:
diff changeset
55 name: test2_add_co_sdwa
anatofuz
parents:
diff changeset
56 tracksRegLiveness: true
anatofuz
parents:
diff changeset
57 registers:
anatofuz
parents:
diff changeset
58 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
59 liveins:
anatofuz
parents:
diff changeset
60 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
61 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
62 body: |
anatofuz
parents:
diff changeset
63 bb.0:
anatofuz
parents:
diff changeset
64 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
65
anatofuz
parents:
diff changeset
66 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
67 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
68 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
69 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
anatofuz
parents:
diff changeset
70 %30:vreg_64 = COPY $sgpr0_sgpr1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
71 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
72
anatofuz
parents:
diff changeset
73 %161:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
74 %163:vgpr_32, %165:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %161, 0, implicit $exec
150
anatofuz
parents:
diff changeset
75 %164:vgpr_32, dead %166:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, killed %165, 0, implicit $exec
anatofuz
parents:
diff changeset
76 %162:vreg_64 = REG_SEQUENCE %163, %subreg.sub0, %164, %subreg.sub1
anatofuz
parents:
diff changeset
77
anatofuz
parents:
diff changeset
78 %64:vgpr_32, dead %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, killed %65, 0, implicit $exec
anatofuz
parents:
diff changeset
79 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %64, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
80 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
81
anatofuz
parents:
diff changeset
82 %161:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
83 %163:vgpr_32, %165:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %161, 0, implicit $exec
150
anatofuz
parents:
diff changeset
84 %164:vgpr_32, dead %166:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, killed %165, 0, implicit $exec
anatofuz
parents:
diff changeset
85 %162:vreg_64 = REG_SEQUENCE %163, %subreg.sub0, %164, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
86 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %162, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
87
anatofuz
parents:
diff changeset
88 ...
anatofuz
parents:
diff changeset
89
anatofuz
parents:
diff changeset
90 # test for CarryOut used, should reject
anatofuz
parents:
diff changeset
91 # GFX9-LABEL: name: test3_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
92 # GFX9: V_ADD_CO_U32_e64
150
anatofuz
parents:
diff changeset
93 # GFX9: V_ADDC_U32_e64
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
94 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
95 # GFX9-NOT: V_ADDC_U32_e32
anatofuz
parents:
diff changeset
96 ---
anatofuz
parents:
diff changeset
97 name: test3_add_co_sdwa
anatofuz
parents:
diff changeset
98 tracksRegLiveness: true
anatofuz
parents:
diff changeset
99 registers:
anatofuz
parents:
diff changeset
100 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
101 liveins:
anatofuz
parents:
diff changeset
102 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
103 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
104 body: |
anatofuz
parents:
diff changeset
105 bb.0:
anatofuz
parents:
diff changeset
106 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
107
anatofuz
parents:
diff changeset
108 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
109 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
110 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
111 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
anatofuz
parents:
diff changeset
112 %30:vreg_64 = COPY $sgpr0_sgpr1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
113 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
114 %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, killed %65, 0, implicit $exec
anatofuz
parents:
diff changeset
115 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %66, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
116 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
117
anatofuz
parents:
diff changeset
118 ...
anatofuz
parents:
diff changeset
119
anatofuz
parents:
diff changeset
120 # test for CarryIn used more than once, should reject
anatofuz
parents:
diff changeset
121 # GFX9-LABEL: name: test4_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
122 # GFX9: V_ADD_CO_U32_e64
150
anatofuz
parents:
diff changeset
123 # GFX9: V_ADDC_U32_e64
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
124 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
125 # GFX9-NOT: V_ADDC_U32_e32
anatofuz
parents:
diff changeset
126 ---
anatofuz
parents:
diff changeset
127 name: test4_add_co_sdwa
anatofuz
parents:
diff changeset
128 tracksRegLiveness: true
anatofuz
parents:
diff changeset
129 registers:
anatofuz
parents:
diff changeset
130 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
131 liveins:
anatofuz
parents:
diff changeset
132 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
133 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
134 body: |
anatofuz
parents:
diff changeset
135 bb.0:
anatofuz
parents:
diff changeset
136 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
137
anatofuz
parents:
diff changeset
138 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
139 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
140 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
141 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
anatofuz
parents:
diff changeset
142 %30:vreg_64 = COPY $sgpr0_sgpr1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
143 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
144 %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, %65, 0, implicit $exec
anatofuz
parents:
diff changeset
145 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %65, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
146 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
147
anatofuz
parents:
diff changeset
148
anatofuz
parents:
diff changeset
149 ...
anatofuz
parents:
diff changeset
150
anatofuz
parents:
diff changeset
151 # test for simple example, should generate sdwa
anatofuz
parents:
diff changeset
152 # GFX9-LABEL: name: test5_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
153 # GFX9: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
154 # GFX9: V_ADDC_U32_e32
anatofuz
parents:
diff changeset
155 ---
anatofuz
parents:
diff changeset
156 name: test5_add_co_sdwa
anatofuz
parents:
diff changeset
157 tracksRegLiveness: true
anatofuz
parents:
diff changeset
158 registers:
anatofuz
parents:
diff changeset
159 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
160 liveins:
anatofuz
parents:
diff changeset
161 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
162 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
163 body: |
anatofuz
parents:
diff changeset
164 bb.0:
anatofuz
parents:
diff changeset
165 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
166
anatofuz
parents:
diff changeset
167 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
168 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
169 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
170 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
anatofuz
parents:
diff changeset
171 %30:vreg_64 = COPY $sgpr0_sgpr1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
172 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
173 %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, %65, 0, implicit $exec
anatofuz
parents:
diff changeset
174 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %64, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
175 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
176
anatofuz
parents:
diff changeset
177
anatofuz
parents:
diff changeset
178 ...
anatofuz
parents:
diff changeset
179
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
180 # test for V_ADD_CO_U32_e64 only, should reject
150
anatofuz
parents:
diff changeset
181 # GFX9-LABEL: name: test6_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
182 # GFX9: V_ADD_CO_U32_e64
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
183 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
184 # GFX9-NOT: V_ADDC_U32_e32
anatofuz
parents:
diff changeset
185 ---
anatofuz
parents:
diff changeset
186 name: test6_add_co_sdwa
anatofuz
parents:
diff changeset
187 tracksRegLiveness: true
anatofuz
parents:
diff changeset
188 registers:
anatofuz
parents:
diff changeset
189 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
190 liveins:
anatofuz
parents:
diff changeset
191 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
192 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
193 body: |
anatofuz
parents:
diff changeset
194 bb.0:
anatofuz
parents:
diff changeset
195 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
196
anatofuz
parents:
diff changeset
197 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
198 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
199 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
200 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
anatofuz
parents:
diff changeset
201 %30:vreg_64 = COPY $sgpr0_sgpr1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
202 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
203 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %23, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
204 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
205
anatofuz
parents:
diff changeset
206
anatofuz
parents:
diff changeset
207 ...
anatofuz
parents:
diff changeset
208
anatofuz
parents:
diff changeset
209 # test for V_ADDC_U32_e64 only, should reject
anatofuz
parents:
diff changeset
210 # GFX9-LABEL: name: test7_add_co_sdwa
anatofuz
parents:
diff changeset
211 # GFX9: V_ADDC_U32_e64
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
212 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
213 # GFX9-NOT: V_ADDC_U32_e32
anatofuz
parents:
diff changeset
214 ---
anatofuz
parents:
diff changeset
215 name: test7_add_co_sdwa
anatofuz
parents:
diff changeset
216 tracksRegLiveness: true
anatofuz
parents:
diff changeset
217 registers:
anatofuz
parents:
diff changeset
218 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
219 liveins:
anatofuz
parents:
diff changeset
220 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
221 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
222 body: |
anatofuz
parents:
diff changeset
223 bb.0:
anatofuz
parents:
diff changeset
224 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
225
anatofuz
parents:
diff changeset
226 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
227 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
228 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
229 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
anatofuz
parents:
diff changeset
230 %24:sreg_64_xexec = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
231
anatofuz
parents:
diff changeset
232 %30:vreg_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
233 %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, %24, 0, implicit $exec
anatofuz
parents:
diff changeset
234 %62:vreg_64 = REG_SEQUENCE %23, %subreg.sub0, %23, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
235 GLOBAL_STORE_DWORDX2_SADDR %30.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
236
anatofuz
parents:
diff changeset
237
anatofuz
parents:
diff changeset
238 ...
anatofuz
parents:
diff changeset
239
anatofuz
parents:
diff changeset
240 # test for $vcc defined between two adds, should not generate
anatofuz
parents:
diff changeset
241 # GFX9-LABEL: name: test8_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
242 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
243 # GFX9: V_ADDC_U32_e64
anatofuz
parents:
diff changeset
244 ---
anatofuz
parents:
diff changeset
245 name: test8_add_co_sdwa
anatofuz
parents:
diff changeset
246 tracksRegLiveness: true
anatofuz
parents:
diff changeset
247 registers:
anatofuz
parents:
diff changeset
248 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
249 liveins:
anatofuz
parents:
diff changeset
250 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
251 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
252 body: |
anatofuz
parents:
diff changeset
253 bb.0:
anatofuz
parents:
diff changeset
254 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
255
anatofuz
parents:
diff changeset
256 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
257 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
258 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
259 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
anatofuz
parents:
diff changeset
260 %30:vreg_64 = COPY $sgpr0_sgpr1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
261 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
262 $vcc = COPY %30
anatofuz
parents:
diff changeset
263 %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, %65, 0, implicit $exec
anatofuz
parents:
diff changeset
264 %31:vreg_64 = COPY $vcc
anatofuz
parents:
diff changeset
265 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %64, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
266 GLOBAL_STORE_DWORDX2_SADDR %31.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
267
anatofuz
parents:
diff changeset
268
anatofuz
parents:
diff changeset
269 ...
anatofuz
parents:
diff changeset
270
anatofuz
parents:
diff changeset
271 # test for non dead $vcc, should not generate
anatofuz
parents:
diff changeset
272 # GFX9-LABEL: name: test9_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
273 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
274 # GFX9: V_ADDC_U32_e64
anatofuz
parents:
diff changeset
275 ---
anatofuz
parents:
diff changeset
276 name: test9_add_co_sdwa
anatofuz
parents:
diff changeset
277 tracksRegLiveness: true
anatofuz
parents:
diff changeset
278 registers:
anatofuz
parents:
diff changeset
279 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
280 liveins:
anatofuz
parents:
diff changeset
281 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
282 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
283 body: |
anatofuz
parents:
diff changeset
284 bb.0:
anatofuz
parents:
diff changeset
285 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
286
anatofuz
parents:
diff changeset
287 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
288 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
289 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
290 %30:vreg_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
291 $vcc = COPY %30
anatofuz
parents:
diff changeset
292 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
293 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
294 %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, %65, 0, implicit $exec
anatofuz
parents:
diff changeset
295 %31:vreg_64 = COPY $vcc
anatofuz
parents:
diff changeset
296 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %64, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
297 GLOBAL_STORE_DWORDX2_SADDR %31.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
298
150
anatofuz
parents:
diff changeset
299
anatofuz
parents:
diff changeset
300 ...
anatofuz
parents:
diff changeset
301
anatofuz
parents:
diff changeset
302 # test for def $vcc_lo, should not generate
anatofuz
parents:
diff changeset
303 # GFX9-LABEL: name: test10_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
304 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
305 # GFX9: V_ADDC_U32_e64
anatofuz
parents:
diff changeset
306 ---
anatofuz
parents:
diff changeset
307 name: test10_add_co_sdwa
anatofuz
parents:
diff changeset
308 tracksRegLiveness: true
anatofuz
parents:
diff changeset
309 registers:
anatofuz
parents:
diff changeset
310 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
311 liveins:
anatofuz
parents:
diff changeset
312 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
313 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
314 body: |
anatofuz
parents:
diff changeset
315 bb.0:
anatofuz
parents:
diff changeset
316 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
317
anatofuz
parents:
diff changeset
318 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
319 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
320 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
321 %30:vreg_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
322 $vcc_lo = COPY %30.sub0
anatofuz
parents:
diff changeset
323 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
324 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
325 %31:vgpr_32 = COPY $vcc_lo
anatofuz
parents:
diff changeset
326 %32:vreg_64 = REG_SEQUENCE %31, %subreg.sub0, %23, %subreg.sub1
anatofuz
parents:
diff changeset
327 %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, %65, 0, implicit $exec
anatofuz
parents:
diff changeset
328 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %64, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
329 GLOBAL_STORE_DWORDX2_SADDR %32.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
330
anatofuz
parents:
diff changeset
331 ...
anatofuz
parents:
diff changeset
332
anatofuz
parents:
diff changeset
333 # test for read $vcc_hi, should not generate
anatofuz
parents:
diff changeset
334 # GFX9-LABEL: name: test11_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
335 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
336 # GFX9: V_ADDC_U32_e64
anatofuz
parents:
diff changeset
337 ---
anatofuz
parents:
diff changeset
338 name: test11_add_co_sdwa
anatofuz
parents:
diff changeset
339 tracksRegLiveness: true
anatofuz
parents:
diff changeset
340 registers:
anatofuz
parents:
diff changeset
341 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
342 liveins:
anatofuz
parents:
diff changeset
343 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
344 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
345 body: |
anatofuz
parents:
diff changeset
346 bb.0:
anatofuz
parents:
diff changeset
347 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
348
anatofuz
parents:
diff changeset
349 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
350 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
351 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
352 %30:vreg_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
353 $vcc_hi = COPY %30.sub0
anatofuz
parents:
diff changeset
354 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
355 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
356 %31:vgpr_32 = COPY $vcc_hi
anatofuz
parents:
diff changeset
357 %32:vreg_64 = REG_SEQUENCE %31, %subreg.sub0, %23, %subreg.sub1
anatofuz
parents:
diff changeset
358 %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, %65, 0, implicit $exec
anatofuz
parents:
diff changeset
359 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %64, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
360 GLOBAL_STORE_DWORDX2_SADDR %32.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
361
anatofuz
parents:
diff changeset
362 ...
anatofuz
parents:
diff changeset
363
anatofuz
parents:
diff changeset
364 # test for $vcc defined and used between adds, should not generate
anatofuz
parents:
diff changeset
365 # GFX9-LABEL: name: test12_add_co_sdwa
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
366 # GFX9-NOT: V_ADD_CO_U32_sdwa
150
anatofuz
parents:
diff changeset
367 # GFX9: V_ADDC_U32_e64
anatofuz
parents:
diff changeset
368 ---
anatofuz
parents:
diff changeset
369 name: test12_add_co_sdwa
anatofuz
parents:
diff changeset
370 tracksRegLiveness: true
anatofuz
parents:
diff changeset
371 registers:
anatofuz
parents:
diff changeset
372 - { id: 0, class: vgpr_32, preferred-register: '' }
anatofuz
parents:
diff changeset
373 liveins:
anatofuz
parents:
diff changeset
374 - { reg: '$vgpr0', virtual-reg: '%0' }
anatofuz
parents:
diff changeset
375 - { reg: '$sgpr0_sgpr1', virtual-reg: '%1' }
anatofuz
parents:
diff changeset
376 body: |
anatofuz
parents:
diff changeset
377 bb.0:
anatofuz
parents:
diff changeset
378 liveins: $vgpr0, $sgpr0_sgpr1
anatofuz
parents:
diff changeset
379
anatofuz
parents:
diff changeset
380 %1:sgpr_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
381 %0:vgpr_32 = COPY $vgpr0
anatofuz
parents:
diff changeset
382 %22:sreg_32_xm0 = S_MOV_B32 255
anatofuz
parents:
diff changeset
383 %30:vreg_64 = COPY $sgpr0_sgpr1
anatofuz
parents:
diff changeset
384 %23:vgpr_32 = V_AND_B32_e32 %22, %0, implicit $exec
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
385 %63:vgpr_32, %65:sreg_64_xexec = V_ADD_CO_U32_e64 %30.sub0, %23, 0, implicit $exec
150
anatofuz
parents:
diff changeset
386 $vcc = COPY %30
anatofuz
parents:
diff changeset
387 %31:vreg_64 = COPY killed $vcc
anatofuz
parents:
diff changeset
388 %64:vgpr_32, %66:sreg_64_xexec = V_ADDC_U32_e64 %30.sub1, %0, %65, 0, implicit $exec
anatofuz
parents:
diff changeset
389 %62:vreg_64 = REG_SEQUENCE %63, %subreg.sub0, %64, %subreg.sub1
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
390 GLOBAL_STORE_DWORDX2_SADDR %31.sub0, %62, %1, 0, 0, implicit $exec, implicit $exec :: (store 8)
150
anatofuz
parents:
diff changeset
391