1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -constraint-elimination -S %s | FileCheck %s
4 define void @test.not.uge.ult(i8 %start, i8 %low, i8 %high) {
5 ; CHECK-LABEL: @test.not.uge.ult(
7 ; CHECK-NEXT: [[SUB_PTR_I:%.*]] = sub i8 [[START:%.*]], 3
8 ; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[SUB_PTR_I]], [[HIGH:%.*]]
9 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
11 ; CHECK-NEXT: ret void
13 ; CHECK-NEXT: [[T_0:%.*]] = icmp ult i8 [[START]], [[HIGH]]
14 ; CHECK-NEXT: call void @use(i1 [[T_0]])
15 ; CHECK-NEXT: [[START_1:%.*]] = sub i8 [[START]], 1
16 ; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[START_1]], [[HIGH]]
17 ; CHECK-NEXT: call void @use(i1 [[T_1]])
18 ; CHECK-NEXT: [[START_2:%.*]] = sub i8 [[START]], 2
19 ; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[START_2]], [[HIGH]]
20 ; CHECK-NEXT: call void @use(i1 [[T_2]])
21 ; CHECK-NEXT: [[START_3:%.*]] = sub i8 [[START]], 3
22 ; CHECK-NEXT: [[T_3:%.*]] = icmp ult i8 [[START_3]], [[HIGH]]
23 ; CHECK-NEXT: call void @use(i1 [[T_3]])
24 ; CHECK-NEXT: [[START_4:%.*]] = sub i8 [[START]], 4
25 ; CHECK-NEXT: [[C_4:%.*]] = icmp ult i8 [[START_4]], [[HIGH]]
26 ; CHECK-NEXT: call void @use(i1 [[C_4]])
27 ; CHECK-NEXT: ret void
30 %sub.ptr.i = sub i8 %start, 3
31 %c.1 = icmp uge i8 %sub.ptr.i, %high
32 br i1 %c.1, label %if.then, label %if.end
34 if.then: ; preds = %entry
37 if.end: ; preds = %entry
38 %t.0 = icmp ult i8 %start, %high
39 call void @use(i1 %t.0)
40 %start.1 = sub i8 %start, 1
41 %t.1 = icmp ult i8 %start.1, %high
42 call void @use(i1 %t.1)
43 %start.2 = sub i8 %start, 2
44 %t.2 = icmp ult i8 %start.2, %high
45 call void @use(i1 %t.2)
46 %start.3 = sub i8 %start, 3
47 %t.3 = icmp ult i8 %start.3, %high
48 call void @use(i1 %t.3)
49 %start.4 = sub i8 %start, 4
50 %c.4 = icmp ult i8 %start.4, %high
51 call void @use(i1 %c.4)
55 define void @test.not.uge.ule(i8 %start, i8 %low, i8 %high) {
56 ; CHECK-LABEL: @test.not.uge.ule(
58 ; CHECK-NEXT: [[SUB_PTR_I:%.*]] = sub i8 [[START:%.*]], 3
59 ; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[SUB_PTR_I]], [[HIGH:%.*]]
60 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
62 ; CHECK-NEXT: ret void
64 ; CHECK-NEXT: [[T_0:%.*]] = icmp ule i8 [[START]], [[HIGH]]
65 ; CHECK-NEXT: call void @use(i1 [[T_0]])
66 ; CHECK-NEXT: [[START_1:%.*]] = sub i8 [[START]], 1
67 ; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_1]], [[HIGH]]
68 ; CHECK-NEXT: call void @use(i1 [[T_1]])
69 ; CHECK-NEXT: [[START_2:%.*]] = sub i8 [[START]], 2
70 ; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[START_2]], [[HIGH]]
71 ; CHECK-NEXT: call void @use(i1 [[T_2]])
72 ; CHECK-NEXT: [[START_3:%.*]] = sub i8 [[START]], 3
73 ; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[START_3]], [[HIGH]]
74 ; CHECK-NEXT: call void @use(i1 [[T_3]])
75 ; CHECK-NEXT: [[START_4:%.*]] = sub i8 [[START]], 4
76 ; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[START_4]], [[HIGH]]
77 ; CHECK-NEXT: call void @use(i1 [[T_4]])
78 ; CHECK-NEXT: [[START_5:%.*]] = sub i8 [[START]], 5
79 ; CHECK-NEXT: [[C_5:%.*]] = icmp ule i8 [[START_5]], [[HIGH]]
80 ; CHECK-NEXT: call void @use(i1 [[C_5]])
81 ; CHECK-NEXT: ret void
84 %sub.ptr.i = sub i8 %start, 3
85 %c.1 = icmp uge i8 %sub.ptr.i, %high
86 br i1 %c.1, label %if.then, label %if.end
88 if.then: ; preds = %entry
91 if.end: ; preds = %entry
92 %t.0 = icmp ule i8 %start, %high
93 call void @use(i1 %t.0)
94 %start.1 = sub i8 %start, 1
95 %t.1 = icmp ule i8 %start.1, %high
96 call void @use(i1 %t.1)
97 %start.2 = sub i8 %start, 2
98 %t.2 = icmp ule i8 %start.2, %high
99 call void @use(i1 %t.2)
100 %start.3 = sub i8 %start, 3
101 %t.3 = icmp ule i8 %start.3, %high
102 call void @use(i1 %t.3)
103 %start.4 = sub i8 %start, 4
104 %t.4 = icmp ule i8 %start.4, %high
105 call void @use(i1 %t.4)
107 %start.5 = sub i8 %start, 5
108 %c.5 = icmp ule i8 %start.5, %high
109 call void @use(i1 %c.5)
114 define void @test.not.uge.ugt(i8 %start, i8 %low, i8 %high) {
115 ; CHECK-LABEL: @test.not.uge.ugt(
117 ; CHECK-NEXT: [[SUB_PTR_I:%.*]] = sub i8 [[START:%.*]], 3
118 ; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[SUB_PTR_I]], [[HIGH:%.*]]
119 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
121 ; CHECK-NEXT: ret void
123 ; CHECK-NEXT: [[F_0:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
124 ; CHECK-NEXT: call void @use(i1 [[F_0]])
125 ; CHECK-NEXT: [[START_1:%.*]] = sub i8 [[START]], 1
126 ; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i8 [[START_1]], [[HIGH]]
127 ; CHECK-NEXT: call void @use(i1 [[F_1]])
128 ; CHECK-NEXT: [[START_2:%.*]] = sub i8 [[START]], 2
129 ; CHECK-NEXT: [[F_2:%.*]] = icmp ugt i8 [[START_2]], [[HIGH]]
130 ; CHECK-NEXT: call void @use(i1 [[F_2]])
131 ; CHECK-NEXT: [[START_3:%.*]] = sub i8 [[START]], 3
132 ; CHECK-NEXT: [[F_3:%.*]] = icmp ugt i8 [[START_3]], [[HIGH]]
133 ; CHECK-NEXT: call void @use(i1 [[F_3]])
134 ; CHECK-NEXT: [[START_4:%.*]] = sub i8 [[START]], 4
135 ; CHECK-NEXT: [[F_4:%.*]] = icmp ugt i8 [[START_4]], [[HIGH]]
136 ; CHECK-NEXT: call void @use(i1 [[F_4]])
137 ; CHECK-NEXT: [[START_5:%.*]] = sub i8 [[START]], 5
138 ; CHECK-NEXT: [[C_5:%.*]] = icmp ugt i8 [[START_5]], [[HIGH]]
139 ; CHECK-NEXT: call void @use(i1 [[C_5]])
140 ; CHECK-NEXT: ret void
143 %sub.ptr.i = sub i8 %start, 3
144 %c.1 = icmp uge i8 %sub.ptr.i, %high
145 br i1 %c.1, label %if.then, label %if.end
147 if.then: ; preds = %entry
150 if.end: ; preds = %entry
151 %f.0 = icmp ugt i8 %start, %high
152 call void @use(i1 %f.0)
154 %start.1 = sub i8 %start, 1
155 %f.1 = icmp ugt i8 %start.1, %high
156 call void @use(i1 %f.1)
158 %start.2 = sub i8 %start, 2
159 %f.2 = icmp ugt i8 %start.2, %high
160 call void @use(i1 %f.2)
162 %start.3 = sub i8 %start, 3
163 %f.3 = icmp ugt i8 %start.3, %high
164 call void @use(i1 %f.3)
166 %start.4 = sub i8 %start, 4
167 %f.4 = icmp ugt i8 %start.4, %high
168 call void @use(i1 %f.4)
170 %start.5 = sub i8 %start, 5
171 %c.5 = icmp ugt i8 %start.5, %high
172 call void @use(i1 %c.5)
177 define void @test.not.uge.uge(i8 %start, i8 %low, i8 %high) {
178 ; CHECK-LABEL: @test.not.uge.uge(
180 ; CHECK-NEXT: [[SUB_PTR_I:%.*]] = sub i8 [[START:%.*]], 3
181 ; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[SUB_PTR_I]], [[HIGH:%.*]]
182 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
184 ; CHECK-NEXT: ret void
186 ; CHECK-NEXT: [[F_0:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
187 ; CHECK-NEXT: call void @use(i1 [[F_0]])
188 ; CHECK-NEXT: [[START_1:%.*]] = sub i8 [[START]], 1
189 ; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[START_1]], [[HIGH]]
190 ; CHECK-NEXT: call void @use(i1 [[F_1]])
191 ; CHECK-NEXT: [[START_2:%.*]] = sub i8 [[START]], 2
192 ; CHECK-NEXT: [[F_2:%.*]] = icmp uge i8 [[START_2]], [[HIGH]]
193 ; CHECK-NEXT: call void @use(i1 [[F_2]])
194 ; CHECK-NEXT: [[START_3:%.*]] = sub i8 [[START]], 3
195 ; CHECK-NEXT: [[F_3:%.*]] = icmp uge i8 [[START_3]], [[HIGH]]
196 ; CHECK-NEXT: call void @use(i1 [[F_3]])
197 ; CHECK-NEXT: [[START_4:%.*]] = sub i8 [[START]], 4
198 ; CHECK-NEXT: [[C_4:%.*]] = icmp uge i8 [[START_4]], [[HIGH]]
199 ; CHECK-NEXT: call void @use(i1 [[C_4]])
200 ; CHECK-NEXT: [[START_5:%.*]] = sub i8 [[START]], 5
201 ; CHECK-NEXT: [[C_5:%.*]] = icmp uge i8 [[START_5]], [[HIGH]]
202 ; CHECK-NEXT: call void @use(i1 [[C_5]])
203 ; CHECK-NEXT: ret void
206 %sub.ptr.i = sub i8 %start, 3
207 %c.1 = icmp uge i8 %sub.ptr.i, %high
208 br i1 %c.1, label %if.then, label %if.end
210 if.then: ; preds = %entry
213 if.end: ; preds = %entry
214 %f.0 = icmp ugt i8 %start, %high
215 call void @use(i1 %f.0)
217 %start.1 = sub i8 %start, 1
218 %f.1 = icmp uge i8 %start.1, %high
219 call void @use(i1 %f.1)
221 %start.2 = sub i8 %start, 2
222 %f.2 = icmp uge i8 %start.2, %high
223 call void @use(i1 %f.2)
225 %start.3 = sub i8 %start, 3
226 %f.3 = icmp uge i8 %start.3, %high
227 call void @use(i1 %f.3)
229 %start.4 = sub i8 %start, 4
230 %c.4 = icmp uge i8 %start.4, %high
231 call void @use(i1 %c.4)
233 %start.5 = sub i8 %start, 5
234 %c.5 = icmp uge i8 %start.5, %high
235 call void @use(i1 %c.5)
241 declare void @use(i1)