1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer %s -o - | FileCheck %s
5 name: cttz_zero_undef_s32_s32
10 ; CHECK-LABEL: name: cttz_zero_undef_s32_s32
11 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s32)
13 ; CHECK-NEXT: $vgpr0 = COPY [[CTTZ_ZERO_UNDEF]](s32)
14 %0:_(s32) = COPY $vgpr0
15 %1:_(s32) = G_CTTZ_ZERO_UNDEF %0
20 name: cttz_zero_undef_s32_s64
25 ; CHECK-LABEL: name: cttz_zero_undef_s32_s64
26 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
27 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s64)
28 ; CHECK-NEXT: $vgpr0 = COPY [[CTTZ_ZERO_UNDEF]](s32)
29 %0:_(s64) = COPY $vgpr0_vgpr1
30 %1:_(s32) = G_CTTZ_ZERO_UNDEF %0
35 name: cttz_zero_undef_s64_s64
40 ; CHECK-LABEL: name: cttz_zero_undef_s64_s64
41 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
42 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s64)
43 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[CTTZ_ZERO_UNDEF]](s32)
44 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
45 %0:_(s64) = COPY $vgpr0_vgpr1
46 %1:_(s64) = G_CTTZ_ZERO_UNDEF %0
47 $vgpr0_vgpr1 = COPY %1
51 name: cttz_zero_undef_s16_s32
56 ; CHECK-LABEL: name: cttz_zero_undef_s16_s32
57 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
58 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s32)
59 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
60 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[CTTZ_ZERO_UNDEF]], [[C]]
61 ; CHECK-NEXT: $vgpr0 = COPY [[AND]](s32)
62 %0:_(s32) = COPY $vgpr0
63 %1:_(s16) = G_CTTZ_ZERO_UNDEF %0
69 name: cttz_zero_undef_s16_s16
74 ; CHECK-LABEL: name: cttz_zero_undef_s16_s16
75 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
76 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s32)
77 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[CTTZ_ZERO_UNDEF]](s32)
78 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
79 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
80 ; CHECK-NEXT: $vgpr0 = COPY [[AND]](s32)
81 %0:_(s32) = COPY $vgpr0
82 %1:_(s16) = G_TRUNC %0
83 %2:_(s16) = G_CTTZ_ZERO_UNDEF %1
89 name: cttz_zero_undef_v2s32_v2s32
94 ; CHECK-LABEL: name: cttz_zero_undef_v2s32_v2s32
95 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
96 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
97 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[UV]](s32)
98 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF1:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[UV1]](s32)
99 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[CTTZ_ZERO_UNDEF]](s32), [[CTTZ_ZERO_UNDEF1]](s32)
100 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
101 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
102 %1:_(<2 x s32>) = G_CTTZ_ZERO_UNDEF %0
103 $vgpr0_vgpr1 = COPY %1
107 name: cttz_zero_undef_v2s32_v2s64
111 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
112 ; CHECK-LABEL: name: cttz_zero_undef_v2s32_v2s64
113 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
114 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
115 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[UV]](s64)
116 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF1:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[UV1]](s64)
117 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[CTTZ_ZERO_UNDEF]](s32), [[CTTZ_ZERO_UNDEF1]](s32)
118 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
119 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
120 %1:_(<2 x s32>) = G_CTTZ_ZERO_UNDEF %0
121 $vgpr0_vgpr1 = COPY %1
125 name: cttz_zero_undef_v2s16_v2s16
130 ; CHECK-LABEL: name: cttz_zero_undef_v2s16_v2s16
131 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
132 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
133 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
134 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
135 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[BITCAST]](s32)
136 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[CTTZ_ZERO_UNDEF]](s32)
137 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF1:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[LSHR]](s32)
138 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[CTTZ_ZERO_UNDEF1]](s32)
139 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
140 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
141 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
142 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32)
143 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
144 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
145 ; CHECK-NEXT: $vgpr0 = COPY [[BITCAST1]](<2 x s16>)
146 %0:_(<2 x s16>) = COPY $vgpr0
147 %1:_(<2 x s16>) = G_CTTZ_ZERO_UNDEF %0
152 name: cttz_zero_undef_s7_s7
158 ; CHECK-LABEL: name: cttz_zero_undef_s7_s7
159 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
160 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s32)
161 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[CTTZ_ZERO_UNDEF]](s32)
162 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 127
163 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
164 ; CHECK-NEXT: $vgpr0 = COPY [[AND]](s32)
165 %0:_(s32) = COPY $vgpr0
166 %1:_(s7) = G_TRUNC %0
167 %2:_(s7) = G_CTTZ_ZERO_UNDEF %1
168 %3:_(s32) = G_ZEXT %2
173 name: cttz_zero_undef_s33_s33
177 liveins: $vgpr0_vgpr1
179 ; CHECK-LABEL: name: cttz_zero_undef_s33_s33
180 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
181 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s64)
182 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[CTTZ_ZERO_UNDEF]](s32)
183 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295
184 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ZEXT]], [[C]]
185 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[AND]](s64)
186 %0:_(s64) = COPY $vgpr0_vgpr1
187 %1:_(s33) = G_TRUNC %0
188 %2:_(s33) = G_CTTZ_ZERO_UNDEF %1
189 %3:_(s64) = G_ANYEXT %2
190 $vgpr0_vgpr1 = COPY %3