1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s
4 ; The system for the function below grows quite large. Check to make sure
5 ; we can handle that scenario.
6 define void @test(i64 %x, ptr %y, ptr %z, ptr %w) {
8 ; CHECK-NEXT: [[TMP22:%.*]] = getelementptr inbounds i8, ptr [[Y:%.*]], i64 [[X:%.*]]
9 ; CHECK-NEXT: [[TMP26:%.*]] = icmp ult ptr [[TMP22]], [[Z:%.*]]
10 ; CHECK-NEXT: br i1 [[TMP26]], label [[BB28:%.*]], label [[EARLY_EXIT:%.*]]
12 ; CHECK-NEXT: unreachable
14 ; CHECK-NEXT: [[TMP29:%.*]] = getelementptr inbounds i8, ptr [[Y]], i64 [[X]]
15 ; CHECK-NEXT: [[TMP30:%.*]] = icmp ult ptr [[TMP29]], [[Z]]
16 ; CHECK-NEXT: br i1 [[TMP30]], label [[EARLY_EXIT]], label [[BB32:%.*]]
18 ; CHECK-NEXT: [[TMP33:%.*]] = icmp ult ptr [[TMP29]], [[Z]]
19 ; CHECK-NEXT: br i1 [[TMP33]], label [[BB35:%.*]], label [[EARLY_EXIT]]
21 ; CHECK-NEXT: [[TMP36:%.*]] = icmp ult ptr [[Y]], [[Z]]
22 ; CHECK-NEXT: br i1 [[TMP36]], label [[EARLY_EXIT]], label [[BB38:%.*]]
24 ; CHECK-NEXT: br i1 false, label [[EARLY_EXIT]], label [[BB43:%.*]]
26 ; CHECK-NEXT: [[TMP47:%.*]] = getelementptr inbounds i8, ptr [[W:%.*]], i64 [[X]]
27 ; CHECK-NEXT: [[TMP48:%.*]] = icmp ult ptr [[TMP47]], [[Y]]
28 ; CHECK-NEXT: br i1 [[TMP48]], label [[EARLY_EXIT]], label [[BB50:%.*]]
30 ; CHECK-NEXT: [[TMP52:%.*]] = getelementptr inbounds i8, ptr [[W]], i64 [[X]]
31 ; CHECK-NEXT: [[TMP53:%.*]] = icmp ult ptr [[TMP52]], [[Y]]
32 ; CHECK-NEXT: br i1 [[TMP53]], label [[EARLY_EXIT]], label [[BB55:%.*]]
34 ; CHECK-NEXT: [[TMP57:%.*]] = icmp ult ptr [[W]], [[Y]]
35 ; CHECK-NEXT: br i1 [[TMP57]], label [[BB59:%.*]], label [[EARLY_EXIT]]
37 ; CHECK-NEXT: call void @use(i1 true)
38 ; CHECK-NEXT: ret void
40 %tmp22 = getelementptr inbounds i8, ptr %y, i64 %x
41 %tmp26 = icmp ult ptr %tmp22, %z
42 br i1 %tmp26, label %bb28, label %early.exit
48 %tmp29 = getelementptr inbounds i8, ptr %y, i64 %x
49 %tmp30 = icmp ult ptr %tmp29, %z
50 br i1 %tmp30, label %early.exit, label %bb32
53 %tmp33 = icmp ult ptr %tmp29, %z
54 br i1 %tmp33, label %bb35, label %early.exit
57 %tmp36 = icmp ult ptr %y, %z
58 br i1 %tmp36, label %early.exit, label %bb38
61 %tmp41 = icmp ult ptr %y, %z
62 br i1 %tmp41, label %early.exit, label %bb43
65 %tmp47 = getelementptr inbounds i8, ptr %w, i64 %x
66 %tmp48 = icmp ult ptr %tmp47, %y
67 br i1 %tmp48, label %early.exit, label %bb50
70 %tmp52 = getelementptr inbounds i8, ptr %w, i64 %x
71 %tmp53 = icmp ult ptr %tmp52, %y
72 br i1 %tmp53, label %early.exit, label %bb55
75 %tmp57 = icmp ult ptr %w, %y
76 br i1 %tmp57, label %bb59, label %early.exit
79 %tmp60 = icmp ult ptr %w, %y
80 call void @use(i1 %tmp60)