1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s
4 declare void @llvm.assume(i1)
6 define i1 @test_shl_const_nuw_unsigned_1(i8 %start, i8 %high) {
7 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_1(
9 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[START:%.*]], 4
10 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
11 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
12 ; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[START]], [[HIGH]]
13 ; CHECK-NEXT: ret i1 [[T_1]]
16 %start.shl.4 = shl nuw i8 %start, 4
17 %c.1 = icmp ult i8 %start.shl.4, %high
18 call void @llvm.assume(i1 %c.1)
20 %t.1 = icmp ult i8 %start, %high
24 define i1 @test_shl_const_nuw_unsigned_2(i8 %start, i8 %high) {
25 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_2(
27 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[START:%.*]], 4
28 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
29 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
30 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nuw i8 [[START]], 2
31 ; CHECK-NEXT: [[T:%.*]] = icmp ult i8 [[START_SHL_2]], [[HIGH]]
32 ; CHECK-NEXT: ret i1 [[T]]
35 %start.shl.4 = shl nuw i8 %start, 4
36 %c.1 = icmp ult i8 %start.shl.4, %high
37 call void @llvm.assume(i1 %c.1)
39 %start.shl.2 = shl nuw i8 %start, 2
40 %t = icmp ult i8 %start.shl.2, %high
44 define i1 @test_shl_const_nuw_unsigned_3(i8 %start, i8 %high) {
45 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_3(
47 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[START:%.*]], 4
48 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
49 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
50 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nuw i8 [[START]], 2
51 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
52 ; CHECK-NEXT: [[T:%.*]] = icmp ule i8 [[START_ADD_1]], [[START_SHL_2]]
53 ; CHECK-NEXT: ret i1 [[T]]
56 %start.shl.4 = shl nuw i8 %start, 4
57 %c.1 = icmp ult i8 %start.shl.4, %high
58 call void @llvm.assume(i1 %c.1)
60 %start.shl.2 = shl nuw i8 %start, 2
61 %start.add.1 = add nuw i8 %start, %start
62 %t = icmp ule i8 %start.add.1, %start.shl.2
66 define i1 @test_shl_const_nuw_unsigned_4(i8 %start, i8 %high) {
67 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_4(
69 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[START:%.*]], 4
70 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
71 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
72 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nuw i8 [[START]], 2
73 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
74 ; CHECK-NEXT: [[F:%.*]] = icmp ult i8 [[START_ADD_1]], [[START_SHL_2]]
75 ; CHECK-NEXT: ret i1 [[F]]
78 %start.shl.4 = shl nuw i8 %start, 4
79 %c.1 = icmp ult i8 %start.shl.4, %high
80 call void @llvm.assume(i1 %c.1)
82 %start.shl.2 = shl nuw i8 %start, 2
83 %start.add.1 = add nuw i8 %start, %start
84 %f = icmp ult i8 %start.add.1, %start.shl.2
89 define i1 @test_shl_const_nuw_unsigned_5(i8 %start, i8 %high) {
90 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_5(
92 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[START:%.*]], 4
93 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
94 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
95 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
96 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
97 ; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[START_ADD_2]], [[START_SHL_4]]
98 ; CHECK-NEXT: ret i1 [[T_4]]
101 %start.shl.4 = shl nuw i8 %start, 4
102 %c.1 = icmp ult i8 %start.shl.4, %high
103 call void @llvm.assume(i1 %c.1)
105 %start.add.1 = add nuw i8 %start, %start
106 %start.add.2 = add nuw i8 %start.add.1, %start.add.1
107 %t.4 = icmp ule i8 %start.add.2, %start.shl.4
111 define i1 @test_shl_const_nuw_unsigned_6(i8 %start, i8 %high) {
112 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_6(
114 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[START:%.*]], 4
115 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
116 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
117 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
118 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
119 ; CHECK-NEXT: [[F_2:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_SHL_4]]
120 ; CHECK-NEXT: ret i1 [[F_2]]
123 %start.shl.4 = shl nuw i8 %start, 4
124 %c.1 = icmp ult i8 %start.shl.4, %high
125 call void @llvm.assume(i1 %c.1)
127 %start.add.1 = add nuw i8 %start, %start
128 %start.add.2 = add nuw i8 %start.add.1, %start.add.1
129 %f.2 = icmp ult i8 %start.add.2, %start.shl.4
133 define i1 @test_shl_const_nuw_unsigned_7(i8 %start, i8 %high) {
134 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_7(
136 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[START:%.*]], 4
137 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
138 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
139 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nuw i8 [[START]], 2
140 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
141 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
142 ; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add nuw i8 [[START_ADD_2]], 1
143 ; CHECK-NEXT: [[F_3:%.*]] = icmp ule i8 [[START_ADD_2_1]], [[START_SHL_4]]
144 ; CHECK-NEXT: ret i1 [[F_3]]
147 %start.shl.4 = shl nuw i8 %start, 4
148 %c.1 = icmp ult i8 %start.shl.4, %high
149 call void @llvm.assume(i1 %c.1)
151 %start.shl.2 = shl nuw i8 %start, 2
152 %start.add.1 = add nuw i8 %start, %start
153 %start.add.2 = add nuw i8 %start.add.1, %start.add.1
154 %start.add.2.1 = add nuw i8 %start.add.2, 1
155 %f.3 = icmp ule i8 %start.add.2.1, %start.shl.4
159 define i1 @test_shl_const_nuw_unsigned_8(i8 %start, i8 %high) {
160 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_8(
162 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[START:%.*]], 4
163 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
164 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
165 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nuw i8 [[START]], 2
166 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
167 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
168 ; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add nuw i8 [[START_ADD_2]], 1
169 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nuw i8 [[START]], 3
170 ; CHECK-NEXT: [[T_5:%.*]] = icmp ule i8 [[START_ADD_1]], [[START_SHL_3]]
171 ; CHECK-NEXT: ret i1 [[T_5]]
174 %start.shl.4 = shl nuw i8 %start, 4
175 %c.1 = icmp ult i8 %start.shl.4, %high
176 call void @llvm.assume(i1 %c.1)
178 %start.shl.2 = shl nuw i8 %start, 2
179 %start.add.1 = add nuw i8 %start, %start
180 %start.add.2 = add nuw i8 %start.add.1, %start.add.1
181 %start.add.2.1 = add nuw i8 %start.add.2, 1
182 %start.shl.3 = shl nuw i8 %start, 3
183 %t.5 = icmp ule i8 %start.add.1, %start.shl.3
187 define i1 @test_shl_const_nuw_unsigned_9(i8 %start, i8 %high) {
188 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_9(
190 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[START:%.*]], 4
191 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
192 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
193 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nuw i8 [[START]], 2
194 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
195 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
196 ; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add nuw i8 [[START_ADD_2]], 1
197 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nuw i8 [[START]], 3
198 ; CHECK-NEXT: [[F_5:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_SHL_3]]
199 ; CHECK-NEXT: ret i1 [[F_5]]
202 %start.shl.4 = shl nuw i8 %start, 4
203 %c.1 = icmp ult i8 %start.shl.4, %high
204 call void @llvm.assume(i1 %c.1)
206 %start.shl.2 = shl nuw i8 %start, 2
207 %start.add.1 = add nuw i8 %start, %start
208 %start.add.2 = add nuw i8 %start.add.1, %start.add.1
209 %start.add.2.1 = add nuw i8 %start.add.2, 1
210 %start.shl.3 = shl nuw i8 %start, 3
211 %f.5 = icmp ult i8 %start.add.2, %start.shl.3
215 define i1 @test_shl_const_nuw_unsigned_10(i8 %start, i8 %high) {
216 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_10(
218 ; CHECK-NEXT: [[START_SHL_5:%.*]] = shl nuw i8 [[START:%.*]], 5
219 ; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_SHL_5]]
220 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
221 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nuw i8 [[START]], 3
222 ; CHECK-NEXT: ret i1 true
225 %start.shl.5 = shl nuw i8 %start, 5
226 %c.0 = icmp ult i8 %start, %start.shl.5
227 call void @llvm.assume(i1 %c.0)
229 %start.shl.3 = shl nuw i8 %start, 3
230 %t.1 = icmp ule i8 %start.shl.3, %start.shl.5
234 define i1 @test_shl_const_nuw_unsigned_11(i8 %start, i8 %high) {
235 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_11(
237 ; CHECK-NEXT: [[START_SHL_5:%.*]] = shl nuw i8 [[START:%.*]], 5
238 ; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_SHL_5]]
239 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
240 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nuw i8 [[START]], 3
241 ; CHECK-NEXT: ret i1 false
244 %start.shl.5 = shl nuw i8 %start, 5
245 %c.0 = icmp ult i8 %start, %start.shl.5
246 call void @llvm.assume(i1 %c.0)
248 %start.shl.3 = shl nuw i8 %start, 3
249 %c.1 = icmp ule i8 %start.shl.5, %start.shl.3
253 define i1 @test_shl_const_nuw_unsigned_12(i8 %start) {
254 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_12(
256 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nuw i8 [[START:%.*]], 3
257 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START]], [[START_SHL_3]]
258 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
259 ; CHECK-NEXT: [[START_SHL_5:%.*]] = shl nuw i8 [[START]], 5
260 ; CHECK-NEXT: ret i1 true
263 %start.shl.3 = shl nuw i8 %start, 3
264 %c.1 = icmp ult i8 %start, %start.shl.3
265 call void @llvm.assume(i1 %c.1)
267 %start.shl.5 = shl nuw i8 %start, 5
268 %t.1 = icmp ule i8 %start.shl.3, %start.shl.5
272 define i1 @test_shl_const_nuw_unsigned_13(i8 %start) {
273 ; CHECK-LABEL: @test_shl_const_nuw_unsigned_13(
275 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl i8 [[START:%.*]], 3
276 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START]], [[START_SHL_3]]
277 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
278 ; CHECK-NEXT: [[START_SHL_5:%.*]] = shl i8 [[START]], 5
279 ; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[START_SHL_5]], [[START_SHL_3]]
280 ; CHECK-NEXT: ret i1 [[F_1]]
283 %start.shl.3 = shl i8 %start, 3
284 %c.1 = icmp ult i8 %start, %start.shl.3
285 call void @llvm.assume(i1 %c.1)
287 %start.shl.5 = shl i8 %start, 5
288 %f.1 = icmp ule i8 %start.shl.5, %start.shl.3
292 define i1 @test_shl_add_const_nuw_unsigned_1(i8 %start, i8 %high) {
293 ; CHECK-LABEL: @test_shl_add_const_nuw_unsigned_1(
295 ; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[START:%.*]], 3
296 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[ADD]], 4
297 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
298 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
299 ; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[START]], [[HIGH]]
300 ; CHECK-NEXT: ret i1 [[T_1]]
303 %add = add nuw i8 %start, 3
304 %start.shl.4 = shl nuw i8 %add, 4
305 %c.1 = icmp ult i8 %start.shl.4, %high
306 call void @llvm.assume(i1 %c.1)
308 %t.1 = icmp ult i8 %start, %high
312 define i1 @test_shl_add_const_nuw_unsigned_2(i8 %start, i8 %high) {
313 ; CHECK-LABEL: @test_shl_add_const_nuw_unsigned_2(
315 ; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[START:%.*]], 3
316 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[ADD]], 4
317 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
318 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
319 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nuw i8 [[START]], 2
320 ; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[START_SHL_2]], [[HIGH]]
321 ; CHECK-NEXT: ret i1 [[T_2]]
324 %add = add nuw i8 %start, 3
325 %start.shl.4 = shl nuw i8 %add, 4
326 %c.1 = icmp ult i8 %start.shl.4, %high
327 call void @llvm.assume(i1 %c.1)
329 %start.shl.2 = shl nuw i8 %start, 2
330 %t.2 = icmp ult i8 %start.shl.2, %high
334 define i1 @test_shl_add_const_nuw_unsigned_3(i8 %start, i8 %high) {
335 ; CHECK-LABEL: @test_shl_add_const_nuw_unsigned_3(
337 ; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[START:%.*]], 3
338 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[ADD]], 4
339 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
340 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
341 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
342 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
343 ; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[START_ADD_2]], [[START_SHL_4]]
344 ; CHECK-NEXT: ret i1 [[T_3]]
347 %add = add nuw i8 %start, 3
348 %start.shl.4 = shl nuw i8 %add, 4
349 %c.1 = icmp ult i8 %start.shl.4, %high
350 call void @llvm.assume(i1 %c.1)
352 %start.add.1 = add nuw i8 %start, %start
353 %start.add.2 = add nuw i8 %start.add.1, %start.add.1
354 %t.3 = icmp ule i8 %start.add.2, %start.shl.4
358 define i1 @test_shl_add_const_nuw_unsigned_4(i8 %start, i8 %high) {
359 ; CHECK-LABEL: @test_shl_add_const_nuw_unsigned_4(
361 ; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[START:%.*]], 3
362 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[ADD]], 4
363 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
364 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
365 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nuw i8 [[START]], 2
366 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
367 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
368 ; CHECK-NEXT: [[T_4:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_SHL_4]]
369 ; CHECK-NEXT: ret i1 [[T_4]]
372 %add = add nuw i8 %start, 3
373 %start.shl.4 = shl nuw i8 %add, 4
374 %c.1 = icmp ult i8 %start.shl.4, %high
375 call void @llvm.assume(i1 %c.1)
377 %start.shl.2 = shl nuw i8 %start, 2
378 %start.add.1 = add nuw i8 %start, %start
379 %start.add.2 = add nuw i8 %start.add.1, %start.add.1
380 %t.4 = icmp ult i8 %start.add.2, %start.shl.4
384 define i1 @test_shl_add_const_nuw_unsigned_5(i8 %start, i8 %high) {
385 ; CHECK-LABEL: @test_shl_add_const_nuw_unsigned_5(
387 ; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[START:%.*]], 3
388 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[ADD]], 4
389 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
390 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
391 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
392 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
393 ; CHECK-NEXT: [[START_ADD_2_12:%.*]] = add nuw i8 [[START_ADD_2]], 12
394 ; CHECK-NEXT: [[T_5:%.*]] = icmp ule i8 [[START_ADD_2_12]], [[START_SHL_4]]
395 ; CHECK-NEXT: ret i1 [[T_5]]
398 %add = add nuw i8 %start, 3
399 %start.shl.4 = shl nuw i8 %add, 4
400 %c.1 = icmp ult i8 %start.shl.4, %high
401 call void @llvm.assume(i1 %c.1)
403 %start.add.1 = add nuw i8 %start, %start
404 %start.add.2 = add nuw i8 %start.add.1, %start.add.1
405 %start.add.2.12 = add nuw i8 %start.add.2, 12
406 %t.5 = icmp ule i8 %start.add.2.12, %start.shl.4
410 define i1 @test_shl_add_const_nuw_unsigned_6(i8 %start, i8 %high) {
411 ; CHECK-LABEL: @test_shl_add_const_nuw_unsigned_6(
413 ; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[START:%.*]], 3
414 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nuw i8 [[ADD]], 4
415 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
416 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
417 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
418 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
419 ; CHECK-NEXT: [[START_ADD_2_13:%.*]] = add nuw i8 [[START_ADD_2]], 13
420 ; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[START_ADD_2_13]], [[START_SHL_4]]
421 ; CHECK-NEXT: ret i1 [[F_1]]
424 %add = add nuw i8 %start, 3
425 %start.shl.4 = shl nuw i8 %add, 4
426 %c.1 = icmp ult i8 %start.shl.4, %high
427 call void @llvm.assume(i1 %c.1)
429 %start.add.1 = add nuw i8 %start, %start
430 %start.add.2 = add nuw i8 %start.add.1, %start.add.1
431 %start.add.2.13 = add nuw i8 %start.add.2, 13
432 %f.1 = icmp ule i8 %start.add.2.13, %start.shl.4
436 define i1 @test_shl_const_nsw_unsigned_1(i8 %start, i8 %high) {
437 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_1(
439 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[START:%.*]], 4
440 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
441 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
442 ; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[START]], [[HIGH]]
443 ; CHECK-NEXT: ret i1 [[T_1]]
446 %start.shl.4 = shl nsw i8 %start, 4
447 %c.1 = icmp ult i8 %start.shl.4, %high
448 call void @llvm.assume(i1 %c.1)
450 %t.1 = icmp ult i8 %start, %high
454 define i1 @test_shl_const_nsw_unsigned_2(i8 %start, i8 %high) {
455 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_2(
457 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[START:%.*]], 4
458 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
459 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
460 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nsw i8 [[START]], 2
461 ; CHECK-NEXT: [[T:%.*]] = icmp ult i8 [[START_SHL_2]], [[HIGH]]
462 ; CHECK-NEXT: ret i1 [[T]]
465 %start.shl.4 = shl nsw i8 %start, 4
466 %c.1 = icmp ult i8 %start.shl.4, %high
467 call void @llvm.assume(i1 %c.1)
469 %start.shl.2 = shl nsw i8 %start, 2
470 %t = icmp ult i8 %start.shl.2, %high
474 define i1 @test_shl_const_nsw_unsigned_3(i8 %start, i8 %high) {
475 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_3(
477 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[START:%.*]], 4
478 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
479 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
480 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nsw i8 [[START]], 2
481 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
482 ; CHECK-NEXT: [[T:%.*]] = icmp ule i8 [[START_ADD_1]], [[START_SHL_2]]
483 ; CHECK-NEXT: ret i1 [[T]]
486 %start.shl.4 = shl nsw i8 %start, 4
487 %c.1 = icmp ult i8 %start.shl.4, %high
488 call void @llvm.assume(i1 %c.1)
490 %start.shl.2 = shl nsw i8 %start, 2
491 %start.add.1 = add nsw i8 %start, %start
492 %t = icmp ule i8 %start.add.1, %start.shl.2
497 define i1 @test_shl_const_nsw_unsigned_4(i8 %start, i8 %high) {
498 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_4(
500 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[START:%.*]], 4
501 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
502 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
503 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nsw i8 [[START]], 2
504 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
505 ; CHECK-NEXT: [[F:%.*]] = icmp ult i8 [[START_ADD_1]], [[START_SHL_2]]
506 ; CHECK-NEXT: ret i1 [[F]]
509 %start.shl.4 = shl nsw i8 %start, 4
510 %c.1 = icmp ult i8 %start.shl.4, %high
511 call void @llvm.assume(i1 %c.1)
513 %start.shl.2 = shl nsw i8 %start, 2
514 %start.add.1 = add nsw i8 %start, %start
515 %f = icmp ult i8 %start.add.1, %start.shl.2
520 define i1 @test_shl_const_nsw_unsigned_5(i8 %start, i8 %high) {
521 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_5(
523 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[START:%.*]], 4
524 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
525 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
526 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
527 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nsw i8 [[START_ADD_1]], [[START_ADD_1]]
528 ; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[START_ADD_2]], [[START_SHL_4]]
529 ; CHECK-NEXT: ret i1 [[T_4]]
532 %start.shl.4 = shl nsw i8 %start, 4
533 %c.1 = icmp ult i8 %start.shl.4, %high
534 call void @llvm.assume(i1 %c.1)
536 %start.add.1 = add nsw i8 %start, %start
537 %start.add.2 = add nsw i8 %start.add.1, %start.add.1
538 %t.4 = icmp ule i8 %start.add.2, %start.shl.4
542 define i1 @test_shl_const_nsw_unsigned_6(i8 %start, i8 %high) {
543 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_6(
545 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[START:%.*]], 4
546 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
547 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
548 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
549 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nsw i8 [[START_ADD_1]], [[START_ADD_1]]
550 ; CHECK-NEXT: [[F_2:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_SHL_4]]
551 ; CHECK-NEXT: ret i1 [[F_2]]
554 %start.shl.4 = shl nsw i8 %start, 4
555 %c.1 = icmp ult i8 %start.shl.4, %high
556 call void @llvm.assume(i1 %c.1)
558 %start.add.1 = add nsw i8 %start, %start
559 %start.add.2 = add nsw i8 %start.add.1, %start.add.1
560 %f.2 = icmp ult i8 %start.add.2, %start.shl.4
564 define i1 @test_shl_const_nsw_unsigned_7(i8 %start, i8 %high) {
565 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_7(
567 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[START:%.*]], 4
568 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
569 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
570 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nsw i8 [[START]], 2
571 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
572 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nsw i8 [[START_ADD_1]], [[START_ADD_1]]
573 ; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add nsw i8 [[START_ADD_2]], 1
574 ; CHECK-NEXT: [[F_3:%.*]] = icmp ule i8 [[START_ADD_2_1]], [[START_SHL_4]]
575 ; CHECK-NEXT: ret i1 [[F_3]]
578 %start.shl.4 = shl nsw i8 %start, 4
579 %c.1 = icmp ult i8 %start.shl.4, %high
580 call void @llvm.assume(i1 %c.1)
582 %start.shl.2 = shl nsw i8 %start, 2
583 %start.add.1 = add nsw i8 %start, %start
584 %start.add.2 = add nsw i8 %start.add.1, %start.add.1
585 %start.add.2.1 = add nsw i8 %start.add.2, 1
586 %f.3 = icmp ule i8 %start.add.2.1, %start.shl.4
590 define i1 @test_shl_const_nsw_unsigned_8(i8 %start, i8 %high) {
591 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_8(
593 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[START:%.*]], 4
594 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
595 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
596 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nsw i8 [[START]], 2
597 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
598 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nsw i8 [[START_ADD_1]], [[START_ADD_1]]
599 ; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add nsw i8 [[START_ADD_2]], 1
600 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nsw i8 [[START]], 3
601 ; CHECK-NEXT: [[T_5:%.*]] = icmp ule i8 [[START_ADD_1]], [[START_SHL_3]]
602 ; CHECK-NEXT: ret i1 [[T_5]]
605 %start.shl.4 = shl nsw i8 %start, 4
606 %c.1 = icmp ult i8 %start.shl.4, %high
607 call void @llvm.assume(i1 %c.1)
609 %start.shl.2 = shl nsw i8 %start, 2
610 %start.add.1 = add nsw i8 %start, %start
611 %start.add.2 = add nsw i8 %start.add.1, %start.add.1
612 %start.add.2.1 = add nsw i8 %start.add.2, 1
613 %start.shl.3 = shl nsw i8 %start, 3
614 %t.5 = icmp ule i8 %start.add.1, %start.shl.3
618 define i1 @test_shl_const_nsw_unsigned_9(i8 %start, i8 %high) {
619 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_9(
621 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[START:%.*]], 4
622 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
623 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
624 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nsw i8 [[START]], 2
625 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
626 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nsw i8 [[START_ADD_1]], [[START_ADD_1]]
627 ; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add nsw i8 [[START_ADD_2]], 1
628 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nsw i8 [[START]], 3
629 ; CHECK-NEXT: [[F_5:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_SHL_3]]
630 ; CHECK-NEXT: ret i1 [[F_5]]
633 %start.shl.4 = shl nsw i8 %start, 4
634 %c.1 = icmp ult i8 %start.shl.4, %high
635 call void @llvm.assume(i1 %c.1)
637 %start.shl.2 = shl nsw i8 %start, 2
638 %start.add.1 = add nsw i8 %start, %start
639 %start.add.2 = add nsw i8 %start.add.1, %start.add.1
640 %start.add.2.1 = add nsw i8 %start.add.2, 1
641 %start.shl.3 = shl nsw i8 %start, 3
642 %f.5 = icmp ult i8 %start.add.2, %start.shl.3
646 define i1 @test_shl_const_nsw_unsigned_10(i8 %start, i8 %high) {
647 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_10(
649 ; CHECK-NEXT: [[START_SHL_5:%.*]] = shl nsw i8 [[START:%.*]], 5
650 ; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_SHL_5]]
651 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
652 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nsw i8 [[START]], 3
653 ; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_SHL_3]], [[START_SHL_5]]
654 ; CHECK-NEXT: ret i1 [[T_1]]
657 %start.shl.5 = shl nsw i8 %start, 5
658 %c.0 = icmp ult i8 %start, %start.shl.5
659 call void @llvm.assume(i1 %c.0)
661 %start.shl.3 = shl nsw i8 %start, 3
662 %t.1 = icmp ule i8 %start.shl.3, %start.shl.5
666 define i1 @test_shl_const_nsw_unsigned_11(i8 %start, i8 %high) {
667 ; CHECK-LABEL: @test_shl_const_nsw_unsigned_11(
669 ; CHECK-NEXT: [[START_SHL_5:%.*]] = shl nsw i8 [[START:%.*]], 5
670 ; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_SHL_5]]
671 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
672 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nsw i8 [[START]], 3
673 ; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[START_SHL_5]], [[START_SHL_3]]
674 ; CHECK-NEXT: ret i1 [[C_1]]
677 %start.shl.5 = shl nsw i8 %start, 5
678 %c.0 = icmp ult i8 %start, %start.shl.5
679 call void @llvm.assume(i1 %c.0)
681 %start.shl.3 = shl nsw i8 %start, 3
682 %c.1 = icmp ule i8 %start.shl.5, %start.shl.3
686 define i1 @test_shl_add_const_nsw_unsigned_1(i8 %start, i8 %high) {
687 ; CHECK-LABEL: @test_shl_add_const_nsw_unsigned_1(
689 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i8 [[START:%.*]], 3
690 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[ADD]], 4
691 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
692 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
693 ; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[START]], [[HIGH]]
694 ; CHECK-NEXT: ret i1 [[T_1]]
697 %add = add nsw i8 %start, 3
698 %start.shl.4 = shl nsw i8 %add, 4
699 %c.1 = icmp ult i8 %start.shl.4, %high
700 call void @llvm.assume(i1 %c.1)
702 %t.1 = icmp ult i8 %start, %high
706 define i1 @test_shl_add_const_nsw_unsigned_2(i8 %start, i8 %high) {
707 ; CHECK-LABEL: @test_shl_add_const_nsw_unsigned_2(
709 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i8 [[START:%.*]], 3
710 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[ADD]], 4
711 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
712 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
713 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nsw i8 [[START]], 2
714 ; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[START_SHL_2]], [[HIGH]]
715 ; CHECK-NEXT: ret i1 [[T_2]]
718 %add = add nsw i8 %start, 3
719 %start.shl.4 = shl nsw i8 %add, 4
720 %c.1 = icmp ult i8 %start.shl.4, %high
721 call void @llvm.assume(i1 %c.1)
723 %start.shl.2 = shl nsw i8 %start, 2
724 %t.2 = icmp ult i8 %start.shl.2, %high
728 define i1 @test_shl_add_const_nsw_unsigned_3(i8 %start, i8 %high) {
729 ; CHECK-LABEL: @test_shl_add_const_nsw_unsigned_3(
731 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i8 [[START:%.*]], 3
732 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[ADD]], 4
733 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
734 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
735 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
736 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nsw i8 [[START_ADD_1]], [[START_ADD_1]]
737 ; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[START_ADD_2]], [[START_SHL_4]]
738 ; CHECK-NEXT: ret i1 [[T_3]]
741 %add = add nsw i8 %start, 3
742 %start.shl.4 = shl nsw i8 %add, 4
743 %c.1 = icmp ult i8 %start.shl.4, %high
744 call void @llvm.assume(i1 %c.1)
746 %start.add.1 = add nsw i8 %start, %start
747 %start.add.2 = add nsw i8 %start.add.1, %start.add.1
748 %t.3 = icmp ule i8 %start.add.2, %start.shl.4
752 define i1 @test_shl_add_const_nsw_unsigned_4(i8 %start, i8 %high) {
753 ; CHECK-LABEL: @test_shl_add_const_nsw_unsigned_4(
755 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i8 [[START:%.*]], 3
756 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[ADD]], 4
757 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
758 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
759 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl nsw i8 [[START]], 2
760 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
761 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nsw i8 [[START_ADD_1]], [[START_ADD_1]]
762 ; CHECK-NEXT: [[T_4:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_SHL_4]]
763 ; CHECK-NEXT: ret i1 [[T_4]]
766 %add = add nsw i8 %start, 3
767 %start.shl.4 = shl nsw i8 %add, 4
768 %c.1 = icmp ult i8 %start.shl.4, %high
769 call void @llvm.assume(i1 %c.1)
771 %start.shl.2 = shl nsw i8 %start, 2
772 %start.add.1 = add nsw i8 %start, %start
773 %start.add.2 = add nsw i8 %start.add.1, %start.add.1
774 %t.4 = icmp ult i8 %start.add.2, %start.shl.4
778 define i1 @test_shl_add_const_nsw_unsigned_5(i8 %start, i8 %high) {
779 ; CHECK-LABEL: @test_shl_add_const_nsw_unsigned_5(
781 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i8 [[START:%.*]], 3
782 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[ADD]], 4
783 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
784 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
785 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
786 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nsw i8 [[START_ADD_1]], [[START_ADD_1]]
787 ; CHECK-NEXT: [[START_ADD_2_12:%.*]] = add nsw i8 [[START_ADD_2]], 12
788 ; CHECK-NEXT: [[T_5:%.*]] = icmp ule i8 [[START_ADD_2_12]], [[START_SHL_4]]
789 ; CHECK-NEXT: ret i1 [[T_5]]
792 %add = add nsw i8 %start, 3
793 %start.shl.4 = shl nsw i8 %add, 4
794 %c.1 = icmp ult i8 %start.shl.4, %high
795 call void @llvm.assume(i1 %c.1)
797 %start.add.1 = add nsw i8 %start, %start
798 %start.add.2 = add nsw i8 %start.add.1, %start.add.1
799 %start.add.2.12 = add nsw i8 %start.add.2, 12
800 %t.5 = icmp ule i8 %start.add.2.12, %start.shl.4
804 define i1 @test_shl_add_const_nsw_unsigned_6(i8 %start, i8 %high) {
805 ; CHECK-LABEL: @test_shl_add_const_nsw_unsigned_6(
807 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i8 [[START:%.*]], 3
808 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl nsw i8 [[ADD]], 4
809 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
810 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
811 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add nsw i8 [[START]], [[START]]
812 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add nsw i8 [[START_ADD_1]], [[START_ADD_1]]
813 ; CHECK-NEXT: [[START_ADD_2_13:%.*]] = add nsw i8 [[START_ADD_2]], 13
814 ; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[START_ADD_2_13]], [[START_SHL_4]]
815 ; CHECK-NEXT: ret i1 [[F_1]]
818 %add = add nsw i8 %start, 3
819 %start.shl.4 = shl nsw i8 %add, 4
820 %c.1 = icmp ult i8 %start.shl.4, %high
821 call void @llvm.assume(i1 %c.1)
823 %start.add.1 = add nsw i8 %start, %start
824 %start.add.2 = add nsw i8 %start.add.1, %start.add.1
825 %start.add.2.13 = add nsw i8 %start.add.2, 13
826 %f.1 = icmp ule i8 %start.add.2.13, %start.shl.4
830 define i1 @test_shl_const_no_nuw_unsigned_1(i8 %start, i8 %high) {
831 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_1(
833 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[START:%.*]], 4
834 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
835 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
836 ; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[START]], [[HIGH]]
837 ; CHECK-NEXT: ret i1 [[T_1]]
840 %start.shl.4 = shl i8 %start, 4
841 %c.1 = icmp ult i8 %start.shl.4, %high
842 call void @llvm.assume(i1 %c.1)
844 %t.1 = icmp ult i8 %start, %high
848 define i1 @test_shl_const_no_nuw_unsigned_2(i8 %start, i8 %high) {
849 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_2(
851 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[START:%.*]], 4
852 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
853 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
854 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl i8 [[START]], 2
855 ; CHECK-NEXT: [[T:%.*]] = icmp ult i8 [[START_SHL_2]], [[HIGH]]
856 ; CHECK-NEXT: ret i1 [[T]]
859 %start.shl.4 = shl i8 %start, 4
860 %c.1 = icmp ult i8 %start.shl.4, %high
861 call void @llvm.assume(i1 %c.1)
863 %start.shl.2 = shl i8 %start, 2
864 %t = icmp ult i8 %start.shl.2, %high
868 define i1 @test_shl_const_no_nuw_unsigned_3(i8 %start, i8 %high) {
869 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_3(
871 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[START:%.*]], 4
872 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
873 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
874 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl i8 [[START]], 2
875 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
876 ; CHECK-NEXT: [[T:%.*]] = icmp ule i8 [[START_ADD_1]], [[START_SHL_2]]
877 ; CHECK-NEXT: ret i1 [[T]]
880 %start.shl.4 = shl i8 %start, 4
881 %c.1 = icmp ult i8 %start.shl.4, %high
882 call void @llvm.assume(i1 %c.1)
884 %start.shl.2 = shl i8 %start, 2
885 %start.add.1 = add i8 %start, %start
886 %t = icmp ule i8 %start.add.1, %start.shl.2
891 define i1 @test_shl_const_no_nuw_unsigned_4(i8 %start, i8 %high) {
892 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_4(
894 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[START:%.*]], 4
895 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
896 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
897 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl i8 [[START]], 2
898 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
899 ; CHECK-NEXT: [[F:%.*]] = icmp ult i8 [[START_ADD_1]], [[START_SHL_2]]
900 ; CHECK-NEXT: ret i1 [[F]]
903 %start.shl.4 = shl i8 %start, 4
904 %c.1 = icmp ult i8 %start.shl.4, %high
905 call void @llvm.assume(i1 %c.1)
907 %start.shl.2 = shl i8 %start, 2
908 %start.add.1 = add i8 %start, %start
909 %f = icmp ult i8 %start.add.1, %start.shl.2
914 define i1 @test_shl_const_no_nuw_unsigned_5(i8 %start, i8 %high) {
915 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_5(
917 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[START:%.*]], 4
918 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
919 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
920 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
921 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add i8 [[START_ADD_1]], [[START_ADD_1]]
922 ; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[START_ADD_2]], [[START_SHL_4]]
923 ; CHECK-NEXT: ret i1 [[T_4]]
926 %start.shl.4 = shl i8 %start, 4
927 %c.1 = icmp ult i8 %start.shl.4, %high
928 call void @llvm.assume(i1 %c.1)
930 %start.add.1 = add i8 %start, %start
931 %start.add.2 = add i8 %start.add.1, %start.add.1
932 %t.4 = icmp ule i8 %start.add.2, %start.shl.4
936 define i1 @test_shl_const_no_nuw_unsigned_6(i8 %start, i8 %high) {
937 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_6(
939 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[START:%.*]], 4
940 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
941 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
942 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
943 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add i8 [[START_ADD_1]], [[START_ADD_1]]
944 ; CHECK-NEXT: [[F_2:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_SHL_4]]
945 ; CHECK-NEXT: ret i1 [[F_2]]
948 %start.shl.4 = shl i8 %start, 4
949 %c.1 = icmp ult i8 %start.shl.4, %high
950 call void @llvm.assume(i1 %c.1)
952 %start.add.1 = add i8 %start, %start
953 %start.add.2 = add i8 %start.add.1, %start.add.1
954 %f.2 = icmp ult i8 %start.add.2, %start.shl.4
958 define i1 @test_shl_const_no_nuw_unsigned_7(i8 %start, i8 %high) {
959 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_7(
961 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[START:%.*]], 4
962 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
963 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
964 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl i8 [[START]], 2
965 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
966 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add i8 [[START_ADD_1]], [[START_ADD_1]]
967 ; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add i8 [[START_ADD_2]], 1
968 ; CHECK-NEXT: [[F_3:%.*]] = icmp ule i8 [[START_ADD_2_1]], [[START_SHL_4]]
969 ; CHECK-NEXT: ret i1 [[F_3]]
972 %start.shl.4 = shl i8 %start, 4
973 %c.1 = icmp ult i8 %start.shl.4, %high
974 call void @llvm.assume(i1 %c.1)
976 %start.shl.2 = shl i8 %start, 2
977 %start.add.1 = add i8 %start, %start
978 %start.add.2 = add i8 %start.add.1, %start.add.1
979 %start.add.2.1 = add i8 %start.add.2, 1
980 %f.3 = icmp ule i8 %start.add.2.1, %start.shl.4
984 define i1 @test_shl_const_no_nuw_unsigned_8(i8 %start, i8 %high) {
985 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_8(
987 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[START:%.*]], 4
988 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
989 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
990 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl i8 [[START]], 2
991 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
992 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add i8 [[START_ADD_1]], [[START_ADD_1]]
993 ; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add i8 [[START_ADD_2]], 1
994 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl i8 [[START]], 3
995 ; CHECK-NEXT: [[T_5:%.*]] = icmp ule i8 [[START_ADD_1]], [[START_SHL_3]]
996 ; CHECK-NEXT: ret i1 [[T_5]]
999 %start.shl.4 = shl i8 %start, 4
1000 %c.1 = icmp ult i8 %start.shl.4, %high
1001 call void @llvm.assume(i1 %c.1)
1003 %start.shl.2 = shl i8 %start, 2
1004 %start.add.1 = add i8 %start, %start
1005 %start.add.2 = add i8 %start.add.1, %start.add.1
1006 %start.add.2.1 = add i8 %start.add.2, 1
1007 %start.shl.3 = shl i8 %start, 3
1008 %t.5 = icmp ule i8 %start.add.1, %start.shl.3
1012 define i1 @test_shl_const_no_nuw_unsigned_9(i8 %start, i8 %high) {
1013 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_9(
1014 ; CHECK-NEXT: entry:
1015 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[START:%.*]], 4
1016 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
1017 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
1018 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl i8 [[START]], 2
1019 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
1020 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add i8 [[START_ADD_1]], [[START_ADD_1]]
1021 ; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add i8 [[START_ADD_2]], 1
1022 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl i8 [[START]], 3
1023 ; CHECK-NEXT: [[F_5:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_SHL_3]]
1024 ; CHECK-NEXT: ret i1 [[F_5]]
1027 %start.shl.4 = shl i8 %start, 4
1028 %c.1 = icmp ult i8 %start.shl.4, %high
1029 call void @llvm.assume(i1 %c.1)
1031 %start.shl.2 = shl i8 %start, 2
1032 %start.add.1 = add i8 %start, %start
1033 %start.add.2 = add i8 %start.add.1, %start.add.1
1034 %start.add.2.1 = add i8 %start.add.2, 1
1035 %start.shl.3 = shl i8 %start, 3
1036 %f.5 = icmp ult i8 %start.add.2, %start.shl.3
1040 define i1 @test_shl_const_no_nuw_unsigned_10(i8 %start, i8 %high) {
1041 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_10(
1042 ; CHECK-NEXT: entry:
1043 ; CHECK-NEXT: [[START_SHL_5:%.*]] = shl i8 [[START:%.*]], 5
1044 ; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_SHL_5]]
1045 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
1046 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl i8 [[START]], 3
1047 ; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_SHL_3]], [[START_SHL_5]]
1048 ; CHECK-NEXT: ret i1 [[T_1]]
1051 %start.shl.5 = shl i8 %start, 5
1052 %c.0 = icmp ult i8 %start, %start.shl.5
1053 call void @llvm.assume(i1 %c.0)
1055 %start.shl.3 = shl i8 %start, 3
1056 %t.1 = icmp ule i8 %start.shl.3, %start.shl.5
1060 define i1 @test_shl_const_no_nuw_unsigned_11(i8 %start, i8 %high) {
1061 ; CHECK-LABEL: @test_shl_const_no_nuw_unsigned_11(
1062 ; CHECK-NEXT: entry:
1063 ; CHECK-NEXT: [[START_SHL_5:%.*]] = shl i8 [[START:%.*]], 5
1064 ; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_SHL_5]]
1065 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
1066 ; CHECK-NEXT: [[START_SHL_3:%.*]] = shl i8 [[START]], 3
1067 ; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[START_SHL_5]], [[START_SHL_3]]
1068 ; CHECK-NEXT: ret i1 [[C_1]]
1071 %start.shl.5 = shl i8 %start, 5
1072 %c.0 = icmp ult i8 %start, %start.shl.5
1073 call void @llvm.assume(i1 %c.0)
1075 %start.shl.3 = shl i8 %start, 3
1076 %c.1 = icmp ule i8 %start.shl.5, %start.shl.3
1080 define i1 @test_shl_add_const_no_nuw_unsigned_1(i8 %start, i8 %high) {
1081 ; CHECK-LABEL: @test_shl_add_const_no_nuw_unsigned_1(
1082 ; CHECK-NEXT: entry:
1083 ; CHECK-NEXT: [[ADD:%.*]] = add i8 [[START:%.*]], 3
1084 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[ADD]], 4
1085 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
1086 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
1087 ; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[START]], [[HIGH]]
1088 ; CHECK-NEXT: ret i1 [[T_1]]
1091 %add = add i8 %start, 3
1092 %start.shl.4 = shl i8 %add, 4
1093 %c.1 = icmp ult i8 %start.shl.4, %high
1094 call void @llvm.assume(i1 %c.1)
1096 %t.1 = icmp ult i8 %start, %high
1100 define i1 @test_shl_add_const_no_nuw_unsigned_2(i8 %start, i8 %high) {
1101 ; CHECK-LABEL: @test_shl_add_const_no_nuw_unsigned_2(
1102 ; CHECK-NEXT: entry:
1103 ; CHECK-NEXT: [[ADD:%.*]] = add i8 [[START:%.*]], 3
1104 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[ADD]], 4
1105 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
1106 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
1107 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl i8 [[START]], 2
1108 ; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[START_SHL_2]], [[HIGH]]
1109 ; CHECK-NEXT: ret i1 [[T_2]]
1112 %add = add i8 %start, 3
1113 %start.shl.4 = shl i8 %add, 4
1114 %c.1 = icmp ult i8 %start.shl.4, %high
1115 call void @llvm.assume(i1 %c.1)
1117 %start.shl.2 = shl i8 %start, 2
1118 %t.2 = icmp ult i8 %start.shl.2, %high
1122 define i1 @test_shl_add_const_no_nuw_unsigned_3(i8 %start, i8 %high) {
1123 ; CHECK-LABEL: @test_shl_add_const_no_nuw_unsigned_3(
1124 ; CHECK-NEXT: entry:
1125 ; CHECK-NEXT: [[ADD:%.*]] = add i8 [[START:%.*]], 3
1126 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[ADD]], 4
1127 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
1128 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
1129 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
1130 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add i8 [[START_ADD_1]], [[START_ADD_1]]
1131 ; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[START_ADD_2]], [[START_SHL_4]]
1132 ; CHECK-NEXT: ret i1 [[T_3]]
1135 %add = add i8 %start, 3
1136 %start.shl.4 = shl i8 %add, 4
1137 %c.1 = icmp ult i8 %start.shl.4, %high
1138 call void @llvm.assume(i1 %c.1)
1140 %start.add.1 = add i8 %start, %start
1141 %start.add.2 = add i8 %start.add.1, %start.add.1
1142 %t.3 = icmp ule i8 %start.add.2, %start.shl.4
1146 define i1 @test_shl_add_const_no_nuw_unsigned_4(i8 %start, i8 %high) {
1147 ; CHECK-LABEL: @test_shl_add_const_no_nuw_unsigned_4(
1148 ; CHECK-NEXT: entry:
1149 ; CHECK-NEXT: [[ADD:%.*]] = add i8 [[START:%.*]], 3
1150 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[ADD]], 4
1151 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
1152 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
1153 ; CHECK-NEXT: [[START_SHL_2:%.*]] = shl i8 [[START]], 2
1154 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
1155 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add i8 [[START_ADD_1]], [[START_ADD_1]]
1156 ; CHECK-NEXT: [[T_4:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_SHL_4]]
1157 ; CHECK-NEXT: ret i1 [[T_4]]
1160 %add = add i8 %start, 3
1161 %start.shl.4 = shl i8 %add, 4
1162 %c.1 = icmp ult i8 %start.shl.4, %high
1163 call void @llvm.assume(i1 %c.1)
1165 %start.shl.2 = shl i8 %start, 2
1166 %start.add.1 = add i8 %start, %start
1167 %start.add.2 = add i8 %start.add.1, %start.add.1
1168 %t.4 = icmp ult i8 %start.add.2, %start.shl.4
1172 define i1 @test_shl_add_const_no_nuw_unsigned_5(i8 %start, i8 %high) {
1173 ; CHECK-LABEL: @test_shl_add_const_no_nuw_unsigned_5(
1174 ; CHECK-NEXT: entry:
1175 ; CHECK-NEXT: [[ADD:%.*]] = add i8 [[START:%.*]], 3
1176 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[ADD]], 4
1177 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
1178 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
1179 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
1180 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add i8 [[START_ADD_1]], [[START_ADD_1]]
1181 ; CHECK-NEXT: [[START_ADD_2_12:%.*]] = add i8 [[START_ADD_2]], 12
1182 ; CHECK-NEXT: [[T_5:%.*]] = icmp ule i8 [[START_ADD_2_12]], [[START_SHL_4]]
1183 ; CHECK-NEXT: ret i1 [[T_5]]
1186 %add = add i8 %start, 3
1187 %start.shl.4 = shl i8 %add, 4
1188 %c.1 = icmp ult i8 %start.shl.4, %high
1189 call void @llvm.assume(i1 %c.1)
1191 %start.add.1 = add i8 %start, %start
1192 %start.add.2 = add i8 %start.add.1, %start.add.1
1193 %start.add.2.12 = add i8 %start.add.2, 12
1194 %t.5 = icmp ule i8 %start.add.2.12, %start.shl.4
1198 define i1 @test_shl_add_const_no_nuw_unsigned_6(i8 %start, i8 %high) {
1199 ; CHECK-LABEL: @test_shl_add_const_no_nuw_unsigned_6(
1200 ; CHECK-NEXT: entry:
1201 ; CHECK-NEXT: [[ADD:%.*]] = add i8 [[START:%.*]], 3
1202 ; CHECK-NEXT: [[START_SHL_4:%.*]] = shl i8 [[ADD]], 4
1203 ; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_SHL_4]], [[HIGH:%.*]]
1204 ; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
1205 ; CHECK-NEXT: [[START_ADD_1:%.*]] = add i8 [[START]], [[START]]
1206 ; CHECK-NEXT: [[START_ADD_2:%.*]] = add i8 [[START_ADD_1]], [[START_ADD_1]]
1207 ; CHECK-NEXT: [[START_ADD_2_13:%.*]] = add i8 [[START_ADD_2]], 13
1208 ; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[START_ADD_2_13]], [[START_SHL_4]]
1209 ; CHECK-NEXT: ret i1 [[F_1]]
1212 %add = add i8 %start, 3
1213 %start.shl.4 = shl i8 %add, 4
1214 %c.1 = icmp ult i8 %start.shl.4, %high
1215 call void @llvm.assume(i1 %c.1)
1217 %start.add.1 = add i8 %start, %start
1218 %start.add.2 = add i8 %start.add.1, %start.add.1
1219 %start.add.2.13 = add i8 %start.add.2, 13
1220 %f.1 = icmp ule i8 %start.add.2.13, %start.shl.4
1224 define i1 @shl_overflow(i64 %start) {
1225 ; CHECK-LABEL: @shl_overflow(
1226 ; CHECK-NEXT: entry:
1227 ; CHECK-NEXT: [[PRE_COND:%.*]] = icmp ugt i64 [[START:%.*]], 0
1228 ; CHECK-NEXT: br i1 [[PRE_COND]], label [[MAIN:%.*]], label [[EXIT:%.*]]
1230 ; CHECK-NEXT: [[TMP0:%.*]] = shl nuw nsw i64 [[START]], -1
1231 ; CHECK-NEXT: [[TMP1:%.*]] = icmp uge i64 [[TMP0]], [[START]]
1232 ; CHECK-NEXT: ret i1 [[TMP1]]
1234 ; CHECK-NEXT: ret i1 false
1237 %pre.cond = icmp ugt i64 %start, 0
1238 br i1 %pre.cond, label %main, label %exit
1241 %0 = shl nuw nsw i64 %start, -1
1242 %1 = icmp uge i64 %0, %start
1250 define i1 @shl_overflow_2() {
1251 ; CHECK-LABEL: @shl_overflow_2(
1252 ; CHECK-NEXT: entry:
1253 ; CHECK-NEXT: [[SHL_UB:%.*]] = shl nuw nsw i256 0, 64
1254 ; CHECK-NEXT: [[SHL_CMP:%.*]] = icmp uge i256 [[SHL_UB]], 0
1255 ; CHECK-NEXT: ret i1 [[SHL_CMP]]
1258 %shl.ub = shl nuw nsw i256 0, 64
1259 %shl.cmp = icmp uge i256 %shl.ub, 0
1263 define i1 @shl_overflow_3() {
1264 ; CHECK-LABEL: @shl_overflow_3(
1265 ; CHECK-NEXT: entry:
1266 ; CHECK-NEXT: [[SHL_UB:%.*]] = shl nuw nsw i256 0, 65
1267 ; CHECK-NEXT: [[SHL_CMP:%.*]] = icmp uge i256 [[SHL_UB]], 0
1268 ; CHECK-NEXT: ret i1 [[SHL_CMP]]
1271 %shl.ub = shl nuw nsw i256 0, 65
1272 %shl.cmp = icmp uge i256 %shl.ub, 0
1276 define i1 @shl_55() {
1277 ; CHECK-LABEL: @shl_55(
1278 ; CHECK-NEXT: entry:
1279 ; CHECK-NEXT: [[SHL_UB:%.*]] = shl nuw nsw i256 1, 55
1280 ; CHECK-NEXT: [[SHL_CMP:%.*]] = icmp uge i256 [[SHL_UB]], 1
1281 ; CHECK-NEXT: ret i1 [[SHL_CMP]]
1284 %shl.ub = shl nuw nsw i256 1, 55
1285 %shl.cmp = icmp uge i256 %shl.ub, 1