1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
4 declare i16 @llvm.bswap.i16(i16)
5 declare i32 @llvm.bswap.i32(i32)
6 declare <2 x i64> @llvm.bswap.v2i64(<2 x i64>)
7 declare i33 @llvm.cttz.i33(i33, i1)
8 declare i32 @llvm.ctlz.i32(i32, i1)
9 declare i8 @llvm.ctpop.i8(i8)
10 declare i11 @llvm.ctpop.i11(i11)
11 declare <2 x i32> @llvm.cttz.v2i32(<2 x i32>, i1)
12 declare <2 x i32> @llvm.ctlz.v2i32(<2 x i32>, i1)
13 declare <2 x i32> @llvm.ctpop.v2i32(<2 x i32>)
15 define i1 @bswap_eq_i16(i16 %x) {
16 ; CHECK-LABEL: @bswap_eq_i16(
17 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i16 [[X:%.*]], 256
18 ; CHECK-NEXT: ret i1 [[CMP]]
20 %bs = call i16 @llvm.bswap.i16(i16 %x)
21 %cmp = icmp eq i16 %bs, 1
25 define i1 @bswap_ne_i32(i32 %x) {
26 ; CHECK-LABEL: @bswap_ne_i32(
27 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[X:%.*]], 33554432
28 ; CHECK-NEXT: ret i1 [[CMP]]
30 %bs = tail call i32 @llvm.bswap.i32(i32 %x)
31 %cmp = icmp ne i32 %bs, 2
35 define <2 x i1> @bswap_eq_v2i64(<2 x i64> %x) {
36 ; CHECK-LABEL: @bswap_eq_v2i64(
37 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i64> [[X:%.*]], <i64 216172782113783808, i64 216172782113783808>
38 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
40 %bs = tail call <2 x i64> @llvm.bswap.v2i64(<2 x i64> %x)
41 %cmp = icmp eq <2 x i64> %bs, <i64 3, i64 3>
45 define i1 @ctlz_eq_bitwidth_i32(i32 %x) {
46 ; CHECK-LABEL: @ctlz_eq_bitwidth_i32(
47 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[X:%.*]], 0
48 ; CHECK-NEXT: ret i1 [[CMP]]
50 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
51 %cmp = icmp eq i32 %lz, 32
55 define i1 @ctlz_eq_zero_i32(i32 %x) {
56 ; CHECK-LABEL: @ctlz_eq_zero_i32(
57 ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[X:%.*]], 0
58 ; CHECK-NEXT: ret i1 [[CMP]]
60 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
61 %cmp = icmp eq i32 %lz, 0
65 define <2 x i1> @ctlz_ne_zero_v2i32(<2 x i32> %a) {
66 ; CHECK-LABEL: @ctlz_ne_zero_v2i32(
67 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i32> [[A:%.*]], <i32 -1, i32 -1>
68 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
70 %x = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %a, i1 false)
71 %cmp = icmp ne <2 x i32> %x, zeroinitializer
75 define i1 @ctlz_eq_bw_minus_1_i32(i32 %x) {
76 ; CHECK-LABEL: @ctlz_eq_bw_minus_1_i32(
77 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[X:%.*]], 1
78 ; CHECK-NEXT: ret i1 [[CMP]]
80 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
81 %cmp = icmp eq i32 %lz, 31
85 define <2 x i1> @ctlz_ne_bw_minus_1_v2i32(<2 x i32> %a) {
86 ; CHECK-LABEL: @ctlz_ne_bw_minus_1_v2i32(
87 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[A:%.*]], <i32 1, i32 1>
88 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
90 %x = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %a, i1 false)
91 %cmp = icmp ne <2 x i32> %x, <i32 31, i32 31>
95 define i1 @ctlz_eq_other_i32(i32 %x) {
96 ; CHECK-LABEL: @ctlz_eq_other_i32(
97 ; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[X:%.*]], -128
98 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP1]], 128
99 ; CHECK-NEXT: ret i1 [[CMP]]
101 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
102 %cmp = icmp eq i32 %lz, 24
106 define <2 x i1> @ctlz_ne_other_v2i32(<2 x i32> %a) {
107 ; CHECK-LABEL: @ctlz_ne_other_v2i32(
108 ; CHECK-NEXT: [[TMP1:%.*]] = and <2 x i32> [[A:%.*]], <i32 -128, i32 -128>
109 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[TMP1]], <i32 128, i32 128>
110 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
112 %x = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %a, i1 false)
113 %cmp = icmp ne <2 x i32> %x, <i32 24, i32 24>
117 define i1 @ctlz_eq_other_i32_multiuse(i32 %x, i32* %p) {
118 ; CHECK-LABEL: @ctlz_eq_other_i32_multiuse(
119 ; CHECK-NEXT: [[LZ:%.*]] = tail call i32 @llvm.ctlz.i32(i32 [[X:%.*]], i1 false), !range !0
120 ; CHECK-NEXT: store i32 [[LZ]], i32* [[P:%.*]], align 4
121 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[LZ]], 24
122 ; CHECK-NEXT: ret i1 [[CMP]]
124 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
125 store i32 %lz, i32* %p
126 %cmp = icmp eq i32 %lz, 24
130 define <2 x i1> @ctlz_ne_bitwidth_v2i32(<2 x i32> %a) {
131 ; CHECK-LABEL: @ctlz_ne_bitwidth_v2i32(
132 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[A:%.*]], zeroinitializer
133 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
135 %x = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %a, i1 false)
136 %cmp = icmp ne <2 x i32> %x, <i32 32, i32 32>
140 define i1 @ctlz_ugt_zero_i32(i32 %x) {
141 ; CHECK-LABEL: @ctlz_ugt_zero_i32(
142 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], -1
143 ; CHECK-NEXT: ret i1 [[CMP]]
145 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
146 %cmp = icmp ugt i32 %lz, 0
150 define i1 @ctlz_ugt_one_i32(i32 %x) {
151 ; CHECK-LABEL: @ctlz_ugt_one_i32(
152 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[X:%.*]], 1073741824
153 ; CHECK-NEXT: ret i1 [[CMP]]
155 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
156 %cmp = icmp ugt i32 %lz, 1
160 define i1 @ctlz_ugt_other_i32(i32 %x) {
161 ; CHECK-LABEL: @ctlz_ugt_other_i32(
162 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[X:%.*]], 32768
163 ; CHECK-NEXT: ret i1 [[CMP]]
165 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
166 %cmp = icmp ugt i32 %lz, 16
170 define i1 @ctlz_ugt_other_multiuse_i32(i32 %x, i32* %p) {
171 ; CHECK-LABEL: @ctlz_ugt_other_multiuse_i32(
172 ; CHECK-NEXT: [[LZ:%.*]] = tail call i32 @llvm.ctlz.i32(i32 [[X:%.*]], i1 false), !range !0
173 ; CHECK-NEXT: store i32 [[LZ]], i32* [[P:%.*]], align 4
174 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[X]], 32768
175 ; CHECK-NEXT: ret i1 [[CMP]]
177 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
178 store i32 %lz, i32* %p
179 %cmp = icmp ugt i32 %lz, 16
183 define i1 @ctlz_ugt_bw_minus_one_i32(i32 %x) {
184 ; CHECK-LABEL: @ctlz_ugt_bw_minus_one_i32(
185 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[X:%.*]], 0
186 ; CHECK-NEXT: ret i1 [[CMP]]
188 %lz = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false)
189 %cmp = icmp ugt i32 %lz, 31
193 define <2 x i1> @ctlz_ult_one_v2i32(<2 x i32> %x) {
194 ; CHECK-LABEL: @ctlz_ult_one_v2i32(
195 ; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i32> [[X:%.*]], zeroinitializer
196 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
198 %lz = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %x, i1 false)
199 %cmp = icmp ult <2 x i32> %lz, <i32 1, i32 1>
203 define <2 x i1> @ctlz_ult_other_v2i32(<2 x i32> %x) {
204 ; CHECK-LABEL: @ctlz_ult_other_v2i32(
205 ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt <2 x i32> [[X:%.*]], <i32 65535, i32 65535>
206 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
208 %lz = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %x, i1 false)
209 %cmp = icmp ult <2 x i32> %lz, <i32 16, i32 16>
213 define <2 x i1> @ctlz_ult_other_multiuse_v2i32(<2 x i32> %x, <2 x i32>* %p) {
214 ; CHECK-LABEL: @ctlz_ult_other_multiuse_v2i32(
215 ; CHECK-NEXT: [[LZ:%.*]] = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> [[X:%.*]], i1 false)
216 ; CHECK-NEXT: store <2 x i32> [[LZ]], <2 x i32>* [[P:%.*]], align 8
217 ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt <2 x i32> [[X]], <i32 65535, i32 65535>
218 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
220 %lz = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %x, i1 false)
221 store <2 x i32> %lz, <2 x i32>* %p
222 %cmp = icmp ult <2 x i32> %lz, <i32 16, i32 16>
226 define <2 x i1> @ctlz_ult_bw_minus_one_v2i32(<2 x i32> %x) {
227 ; CHECK-LABEL: @ctlz_ult_bw_minus_one_v2i32(
228 ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt <2 x i32> [[X:%.*]], <i32 1, i32 1>
229 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
231 %lz = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %x, i1 false)
232 %cmp = icmp ult <2 x i32> %lz, <i32 31, i32 31>
236 define <2 x i1> @ctlz_ult_bitwidth_v2i32(<2 x i32> %x) {
237 ; CHECK-LABEL: @ctlz_ult_bitwidth_v2i32(
238 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[X:%.*]], zeroinitializer
239 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
241 %lz = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %x, i1 false)
242 %cmp = icmp ult <2 x i32> %lz, <i32 32, i32 32>
246 define i1 @cttz_ne_bitwidth_i33(i33 %x) {
247 ; CHECK-LABEL: @cttz_ne_bitwidth_i33(
248 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne i33 [[X:%.*]], 0
249 ; CHECK-NEXT: ret i1 [[CMP]]
251 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
252 %cmp = icmp ne i33 %tz, 33
256 define <2 x i1> @cttz_eq_bitwidth_v2i32(<2 x i32> %a) {
257 ; CHECK-LABEL: @cttz_eq_bitwidth_v2i32(
258 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i32> [[A:%.*]], zeroinitializer
259 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
261 %x = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %a, i1 false)
262 %cmp = icmp eq <2 x i32> %x, <i32 32, i32 32>
266 define i1 @cttz_eq_zero_i33(i33 %x) {
267 ; CHECK-LABEL: @cttz_eq_zero_i33(
268 ; CHECK-NEXT: [[TMP1:%.*]] = and i33 [[X:%.*]], 1
269 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne i33 [[TMP1]], 0
270 ; CHECK-NEXT: ret i1 [[CMP]]
272 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
273 %cmp = icmp eq i33 %tz, 0
277 define <2 x i1> @cttz_ne_zero_v2i32(<2 x i32> %a) {
278 ; CHECK-LABEL: @cttz_ne_zero_v2i32(
279 ; CHECK-NEXT: [[TMP1:%.*]] = and <2 x i32> [[A:%.*]], <i32 1, i32 1>
280 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i32> [[TMP1]], zeroinitializer
281 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
283 %x = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %a, i1 false)
284 %cmp = icmp ne <2 x i32> %x, zeroinitializer
288 define i1 @cttz_eq_bw_minus_1_i33(i33 %x) {
289 ; CHECK-LABEL: @cttz_eq_bw_minus_1_i33(
290 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i33 [[X:%.*]], -4294967296
291 ; CHECK-NEXT: ret i1 [[CMP]]
293 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
294 %cmp = icmp eq i33 %tz, 32
298 define <2 x i1> @cttz_ne_bw_minus_1_v2i32(<2 x i32> %a) {
299 ; CHECK-LABEL: @cttz_ne_bw_minus_1_v2i32(
300 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[A:%.*]], <i32 -2147483648, i32 -2147483648>
301 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
303 %x = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %a, i1 false)
304 %cmp = icmp ne <2 x i32> %x, <i32 31, i32 31>
308 define i1 @cttz_eq_other_i33(i33 %x) {
309 ; CHECK-LABEL: @cttz_eq_other_i33(
310 ; CHECK-NEXT: [[TMP1:%.*]] = and i33 [[X:%.*]], 31
311 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i33 [[TMP1]], 16
312 ; CHECK-NEXT: ret i1 [[CMP]]
314 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
315 %cmp = icmp eq i33 %tz, 4
319 define <2 x i1> @cttz_ne_other_v2i32(<2 x i32> %a) {
320 ; CHECK-LABEL: @cttz_ne_other_v2i32(
321 ; CHECK-NEXT: [[TMP1:%.*]] = and <2 x i32> [[A:%.*]], <i32 31, i32 31>
322 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[TMP1]], <i32 16, i32 16>
323 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
325 %x = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %a, i1 false)
326 %cmp = icmp ne <2 x i32> %x, <i32 4, i32 4>
330 define i1 @cttz_eq_other_i33_multiuse(i33 %x, i33* %p) {
331 ; CHECK-LABEL: @cttz_eq_other_i33_multiuse(
332 ; CHECK-NEXT: [[TZ:%.*]] = tail call i33 @llvm.cttz.i33(i33 [[X:%.*]], i1 false), !range !1
333 ; CHECK-NEXT: store i33 [[TZ]], i33* [[P:%.*]], align 4
334 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i33 [[TZ]], 4
335 ; CHECK-NEXT: ret i1 [[CMP]]
337 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
338 store i33 %tz, i33* %p
339 %cmp = icmp eq i33 %tz, 4
343 define i1 @cttz_ugt_zero_i33(i33 %x) {
344 ; CHECK-LABEL: @cttz_ugt_zero_i33(
345 ; CHECK-NEXT: [[TMP1:%.*]] = and i33 [[X:%.*]], 1
346 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i33 [[TMP1]], 0
347 ; CHECK-NEXT: ret i1 [[CMP]]
349 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
350 %cmp = icmp ugt i33 %tz, 0
354 define i1 @cttz_ugt_one_i33(i33 %x) {
355 ; CHECK-LABEL: @cttz_ugt_one_i33(
356 ; CHECK-NEXT: [[TMP1:%.*]] = and i33 [[X:%.*]], 3
357 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i33 [[TMP1]], 0
358 ; CHECK-NEXT: ret i1 [[CMP]]
360 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
361 %cmp = icmp ugt i33 %tz, 1
365 define i1 @cttz_ugt_other_i33(i33 %x) {
366 ; CHECK-LABEL: @cttz_ugt_other_i33(
367 ; CHECK-NEXT: [[TMP1:%.*]] = and i33 [[X:%.*]], 131071
368 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i33 [[TMP1]], 0
369 ; CHECK-NEXT: ret i1 [[CMP]]
371 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
372 %cmp = icmp ugt i33 %tz, 16
376 define i1 @cttz_ugt_other_multiuse_i33(i33 %x, i33* %p) {
377 ; CHECK-LABEL: @cttz_ugt_other_multiuse_i33(
378 ; CHECK-NEXT: [[TZ:%.*]] = tail call i33 @llvm.cttz.i33(i33 [[X:%.*]], i1 false), !range !1
379 ; CHECK-NEXT: store i33 [[TZ]], i33* [[P:%.*]], align 4
380 ; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i33 [[TZ]], 16
381 ; CHECK-NEXT: ret i1 [[CMP]]
383 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
384 store i33 %tz, i33* %p
385 %cmp = icmp ugt i33 %tz, 16
389 define i1 @cttz_ugt_bw_minus_one_i33(i33 %x) {
390 ; CHECK-LABEL: @cttz_ugt_bw_minus_one_i33(
391 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i33 [[X:%.*]], 0
392 ; CHECK-NEXT: ret i1 [[CMP]]
394 %tz = tail call i33 @llvm.cttz.i33(i33 %x, i1 false)
395 %cmp = icmp ugt i33 %tz, 32
399 define <2 x i1> @cttz_ult_one_v2i32(<2 x i32> %x) {
400 ; CHECK-LABEL: @cttz_ult_one_v2i32(
401 ; CHECK-NEXT: [[CMP:%.*]] = trunc <2 x i32> [[X:%.*]] to <2 x i1>
402 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
404 %tz = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %x, i1 false)
405 %cmp = icmp ult <2 x i32> %tz, <i32 1, i32 1>
409 define <2 x i1> @cttz_ult_other_v2i32(<2 x i32> %x) {
410 ; CHECK-LABEL: @cttz_ult_other_v2i32(
411 ; CHECK-NEXT: [[TMP1:%.*]] = and <2 x i32> [[X:%.*]], <i32 65535, i32 65535>
412 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[TMP1]], zeroinitializer
413 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
415 %tz = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %x, i1 false)
416 %cmp = icmp ult <2 x i32> %tz, <i32 16, i32 16>
420 define <2 x i1> @cttz_ult_other_multiuse_v2i32(<2 x i32> %x, <2 x i32>* %p) {
421 ; CHECK-LABEL: @cttz_ult_other_multiuse_v2i32(
422 ; CHECK-NEXT: [[TZ:%.*]] = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[X:%.*]], i1 false)
423 ; CHECK-NEXT: store <2 x i32> [[TZ]], <2 x i32>* [[P:%.*]], align 8
424 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i32> [[TZ]], <i32 16, i32 16>
425 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
427 %tz = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %x, i1 false)
428 store <2 x i32> %tz, <2 x i32>* %p
429 %cmp = icmp ult <2 x i32> %tz, <i32 16, i32 16>
433 define <2 x i1> @cttz_ult_bw_minus_one_v2i32(<2 x i32> %x) {
434 ; CHECK-LABEL: @cttz_ult_bw_minus_one_v2i32(
435 ; CHECK-NEXT: [[TMP1:%.*]] = and <2 x i32> [[X:%.*]], <i32 2147483647, i32 2147483647>
436 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[TMP1]], zeroinitializer
437 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
439 %tz = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %x, i1 false)
440 %cmp = icmp ult <2 x i32> %tz, <i32 31, i32 31>
444 define <2 x i1> @cttz_ult_bitwidth_v2i32(<2 x i32> %x) {
445 ; CHECK-LABEL: @cttz_ult_bitwidth_v2i32(
446 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[X:%.*]], zeroinitializer
447 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
449 %tz = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %x, i1 false)
450 %cmp = icmp ult <2 x i32> %tz, <i32 32, i32 32>
454 define i1 @ctpop_eq_zero_i11(i11 %x) {
455 ; CHECK-LABEL: @ctpop_eq_zero_i11(
456 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i11 [[X:%.*]], 0
457 ; CHECK-NEXT: ret i1 [[CMP]]
459 %pop = tail call i11 @llvm.ctpop.i11(i11 %x)
460 %cmp = icmp eq i11 %pop, 0
464 define <2 x i1> @ctpop_ne_zero_v2i32(<2 x i32> %x) {
465 ; CHECK-LABEL: @ctpop_ne_zero_v2i32(
466 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[X:%.*]], zeroinitializer
467 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
469 %pop = tail call <2 x i32> @llvm.ctpop.v2i32(<2 x i32> %x)
470 %cmp = icmp ne <2 x i32> %pop, zeroinitializer
474 define i1 @ctpop_eq_bitwidth_i8(i8 %x) {
475 ; CHECK-LABEL: @ctpop_eq_bitwidth_i8(
476 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[X:%.*]], -1
477 ; CHECK-NEXT: ret i1 [[CMP]]
479 %pop = tail call i8 @llvm.ctpop.i8(i8 %x)
480 %cmp = icmp eq i8 %pop, 8
484 define <2 x i1> @ctpop_ne_bitwidth_v2i32(<2 x i32> %x) {
485 ; CHECK-LABEL: @ctpop_ne_bitwidth_v2i32(
486 ; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i32> [[X:%.*]], <i32 -1, i32 -1>
487 ; CHECK-NEXT: ret <2 x i1> [[CMP]]
489 %pop = tail call <2 x i32> @llvm.ctpop.v2i32(<2 x i32> %x)
490 %cmp = icmp ne <2 x i32> %pop, <i32 32, i32 32>