1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=regbankselect -verify-machineinstrs -regbankselect-fast -o - %s | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=regbankselect -verify-machineinstrs -regbankselect-greedy -o - %s | FileCheck %s
11 liveins: $sgpr0, $sgpr1
13 ; CHECK-LABEL: name: umax_s32_ss
14 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
15 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
16 ; CHECK: [[UMAX:%[0-9]+]]:sgpr(s32) = G_UMAX [[COPY]], [[COPY1]]
17 ; CHECK: $sgpr0 = COPY [[UMAX]](s32)
18 %0:_(s32) = COPY $sgpr0
19 %1:_(s32) = COPY $sgpr1
20 %2:_(s32) = G_UMAX %0, %1
30 liveins: $sgpr0, $vgpr0
32 ; CHECK-LABEL: name: umax_s32_sv
33 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
34 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
35 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
36 ; CHECK: [[UMAX:%[0-9]+]]:vgpr(s32) = G_UMAX [[COPY2]], [[COPY1]]
37 ; CHECK: $vgpr0 = COPY [[UMAX]](s32)
38 %0:_(s32) = COPY $sgpr0
39 %1:_(s32) = COPY $vgpr0
40 %2:_(s32) = G_UMAX %0, %1
50 liveins: $sgpr0, $vgpr0
52 ; CHECK-LABEL: name: umax_s32_vs
53 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
54 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
55 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
56 ; CHECK: [[UMAX:%[0-9]+]]:vgpr(s32) = G_UMAX [[COPY]], [[COPY2]]
57 ; CHECK: $vgpr0 = COPY [[UMAX]](s32)
58 %0:_(s32) = COPY $vgpr0
59 %1:_(s32) = COPY $sgpr0
60 %2:_(s32) = G_UMAX %0, %1
70 liveins: $vgpr0, $vgpr1
72 ; CHECK-LABEL: name: umax_s32_vv
73 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
74 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
75 ; CHECK: [[UMAX:%[0-9]+]]:vgpr(s32) = G_UMAX [[COPY]], [[COPY1]]
76 ; CHECK: $vgpr0 = COPY [[UMAX]](s32)
77 %0:_(s32) = COPY $vgpr0
78 %1:_(s32) = COPY $vgpr1
79 %2:_(s32) = G_UMAX %0, %1
83 # FIXME: This should use VGPR instruction
85 name: umax_s32_ss_vgpr_use
90 liveins: $sgpr0, $sgpr1
92 ; CHECK-LABEL: name: umax_s32_ss_vgpr_use
93 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
94 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
95 ; CHECK: [[UMAX:%[0-9]+]]:sgpr(s32) = G_UMAX [[COPY]], [[COPY1]]
96 ; CHECK: $vgpr0 = COPY [[UMAX]](s32)
97 %0:_(s32) = COPY $sgpr0
98 %1:_(s32) = COPY $sgpr1
99 %2:_(s32) = G_UMAX %0, %1
109 liveins: $sgpr0, $sgpr1
111 ; CHECK-LABEL: name: umax_s16_ss
112 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
113 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
114 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
115 ; CHECK: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
116 ; CHECK: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s16)
117 ; CHECK: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s16)
118 ; CHECK: [[UMAX:%[0-9]+]]:sgpr(s32) = G_UMAX [[ZEXT]], [[ZEXT1]]
119 ; CHECK: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[UMAX]](s32)
120 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s16)
121 ; CHECK: $sgpr0 = COPY [[ANYEXT]](s32)
122 %0:_(s32) = COPY $sgpr0
123 %1:_(s32) = COPY $sgpr1
124 %2:_(s16) = G_TRUNC %0
125 %3:_(s16) = G_TRUNC %1
126 %4:_(s16) = G_UMAX %2, %3
127 %5:_(s32) = G_ANYEXT %4
133 name: umax_s16_ss_vgpr_use
138 liveins: $sgpr0, $sgpr1
140 ; CHECK-LABEL: name: umax_s16_ss_vgpr_use
141 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
142 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
143 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
144 ; CHECK: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
145 ; CHECK: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s16)
146 ; CHECK: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s16)
147 ; CHECK: [[UMAX:%[0-9]+]]:sgpr(s32) = G_UMAX [[ZEXT]], [[ZEXT1]]
148 ; CHECK: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[UMAX]](s32)
149 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC2]](s16)
150 ; CHECK: $vgpr0 = COPY [[ANYEXT]](s32)
151 %0:_(s32) = COPY $sgpr0
152 %1:_(s32) = COPY $sgpr1
153 %2:_(s16) = G_TRUNC %0
154 %3:_(s16) = G_TRUNC %1
155 %4:_(s16) = G_UMAX %2, %3
156 %5:_(s32) = G_ANYEXT %4
167 liveins: $sgpr0, $sgpr1
169 ; CHECK-LABEL: name: umax_v2s16_ss
170 ; CHECK: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
171 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
172 ; CHECK: [[BITCAST:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY]](<2 x s16>)
173 ; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
174 ; CHECK: [[LSHR:%[0-9]+]]:sgpr(s32) = G_LSHR [[BITCAST]], [[C]](s32)
175 ; CHECK: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
176 ; CHECK: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[BITCAST]], [[C1]]
177 ; CHECK: [[BITCAST1:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY1]](<2 x s16>)
178 ; CHECK: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
179 ; CHECK: [[LSHR1:%[0-9]+]]:sgpr(s32) = G_LSHR [[BITCAST1]], [[C2]](s32)
180 ; CHECK: [[C3:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
181 ; CHECK: [[AND1:%[0-9]+]]:sgpr(s32) = G_AND [[BITCAST1]], [[C3]]
182 ; CHECK: [[UMAX:%[0-9]+]]:sgpr(s32) = G_UMAX [[AND]], [[AND1]]
183 ; CHECK: [[UMAX1:%[0-9]+]]:sgpr(s32) = G_UMAX [[LSHR]], [[LSHR1]]
184 ; CHECK: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:sgpr(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[UMAX]](s32), [[UMAX1]](s32)
185 ; CHECK: $sgpr0 = COPY [[BUILD_VECTOR_TRUNC]](<2 x s16>)
186 %0:_(<2 x s16>) = COPY $sgpr0
187 %1:_(<2 x s16>) = COPY $sgpr1
188 %2:_(<2 x s16>) = G_UMAX %0, %1
198 liveins: $sgpr0, $vgpr0
200 ; CHECK-LABEL: name: umax_v2s16_sv
201 ; CHECK: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
202 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
203 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY]](<2 x s16>)
204 ; CHECK: [[UMAX:%[0-9]+]]:vgpr(<2 x s16>) = G_UMAX [[COPY2]], [[COPY1]]
205 ; CHECK: $vgpr0 = COPY [[UMAX]](<2 x s16>)
206 %0:_(<2 x s16>) = COPY $sgpr0
207 %1:_(<2 x s16>) = COPY $vgpr0
208 %2:_(<2 x s16>) = G_UMAX %0, %1
218 liveins: $sgpr0, $vgpr0
220 ; CHECK-LABEL: name: umax_v2s16_vs
221 ; CHECK: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
222 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
223 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY1]](<2 x s16>)
224 ; CHECK: [[UMAX:%[0-9]+]]:vgpr(<2 x s16>) = G_UMAX [[COPY]], [[COPY2]]
225 ; CHECK: $vgpr0 = COPY [[UMAX]](<2 x s16>)
226 %0:_(<2 x s16>) = COPY $vgpr0
227 %1:_(<2 x s16>) = COPY $sgpr0
228 %2:_(<2 x s16>) = G_UMAX %0, %1
238 liveins: $vgpr0, $vgpr1
240 ; CHECK-LABEL: name: umax_v2s16_vv
241 ; CHECK: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
242 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
243 ; CHECK: [[UMAX:%[0-9]+]]:vgpr(<2 x s16>) = G_UMAX [[COPY]], [[COPY1]]
244 ; CHECK: $vgpr0 = COPY [[UMAX]](<2 x s16>)
245 %0:_(<2 x s16>) = COPY $vgpr0
246 %1:_(<2 x s16>) = COPY $vgpr1
247 %2:_(<2 x s16>) = G_UMAX %0, %1