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: liveins: $vgpr0
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
14 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s32)
15 ; CHECK-NEXT: $vgpr0 = COPY [[CTTZ_ZERO_UNDEF]](s32)
16 %0:_(s32) = COPY $vgpr0
17 %1:_(s32) = G_CTTZ_ZERO_UNDEF %0
22 name: cttz_zero_undef_s32_s64
27 ; CHECK-LABEL: name: cttz_zero_undef_s32_s64
28 ; CHECK: liveins: $vgpr0_vgpr1
30 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
31 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s64)
32 ; CHECK-NEXT: $vgpr0 = COPY [[CTTZ_ZERO_UNDEF]](s32)
33 %0:_(s64) = COPY $vgpr0_vgpr1
34 %1:_(s32) = G_CTTZ_ZERO_UNDEF %0
39 name: cttz_zero_undef_s64_s64
44 ; CHECK-LABEL: name: cttz_zero_undef_s64_s64
45 ; CHECK: liveins: $vgpr0_vgpr1
47 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
48 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s64)
49 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[CTTZ_ZERO_UNDEF]](s32)
50 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
51 %0:_(s64) = COPY $vgpr0_vgpr1
52 %1:_(s64) = G_CTTZ_ZERO_UNDEF %0
53 $vgpr0_vgpr1 = COPY %1
57 name: cttz_zero_undef_s16_s32
62 ; CHECK-LABEL: name: cttz_zero_undef_s16_s32
63 ; CHECK: liveins: $vgpr0
65 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
66 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s32)
67 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
68 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[CTTZ_ZERO_UNDEF]], [[C]]
69 ; CHECK-NEXT: $vgpr0 = COPY [[AND]](s32)
70 %0:_(s32) = COPY $vgpr0
71 %1:_(s16) = G_CTTZ_ZERO_UNDEF %0
77 name: cttz_zero_undef_s16_s16
82 ; CHECK-LABEL: name: cttz_zero_undef_s16_s16
83 ; CHECK: liveins: $vgpr0
85 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
86 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s32)
87 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[CTTZ_ZERO_UNDEF]](s32)
88 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
89 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
90 ; CHECK-NEXT: $vgpr0 = COPY [[AND]](s32)
91 %0:_(s32) = COPY $vgpr0
92 %1:_(s16) = G_TRUNC %0
93 %2:_(s16) = G_CTTZ_ZERO_UNDEF %1
99 name: cttz_zero_undef_v2s32_v2s32
103 liveins: $vgpr0_vgpr1
104 ; CHECK-LABEL: name: cttz_zero_undef_v2s32_v2s32
105 ; CHECK: liveins: $vgpr0_vgpr1
107 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
108 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
109 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[UV]](s32)
110 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF1:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[UV1]](s32)
111 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[CTTZ_ZERO_UNDEF]](s32), [[CTTZ_ZERO_UNDEF1]](s32)
112 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
113 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
114 %1:_(<2 x s32>) = G_CTTZ_ZERO_UNDEF %0
115 $vgpr0_vgpr1 = COPY %1
119 name: cttz_zero_undef_v2s32_v2s64
123 liveins: $vgpr0_vgpr1_vgpr2_vgpr3
124 ; CHECK-LABEL: name: cttz_zero_undef_v2s32_v2s64
125 ; CHECK: liveins: $vgpr0_vgpr1_vgpr2_vgpr3
127 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
128 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
129 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[UV]](s64)
130 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF1:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[UV1]](s64)
131 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[CTTZ_ZERO_UNDEF]](s32), [[CTTZ_ZERO_UNDEF1]](s32)
132 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
133 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
134 %1:_(<2 x s32>) = G_CTTZ_ZERO_UNDEF %0
135 $vgpr0_vgpr1 = COPY %1
139 name: cttz_zero_undef_v2s16_v2s16
144 ; CHECK-LABEL: name: cttz_zero_undef_v2s16_v2s16
145 ; CHECK: liveins: $vgpr0
147 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
148 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[COPY]](<2 x s16>)
149 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
150 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
151 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[BITCAST]](s32)
152 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[CTTZ_ZERO_UNDEF]](s32)
153 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF1:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[LSHR]](s32)
154 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[CTTZ_ZERO_UNDEF1]](s32)
155 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
156 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
157 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
158 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32)
159 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
160 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
161 ; CHECK-NEXT: $vgpr0 = COPY [[BITCAST1]](<2 x s16>)
162 %0:_(<2 x s16>) = COPY $vgpr0
163 %1:_(<2 x s16>) = G_CTTZ_ZERO_UNDEF %0
168 name: cttz_zero_undef_s7_s7
174 ; CHECK-LABEL: name: cttz_zero_undef_s7_s7
175 ; CHECK: liveins: $vgpr0
177 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
178 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s32)
179 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY [[CTTZ_ZERO_UNDEF]](s32)
180 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 127
181 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
182 ; CHECK-NEXT: $vgpr0 = COPY [[AND]](s32)
183 %0:_(s32) = COPY $vgpr0
184 %1:_(s7) = G_TRUNC %0
185 %2:_(s7) = G_CTTZ_ZERO_UNDEF %1
186 %3:_(s32) = G_ZEXT %2
191 name: cttz_zero_undef_s33_s33
195 liveins: $vgpr0_vgpr1
197 ; CHECK-LABEL: name: cttz_zero_undef_s33_s33
198 ; CHECK: liveins: $vgpr0_vgpr1
200 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
201 ; CHECK-NEXT: [[CTTZ_ZERO_UNDEF:%[0-9]+]]:_(s32) = G_CTTZ_ZERO_UNDEF [[COPY]](s64)
202 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[CTTZ_ZERO_UNDEF]](s32)
203 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[ZEXT]](s64)
204 %0:_(s64) = COPY $vgpr0_vgpr1
205 %1:_(s33) = G_TRUNC %0
206 %2:_(s33) = G_CTTZ_ZERO_UNDEF %1
207 %3:_(s64) = G_ANYEXT %2
208 $vgpr0_vgpr1 = COPY %3