1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -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, i8* %y, i8* %z, i8* %w) {
8 ; CHECK-NEXT: [[TMP22:%.*]] = getelementptr inbounds i8, i8* [[Y:%.*]], i64 [[X:%.*]]
9 ; CHECK-NEXT: [[TMP26:%.*]] = icmp ult i8* [[TMP22]], [[Z:%.*]]
10 ; CHECK-NEXT: br i1 [[TMP26]], label [[BB28:%.*]], label [[EARLY_EXIT:%.*]]
12 ; CHECK-NEXT: unreachable
14 ; CHECK-NEXT: [[TMP29:%.*]] = getelementptr inbounds i8, i8* [[Y]], i64 [[X]]
15 ; CHECK-NEXT: [[TMP30:%.*]] = icmp ult i8* [[TMP29]], [[Z]]
16 ; CHECK-NEXT: br i1 true, label [[EARLY_EXIT]], label [[BB32:%.*]]
18 ; CHECK-NEXT: [[TMP33:%.*]] = icmp ult i8* [[TMP29]], [[Z]]
19 ; CHECK-NEXT: br i1 true, label [[BB35:%.*]], label [[EARLY_EXIT]]
21 ; CHECK-NEXT: [[TMP36:%.*]] = icmp ult i8* [[Y]], [[Z]]
22 ; CHECK-NEXT: br i1 true, label [[EARLY_EXIT]], label [[BB38:%.*]]
24 ; CHECK-NEXT: [[TMP41:%.*]] = icmp ult i8* [[Y]], [[Z]]
25 ; CHECK-NEXT: br i1 true, label [[EARLY_EXIT]], label [[BB43:%.*]]
27 ; CHECK-NEXT: [[TMP47:%.*]] = getelementptr inbounds i8, i8* [[W:%.*]], i64 [[X]]
28 ; CHECK-NEXT: [[TMP48:%.*]] = icmp ult i8* [[TMP47]], [[Y]]
29 ; CHECK-NEXT: br i1 [[TMP48]], label [[EARLY_EXIT]], label [[BB50:%.*]]
31 ; CHECK-NEXT: [[TMP52:%.*]] = getelementptr inbounds i8, i8* [[W]], i64 [[X]]
32 ; CHECK-NEXT: [[TMP53:%.*]] = icmp ult i8* [[TMP52]], [[Y]]
33 ; CHECK-NEXT: br i1 true, label [[EARLY_EXIT]], label [[BB55:%.*]]
35 ; CHECK-NEXT: [[TMP57:%.*]] = icmp ult i8* [[W]], [[Y]]
36 ; CHECK-NEXT: br i1 true, label [[BB59:%.*]], label [[EARLY_EXIT]]
38 ; CHECK-NEXT: [[TMP60:%.*]] = icmp ult i8* [[W]], [[Y]]
39 ; CHECK-NEXT: call void @use(i1 true)
40 ; CHECK-NEXT: ret void
42 %tmp22 = getelementptr inbounds i8, i8* %y, i64 %x
43 %tmp26 = icmp ult i8* %tmp22, %z
44 br i1 %tmp26, label %bb28, label %early.exit
50 %tmp29 = getelementptr inbounds i8, i8* %y, i64 %x
51 %tmp30 = icmp ult i8* %tmp29, %z
52 br i1 %tmp30, label %early.exit, label %bb32
55 %tmp33 = icmp ult i8* %tmp29, %z
56 br i1 %tmp33, label %bb35, label %early.exit
59 %tmp36 = icmp ult i8* %y, %z
60 br i1 %tmp36, label %early.exit, label %bb38
63 %tmp41 = icmp ult i8* %y, %z
64 br i1 %tmp41, label %early.exit, label %bb43
67 %tmp47 = getelementptr inbounds i8, i8* %w, i64 %x
68 %tmp48 = icmp ult i8* %tmp47, %y
69 br i1 %tmp48, label %early.exit, label %bb50
72 %tmp52 = getelementptr inbounds i8, i8* %w, i64 %x
73 %tmp53 = icmp ult i8* %tmp52, %y
74 br i1 %tmp53, label %early.exit, label %bb55
77 %tmp57 = icmp ult i8* %w, %y
78 br i1 %tmp57, label %bb59, label %early.exit
81 %tmp60 = icmp ult i8* %w, %y
82 call void @use(i1 %tmp60)