1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=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: [[ADD_PTR_I:%.*]] = add i8 [[START:%.*]], 3
8 ; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[ADD_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:%.*]] = add 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:%.*]] = add 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:%.*]] = add 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:%.*]] = add 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 %add.ptr.i = add i8 %start, 3
31 %c.1 = icmp uge i8 %add.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 = add i8 %start, 1
41 %t.1 = icmp ult i8 %start.1, %high
42 call void @use(i1 %t.1)
43 %start.2 = add i8 %start, 2
44 %t.2 = icmp ult i8 %start.2, %high
45 call void @use(i1 %t.2)
46 %start.3 = add i8 %start, 3
47 %t.3 = icmp ult i8 %start.3, %high
48 call void @use(i1 %t.3)
49 %start.4 = add i8 %start, 4
50 %c.4 = icmp ult i8 %start.4, %high
51 call void @use(i1 %c.4)
55 define void @test.not.sge.ult(i8 %start, i8 %low, i8 %high) {
56 ; CHECK-LABEL: @test.not.sge.ult(
58 ; CHECK-NEXT: [[ADD_PTR_I:%.*]] = add i8 [[START:%.*]], 3
59 ; CHECK-NEXT: [[C_1:%.*]] = icmp sge i8 [[ADD_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 slt i8 [[START]], [[HIGH]]
65 ; CHECK-NEXT: call void @use(i1 [[T_0]])
66 ; CHECK-NEXT: [[START_1:%.*]] = add i8 [[START]], 1
67 ; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 [[START_1]], [[HIGH]]
68 ; CHECK-NEXT: call void @use(i1 [[T_1]])
69 ; CHECK-NEXT: [[START_2:%.*]] = add i8 [[START]], 2
70 ; CHECK-NEXT: [[T_2:%.*]] = icmp slt i8 [[START_2]], [[HIGH]]
71 ; CHECK-NEXT: call void @use(i1 [[T_2]])
72 ; CHECK-NEXT: [[START_3:%.*]] = add i8 [[START]], 3
73 ; CHECK-NEXT: [[T_3:%.*]] = icmp slt i8 [[START_3]], [[HIGH]]
74 ; CHECK-NEXT: call void @use(i1 [[T_3]])
75 ; CHECK-NEXT: [[START_4:%.*]] = add i8 [[START]], 4
76 ; CHECK-NEXT: [[C_4:%.*]] = icmp slt i8 [[START_4]], [[HIGH]]
77 ; CHECK-NEXT: call void @use(i1 [[C_4]])
78 ; CHECK-NEXT: ret void
81 %add.ptr.i = add i8 %start, 3
82 %c.1 = icmp sge i8 %add.ptr.i, %high
83 br i1 %c.1, label %if.then, label %if.end
85 if.then: ; preds = %entry
88 if.end: ; preds = %entry
89 %t.0 = icmp slt i8 %start, %high
90 call void @use(i1 %t.0)
91 %start.1 = add i8 %start, 1
92 %t.1 = icmp slt i8 %start.1, %high
93 call void @use(i1 %t.1)
94 %start.2 = add i8 %start, 2
95 %t.2 = icmp slt i8 %start.2, %high
96 call void @use(i1 %t.2)
97 %start.3 = add i8 %start, 3
98 %t.3 = icmp slt i8 %start.3, %high
99 call void @use(i1 %t.3)
100 %start.4 = add i8 %start, 4
101 %c.4 = icmp slt i8 %start.4, %high
102 call void @use(i1 %c.4)
106 define void @test.not.uge.ule(i8 %start, i8 %low, i8 %high) {
107 ; CHECK-LABEL: @test.not.uge.ule(
109 ; CHECK-NEXT: [[ADD_PTR_I:%.*]] = add i8 [[START:%.*]], 3
110 ; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[ADD_PTR_I]], [[HIGH:%.*]]
111 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
113 ; CHECK-NEXT: ret void
115 ; CHECK-NEXT: [[T_0:%.*]] = icmp ule i8 [[START]], [[HIGH]]
116 ; CHECK-NEXT: call void @use(i1 [[T_0]])
117 ; CHECK-NEXT: [[START_1:%.*]] = add i8 [[START]], 1
118 ; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_1]], [[HIGH]]
119 ; CHECK-NEXT: call void @use(i1 [[T_1]])
120 ; CHECK-NEXT: [[START_2:%.*]] = add i8 [[START]], 2
121 ; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[START_2]], [[HIGH]]
122 ; CHECK-NEXT: call void @use(i1 [[T_2]])
123 ; CHECK-NEXT: [[START_3:%.*]] = add i8 [[START]], 3
124 ; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[START_3]], [[HIGH]]
125 ; CHECK-NEXT: call void @use(i1 [[T_3]])
126 ; CHECK-NEXT: [[START_4:%.*]] = add i8 [[START]], 4
127 ; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[START_4]], [[HIGH]]
128 ; CHECK-NEXT: call void @use(i1 [[T_4]])
129 ; CHECK-NEXT: [[START_5:%.*]] = add i8 [[START]], 5
130 ; CHECK-NEXT: [[C_5:%.*]] = icmp ule i8 [[START_5]], [[HIGH]]
131 ; CHECK-NEXT: call void @use(i1 [[C_5]])
132 ; CHECK-NEXT: ret void
135 %add.ptr.i = add i8 %start, 3
136 %c.1 = icmp uge i8 %add.ptr.i, %high
137 br i1 %c.1, label %if.then, label %if.end
139 if.then: ; preds = %entry
142 if.end: ; preds = %entry
143 %t.0 = icmp ule i8 %start, %high
144 call void @use(i1 %t.0)
145 %start.1 = add i8 %start, 1
146 %t.1 = icmp ule i8 %start.1, %high
147 call void @use(i1 %t.1)
148 %start.2 = add i8 %start, 2
149 %t.2 = icmp ule i8 %start.2, %high
150 call void @use(i1 %t.2)
151 %start.3 = add i8 %start, 3
152 %t.3 = icmp ule i8 %start.3, %high
153 call void @use(i1 %t.3)
154 %start.4 = add i8 %start, 4
155 %t.4 = icmp ule i8 %start.4, %high
156 call void @use(i1 %t.4)
158 %start.5 = add i8 %start, 5
159 %c.5 = icmp ule i8 %start.5, %high
160 call void @use(i1 %c.5)
165 define void @test.not.uge.ugt(i8 %start, i8 %low, i8 %high) {
166 ; CHECK-LABEL: @test.not.uge.ugt(
168 ; CHECK-NEXT: [[ADD_PTR_I:%.*]] = add i8 [[START:%.*]], 3
169 ; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[ADD_PTR_I]], [[HIGH:%.*]]
170 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
172 ; CHECK-NEXT: ret void
174 ; CHECK-NEXT: [[F_0:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
175 ; CHECK-NEXT: call void @use(i1 [[F_0]])
176 ; CHECK-NEXT: [[START_1:%.*]] = add i8 [[START]], 1
177 ; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i8 [[START_1]], [[HIGH]]
178 ; CHECK-NEXT: call void @use(i1 [[F_1]])
179 ; CHECK-NEXT: [[START_2:%.*]] = add i8 [[START]], 2
180 ; CHECK-NEXT: [[F_2:%.*]] = icmp ugt i8 [[START_2]], [[HIGH]]
181 ; CHECK-NEXT: call void @use(i1 [[F_2]])
182 ; CHECK-NEXT: [[START_3:%.*]] = add i8 [[START]], 3
183 ; CHECK-NEXT: [[F_3:%.*]] = icmp ugt i8 [[START_3]], [[HIGH]]
184 ; CHECK-NEXT: call void @use(i1 [[F_3]])
185 ; CHECK-NEXT: [[START_4:%.*]] = add i8 [[START]], 4
186 ; CHECK-NEXT: [[F_4:%.*]] = icmp ugt i8 [[START_4]], [[HIGH]]
187 ; CHECK-NEXT: call void @use(i1 [[F_4]])
188 ; CHECK-NEXT: [[START_5:%.*]] = add i8 [[START]], 5
189 ; CHECK-NEXT: [[C_5:%.*]] = icmp ugt i8 [[START_5]], [[HIGH]]
190 ; CHECK-NEXT: call void @use(i1 [[C_5]])
191 ; CHECK-NEXT: ret void
194 %add.ptr.i = add i8 %start, 3
195 %c.1 = icmp uge i8 %add.ptr.i, %high
196 br i1 %c.1, label %if.then, label %if.end
198 if.then: ; preds = %entry
201 if.end: ; preds = %entry
202 %f.0 = icmp ugt i8 %start, %high
203 call void @use(i1 %f.0)
205 %start.1 = add i8 %start, 1
206 %f.1 = icmp ugt i8 %start.1, %high
207 call void @use(i1 %f.1)
209 %start.2 = add i8 %start, 2
210 %f.2 = icmp ugt i8 %start.2, %high
211 call void @use(i1 %f.2)
213 %start.3 = add i8 %start, 3
214 %f.3 = icmp ugt i8 %start.3, %high
215 call void @use(i1 %f.3)
217 %start.4 = add i8 %start, 4
218 %f.4 = icmp ugt i8 %start.4, %high
219 call void @use(i1 %f.4)
221 %start.5 = add i8 %start, 5
222 %c.5 = icmp ugt i8 %start.5, %high
223 call void @use(i1 %c.5)
228 define void @test.not.uge.uge(i8 %start, i8 %low, i8 %high) {
229 ; CHECK-LABEL: @test.not.uge.uge(
231 ; CHECK-NEXT: [[ADD_PTR_I:%.*]] = add i8 [[START:%.*]], 3
232 ; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[ADD_PTR_I]], [[HIGH:%.*]]
233 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
235 ; CHECK-NEXT: ret void
237 ; CHECK-NEXT: [[F_0:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
238 ; CHECK-NEXT: call void @use(i1 [[F_0]])
239 ; CHECK-NEXT: [[START_1:%.*]] = add i8 [[START]], 1
240 ; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[START_1]], [[HIGH]]
241 ; CHECK-NEXT: call void @use(i1 [[F_1]])
242 ; CHECK-NEXT: [[START_2:%.*]] = add i8 [[START]], 2
243 ; CHECK-NEXT: [[F_2:%.*]] = icmp uge i8 [[START_2]], [[HIGH]]
244 ; CHECK-NEXT: call void @use(i1 [[F_2]])
245 ; CHECK-NEXT: [[START_3:%.*]] = add i8 [[START]], 3
246 ; CHECK-NEXT: [[F_3:%.*]] = icmp uge i8 [[START_3]], [[HIGH]]
247 ; CHECK-NEXT: call void @use(i1 [[F_3]])
248 ; CHECK-NEXT: [[START_4:%.*]] = add i8 [[START]], 4
249 ; CHECK-NEXT: [[C_4:%.*]] = icmp uge i8 [[START_4]], [[HIGH]]
250 ; CHECK-NEXT: call void @use(i1 [[C_4]])
251 ; CHECK-NEXT: [[START_5:%.*]] = add i8 [[START]], 5
252 ; CHECK-NEXT: [[C_5:%.*]] = icmp uge i8 [[START_5]], [[HIGH]]
253 ; CHECK-NEXT: call void @use(i1 [[C_5]])
254 ; CHECK-NEXT: ret void
257 %add.ptr.i = add i8 %start, 3
258 %c.1 = icmp uge i8 %add.ptr.i, %high
259 br i1 %c.1, label %if.then, label %if.end
261 if.then: ; preds = %entry
264 if.end: ; preds = %entry
265 %f.0 = icmp ugt i8 %start, %high
266 call void @use(i1 %f.0)
268 %start.1 = add i8 %start, 1
269 %f.1 = icmp uge i8 %start.1, %high
270 call void @use(i1 %f.1)
272 %start.2 = add i8 %start, 2
273 %f.2 = icmp uge i8 %start.2, %high
274 call void @use(i1 %f.2)
276 %start.3 = add i8 %start, 3
277 %f.3 = icmp uge i8 %start.3, %high
278 call void @use(i1 %f.3)
280 %start.4 = add i8 %start, 4
281 %c.4 = icmp uge i8 %start.4, %high
282 call void @use(i1 %c.4)
284 %start.5 = add i8 %start, 5
285 %c.5 = icmp uge i8 %start.5, %high
286 call void @use(i1 %c.5)
292 declare void @use(i1)