1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -loop-idiom < %s -S | FileCheck %s
4 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
6 ; This only tests various forms of loop control-flow.
7 ; These tests are fully identical to bcmp()==0 otherwise.
11 ; bool pointer_iteration_const_size_no_overlap(char const* ptr) {
12 ; return std::equal(ptr, ptr + 8, ptr + 8);
14 ; bool pointer_iteration_const_size_partial_overlap(char const* ptr) {
15 ; return std::equal(ptr, ptr + 16, ptr + 8);
17 ; bool pointer_iteration_const_size_overlap_unknown(char const* ptr0, char const* ptr1) {
18 ; return std::equal(ptr0, ptr0 + 8, ptr1);
21 ; bool pointer_iteration_variable_size_no_overlap(char const* ptr, size_t count) {
22 ; return std::equal(ptr, ptr + count, ptr + count);
24 ; bool pointer_iteration_variable_size_partial_overlap(char const* ptr, size_t count) {
25 ; return std::equal(ptr, ptr + 2 * count, ptr + count);
27 ; bool pointer_iteration_variable_size_overlap_unknown(char const* ptr0, char const* ptr1, size_t count) {
28 ; return std::equal(ptr0, ptr0 + count, ptr1);
31 ; bool index_iteration_eq_const_size_no_overlap(char const* ptr) {
32 ; char const* ptr0 = ptr;
33 ; char const* ptr1 = ptr + 8;
34 ; for(size_t i = 0; i < 8; i++) {
35 ; if(ptr0[i] != ptr1[i])
40 ; bool index_iteration_eq_const_size_partial_overlap(char const* ptr) {
41 ; char const* ptr0 = ptr;
42 ; char const* ptr1 = ptr + 8;
43 ; for(size_t i = 0; i < 16; i++) {
44 ; if(ptr0[i] != ptr1[i])
49 ; bool index_iteration_eq_const_size_overlap_unknown(char const* ptr0, char const* ptr1) {
50 ; for(size_t i = 0; i < 8; i++) {
51 ; if(ptr0[i] != ptr1[i])
57 ; bool index_iteration_eq_variable_size_no_overlap(char const* ptr, size_t count) {
58 ; char const* ptr0 = ptr;
59 ; char const* ptr1 = ptr + count;
60 ; for(size_t i = 0; i < count; i++) {
61 ; if(ptr0[i] != ptr1[i])
66 ; bool index_iteration_eq_variable_size_partial_overlap(char const* ptr, size_t count) {
67 ; char const* ptr0 = ptr;
68 ; char const* ptr1 = ptr + count;
69 ; for(size_t i = 0; i < 2 * count; i++) {
70 ; if(ptr0[i] != ptr1[i])
75 ; bool index_iteration_eq_variable_size_overlap_unknown(char const* ptr0, char const* ptr1, size_t count) {
76 ; for(size_t i = 0; i < count; i++) {
77 ; if(ptr0[i] != ptr1[i])
83 ; bool index_iteration_starting_from_negative(char const* ptr0, char const* ptr1) {
84 ; for(int i = -4; i < 4; i++) {
85 ; if(ptr0[i] != ptr1[i])
91 ; bool combined_iteration_eq_const_size_no_overlap(char const* ptr) {
92 ; char const* ptr0 = ptr;
93 ; char const* ptr1 = ptr + 8;
94 ; for(size_t i = 0; i < 8; i++, ++ptr0, ++ptr1) {
100 ; bool combined_iteration_eq_const_size_partial_overlap(char const* ptr) {
101 ; char const* ptr0 = ptr;
102 ; char const* ptr1 = ptr + 8;
103 ; for(size_t i = 0; i < 16; i++, ++ptr0, ++ptr1) {
109 ; bool combined_iteration_eq_const_size_overlap_unknown(char const* ptr0, char const* ptr1) {
110 ; for(size_t i = 0; i < 8; i++, ++ptr0, ++ptr1) {
117 ; bool combined_iteration_eq_variable_size_no_overlap(char const* ptr, size_t count) {
118 ; char const* ptr0 = ptr;
119 ; char const* ptr1 = ptr + count;
120 ; for(size_t i = 0; i < count; i++, ++ptr0, ++ptr1) {
126 ; bool combined_iteration_eq_variable_size_partial_overlap(char const* ptr, size_t count) {
127 ; char const* ptr0 = ptr;
128 ; char const* ptr1 = ptr + count;
129 ; for(size_t i = 0; i < 2 * count; i++, ++ptr0, ++ptr1) {
135 ; bool combined_iteration_eq_variable_size_overlap_unknown(char const* ptr0, char const* ptr1, size_t count) {
136 ; for(size_t i = 0; i < count; i++, ++ptr0, ++ptr1) {
143 ; bool negated_pointer_iteration_variable_size_overlap_unknown(char const* ptr0, char const* ptr1, size_t count) {
144 ; return !std::equal(ptr0, ptr0 + count, ptr1);
147 ; bool integer_pointer_iteration_variable_size_overlap_unknown(int const* ptr0, int const* ptr1, size_t count) {
148 ; return std::equal(ptr0, ptr0 + count, ptr1);
151 ; bool small_index_iteration(char const* ptr0, char const* ptr1, int count) {
152 ; for(int i = 0; i < count; i++, ++ptr0, ++ptr1) {
159 ; bool three_pointer_iteration(char const* ptr0, char const* ptr0_end, char const* ptr1) {
160 ; return std::equal(ptr0, ptr0_end, ptr1);
163 ; int value_propagation(char const* ptr0, char const* ptr1, size_t count, int on_equal, int on_unequal) {
164 ; if(std::equal(ptr0, ptr0 + count, ptr1))
169 ; void callee_on_unequal();
170 ; void callee_on_success();
171 ; void multiple_exit_blocks(char const* ptr0, char const* ptr1, size_t count) {
172 ; if(!std::equal(ptr0, ptr0 + count, ptr1)) {
173 ; callee_on_unequal();
176 ; callee_on_success();
179 ; void multiple_phis(char const* ptr0, char const* ptr1, size_t count, char const* v0, char const* v1, char const* v2, char const* v3, char const** out0, char const** out1) {
180 ; char const *o0, *o1;
181 ; if(std::equal(ptr0, ptr0 + count, ptr1)) {
193 ; void loop_within_loop(size_t outer_count, char const** ptr0, char const** ptr1, size_t* count) {
194 ; for(size_t i = 0; i != outer_count; ++i)
195 ; sink(std::equal(ptr0[i], ptr0[i] + count[i], ptr1[i]));
198 ; void loop_within_loop_with_multiple_exit_blocks(size_t outer_count, char const** ptr0, char const** ptr1, size_t* count) {
199 ; for(size_t i = 0; i != outer_count; ++i) {
200 ; if(!std::equal(ptr0[i], ptr0[i] + count[i], ptr1[i])) {
201 ; callee_on_unequal();
204 ; callee_on_success();
208 ; void endless_loop_if_equal(int *a, int *b) {
210 ; for (int c = 0; c < 4; c++) {
217 ; bool load_of_bitcasts(char const* ptr0, float const* ptr1, size_t count) {
218 ; for(size_t i = 0; i < count; i++, ptr0 += sizeof(float), ptr1++) {
220 ; memcpy(&v0, ptr0, sizeof(float));
221 ; memcpy(&v1, ptr1, sizeof(float));
229 ; bool overlapping_loads(char const* ptr0, char const* ptr1, size_t count) {
230 ; for(size_t i = 0; i < count; i++, ptr0++, ptr1++) {
232 ; memcpy(&v0, ptr0, sizeof(float));
233 ; memcpy(&v1, ptr1, sizeof(float));
240 define i1 @_Z39pointer_iteration_const_size_no_overlapPKc(i8* %ptr) {
241 ; CHECK-LABEL: @_Z39pointer_iteration_const_size_no_overlapPKc(
243 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 8
244 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
245 ; CHECK: for.body.i.i:
246 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[ADD_PTR]], [[ENTRY:%.*]] ]
247 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I_IDX:%.*]] = phi i64 [ [[__FIRST1_ADDR_06_I_I_ADD:%.*]], [[FOR_INC_I_I]] ], [ 0, [[ENTRY]] ]
248 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[__FIRST1_ADDR_06_I_I_IDX]]
249 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I_PTR]]
250 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
251 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[V0]], [[V1]]
252 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]]
253 ; CHECK: for.inc.i.i:
254 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I_ADD]] = add nuw nsw i64 [[__FIRST1_ADDR_06_I_I_IDX]], 1
255 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
256 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i64 [[__FIRST1_ADDR_06_I_I_ADD]], 8
257 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]], label [[FOR_BODY_I_I]]
258 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
259 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ false, [[FOR_BODY_I_I]] ], [ true, [[FOR_INC_I_I]] ]
260 ; CHECK-NEXT: ret i1 [[RETVAL_0_I_I]]
263 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
264 br label %for.body.i.i
266 for.body.i.i: ; preds = %for.inc.i.i, %entry
267 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %add.ptr, %entry ]
268 %__first1.addr.06.i.i.idx = phi i64 [ %__first1.addr.06.i.i.add, %for.inc.i.i ], [ 0, %entry ]
269 %__first1.addr.06.i.i.ptr = getelementptr inbounds i8, i8* %ptr, i64 %__first1.addr.06.i.i.idx
270 %v0 = load i8, i8* %__first1.addr.06.i.i.ptr
271 %v1 = load i8, i8* %__first2.addr.07.i.i
272 %cmp.i.i.i = icmp eq i8 %v0, %v1
273 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
275 for.inc.i.i: ; preds = %for.body.i.i
276 %__first1.addr.06.i.i.add = add nuw nsw i64 %__first1.addr.06.i.i.idx, 1
277 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
278 %cmp.i.i = icmp eq i64 %__first1.addr.06.i.i.add, 8
279 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
281 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i
282 %retval.0.i.i = phi i1 [ false, %for.body.i.i ], [ true, %for.inc.i.i ]
286 define i1 @_Z44pointer_iteration_const_size_partial_overlapPKc(i8* %ptr) {
287 ; CHECK-LABEL: @_Z44pointer_iteration_const_size_partial_overlapPKc(
289 ; CHECK-NEXT: [[ADD_PTR1:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 8
290 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
291 ; CHECK: for.body.i.i:
292 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[ADD_PTR1]], [[ENTRY:%.*]] ]
293 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I_IDX:%.*]] = phi i64 [ [[__FIRST1_ADDR_06_I_I_ADD:%.*]], [[FOR_INC_I_I]] ], [ 0, [[ENTRY]] ]
294 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[__FIRST1_ADDR_06_I_I_IDX]]
295 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I_PTR]]
296 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
297 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[V0]], [[V1]]
298 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]]
299 ; CHECK: for.inc.i.i:
300 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I_ADD]] = add nuw nsw i64 [[__FIRST1_ADDR_06_I_I_IDX]], 1
301 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
302 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i64 [[__FIRST1_ADDR_06_I_I_ADD]], 16
303 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]], label [[FOR_BODY_I_I]]
304 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
305 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ false, [[FOR_BODY_I_I]] ], [ true, [[FOR_INC_I_I]] ]
306 ; CHECK-NEXT: ret i1 [[RETVAL_0_I_I]]
309 %add.ptr1 = getelementptr inbounds i8, i8* %ptr, i64 8
310 br label %for.body.i.i
312 for.body.i.i: ; preds = %for.inc.i.i, %entry
313 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %add.ptr1, %entry ]
314 %__first1.addr.06.i.i.idx = phi i64 [ %__first1.addr.06.i.i.add, %for.inc.i.i ], [ 0, %entry ]
315 %__first1.addr.06.i.i.ptr = getelementptr inbounds i8, i8* %ptr, i64 %__first1.addr.06.i.i.idx
316 %v0 = load i8, i8* %__first1.addr.06.i.i.ptr
317 %v1 = load i8, i8* %__first2.addr.07.i.i
318 %cmp.i.i.i = icmp eq i8 %v0, %v1
319 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
321 for.inc.i.i: ; preds = %for.body.i.i
322 %__first1.addr.06.i.i.add = add nuw nsw i64 %__first1.addr.06.i.i.idx, 1
323 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
324 %cmp.i.i = icmp eq i64 %__first1.addr.06.i.i.add, 16
325 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
327 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i
328 %retval.0.i.i = phi i1 [ false, %for.body.i.i ], [ true, %for.inc.i.i ]
332 define i1 @_Z44pointer_iteration_const_size_overlap_unknownPKcS0_(i8* %ptr0, i8* %ptr1) {
333 ; CHECK-LABEL: @_Z44pointer_iteration_const_size_overlap_unknownPKcS0_(
335 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
336 ; CHECK: for.body.i.i:
337 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[PTR1:%.*]], [[ENTRY:%.*]] ]
338 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I_IDX:%.*]] = phi i64 [ [[__FIRST1_ADDR_06_I_I_ADD:%.*]], [[FOR_INC_I_I]] ], [ 0, [[ENTRY]] ]
339 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR0:%.*]], i64 [[__FIRST1_ADDR_06_I_I_IDX]]
340 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I_PTR]]
341 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
342 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[V0]], [[V1]]
343 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]]
344 ; CHECK: for.inc.i.i:
345 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I_ADD]] = add nuw nsw i64 [[__FIRST1_ADDR_06_I_I_IDX]], 1
346 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
347 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i64 [[__FIRST1_ADDR_06_I_I_ADD]], 8
348 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]], label [[FOR_BODY_I_I]]
349 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
350 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ false, [[FOR_BODY_I_I]] ], [ true, [[FOR_INC_I_I]] ]
351 ; CHECK-NEXT: ret i1 [[RETVAL_0_I_I]]
354 br label %for.body.i.i
356 for.body.i.i: ; preds = %for.inc.i.i, %entry
357 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %ptr1, %entry ]
358 %__first1.addr.06.i.i.idx = phi i64 [ %__first1.addr.06.i.i.add, %for.inc.i.i ], [ 0, %entry ]
359 %__first1.addr.06.i.i.ptr = getelementptr inbounds i8, i8* %ptr0, i64 %__first1.addr.06.i.i.idx
360 %v0 = load i8, i8* %__first1.addr.06.i.i.ptr
361 %v1 = load i8, i8* %__first2.addr.07.i.i
362 %cmp.i.i.i = icmp eq i8 %v0, %v1
363 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
365 for.inc.i.i: ; preds = %for.body.i.i
366 %__first1.addr.06.i.i.add = add nuw nsw i64 %__first1.addr.06.i.i.idx, 1
367 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
368 %cmp.i.i = icmp eq i64 %__first1.addr.06.i.i.add, 8
369 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
371 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i
372 %retval.0.i.i = phi i1 [ false, %for.body.i.i ], [ true, %for.inc.i.i ]
376 define i1 @_Z42pointer_iteration_variable_size_no_overlapPKcm(i8* %ptr, i64 %count) {
377 ; CHECK-LABEL: @_Z42pointer_iteration_variable_size_no_overlapPKcm(
379 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 [[COUNT:%.*]]
380 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[COUNT]], 0
381 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
382 ; CHECK: for.body.i.i.preheader:
383 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
384 ; CHECK: for.body.i.i:
385 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[ADD_PTR]], [[FOR_BODY_I_I_PREHEADER]] ]
386 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[PTR]], [[FOR_BODY_I_I_PREHEADER]] ]
387 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
388 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
389 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[V0]], [[V1]]
390 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT:%.*]]
391 ; CHECK: for.inc.i.i:
392 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
393 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
394 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
395 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]], label [[FOR_BODY_I_I]]
396 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit.loopexit:
397 ; CHECK-NEXT: [[RETVAL_0_I_I_PH:%.*]] = phi i1 [ false, [[FOR_BODY_I_I]] ], [ true, [[FOR_INC_I_I]] ]
398 ; CHECK-NEXT: br label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]]
399 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
400 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RETVAL_0_I_I_PH]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
401 ; CHECK-NEXT: ret i1 [[RETVAL_0_I_I]]
404 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %count
405 %cmp5.i.i = icmp eq i64 %count, 0
406 br i1 %cmp5.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
408 for.body.i.i: ; preds = %entry, %for.inc.i.i
409 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %add.ptr, %entry ]
410 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %ptr, %entry ]
411 %v0 = load i8, i8* %__first1.addr.06.i.i
412 %v1 = load i8, i8* %__first2.addr.07.i.i
413 %cmp.i.i.i = icmp eq i8 %v0, %v1
414 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
416 for.inc.i.i: ; preds = %for.body.i.i
417 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
418 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
419 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %add.ptr
420 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
422 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i, %entry
423 %retval.0.i.i = phi i1 [ true, %entry ], [ true, %for.inc.i.i ], [ false, %for.body.i.i ]
427 define i1 @_Z47pointer_iteration_variable_size_partial_overlapPKcm(i8* %ptr, i64 %count) {
428 ; CHECK-LABEL: @_Z47pointer_iteration_variable_size_partial_overlapPKcm(
430 ; CHECK-NEXT: [[MUL:%.*]] = shl i64 [[COUNT:%.*]], 1
431 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 [[MUL]]
432 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[MUL]], 0
433 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
434 ; CHECK: for.body.i.i.preheader:
435 ; CHECK-NEXT: [[ADD_PTR1:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[COUNT]]
436 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
437 ; CHECK: for.body.i.i:
438 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[ADD_PTR1]], [[FOR_BODY_I_I_PREHEADER]] ]
439 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[PTR]], [[FOR_BODY_I_I_PREHEADER]] ]
440 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
441 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
442 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[V0]], [[V1]]
443 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT:%.*]]
444 ; CHECK: for.inc.i.i:
445 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
446 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
447 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
448 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]], label [[FOR_BODY_I_I]]
449 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit.loopexit:
450 ; CHECK-NEXT: [[RETVAL_0_I_I_PH:%.*]] = phi i1 [ false, [[FOR_BODY_I_I]] ], [ true, [[FOR_INC_I_I]] ]
451 ; CHECK-NEXT: br label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]]
452 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
453 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RETVAL_0_I_I_PH]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
454 ; CHECK-NEXT: ret i1 [[RETVAL_0_I_I]]
457 %mul = shl i64 %count, 1
458 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %mul
459 %cmp5.i.i = icmp eq i64 %mul, 0
460 br i1 %cmp5.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i.preheader
462 for.body.i.i.preheader: ; preds = %entry
463 %add.ptr1 = getelementptr inbounds i8, i8* %ptr, i64 %count
464 br label %for.body.i.i
466 for.body.i.i: ; preds = %for.body.i.i.preheader, %for.inc.i.i
467 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %add.ptr1, %for.body.i.i.preheader ]
468 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %ptr, %for.body.i.i.preheader ]
469 %v0 = load i8, i8* %__first1.addr.06.i.i
470 %v1 = load i8, i8* %__first2.addr.07.i.i
471 %cmp.i.i.i = icmp eq i8 %v0, %v1
472 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
474 for.inc.i.i: ; preds = %for.body.i.i
475 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
476 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
477 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %add.ptr
478 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
480 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i, %entry
481 %retval.0.i.i = phi i1 [ true, %entry ], [ true, %for.inc.i.i ], [ false, %for.body.i.i ]
485 define i1 @_Z47pointer_iteration_variable_size_overlap_unknownPKcS0_m(i8* %ptr0, i8* %ptr1, i64 %count) {
486 ; CHECK-LABEL: @_Z47pointer_iteration_variable_size_overlap_unknownPKcS0_m(
488 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR0:%.*]], i64 [[COUNT:%.*]]
489 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[COUNT]], 0
490 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
491 ; CHECK: for.body.i.i.preheader:
492 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
493 ; CHECK: for.body.i.i:
494 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[PTR1:%.*]], [[FOR_BODY_I_I_PREHEADER]] ]
495 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[PTR0]], [[FOR_BODY_I_I_PREHEADER]] ]
496 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
497 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
498 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[V0]], [[V1]]
499 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT:%.*]]
500 ; CHECK: for.inc.i.i:
501 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
502 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
503 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
504 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]], label [[FOR_BODY_I_I]]
505 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit.loopexit:
506 ; CHECK-NEXT: [[RETVAL_0_I_I_PH:%.*]] = phi i1 [ false, [[FOR_BODY_I_I]] ], [ true, [[FOR_INC_I_I]] ]
507 ; CHECK-NEXT: br label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]]
508 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
509 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RETVAL_0_I_I_PH]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
510 ; CHECK-NEXT: ret i1 [[RETVAL_0_I_I]]
513 %add.ptr = getelementptr inbounds i8, i8* %ptr0, i64 %count
514 %cmp5.i.i = icmp eq i64 %count, 0
515 br i1 %cmp5.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
517 for.body.i.i: ; preds = %entry, %for.inc.i.i
518 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %ptr1, %entry ]
519 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %ptr0, %entry ]
520 %v0 = load i8, i8* %__first1.addr.06.i.i
521 %v1 = load i8, i8* %__first2.addr.07.i.i
522 %cmp.i.i.i = icmp eq i8 %v0, %v1
523 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
525 for.inc.i.i: ; preds = %for.body.i.i
526 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
527 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
528 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %add.ptr
529 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
531 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i, %entry
532 %retval.0.i.i = phi i1 [ true, %entry ], [ true, %for.inc.i.i ], [ false, %for.body.i.i ]
536 define i1 @_Z40index_iteration_eq_const_size_no_overlapPKc(i8* %ptr) {
537 ; CHECK-LABEL: @_Z40index_iteration_eq_const_size_no_overlapPKc(
539 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 8
540 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
542 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC:%.*]], 8
543 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
545 ; CHECK-NEXT: [[I_013:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INC]], [[FOR_COND:%.*]] ]
546 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[I_013]]
547 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[ARRAYIDX]]
548 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, i8* [[ADD_PTR]], i64 [[I_013]]
549 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[ARRAYIDX1]]
550 ; CHECK-NEXT: [[CMP3:%.*]] = icmp eq i8 [[V0]], [[V1]]
551 ; CHECK-NEXT: [[INC]] = add nuw nsw i64 [[I_013]], 1
552 ; CHECK-NEXT: br i1 [[CMP3]], label [[FOR_COND]], label [[CLEANUP]]
554 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_COND]] ]
555 ; CHECK-NEXT: ret i1 [[RES]]
558 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
561 for.cond: ; preds = %for.body
562 %cmp = icmp ult i64 %inc, 8
563 br i1 %cmp, label %for.body, label %cleanup
565 for.body: ; preds = %entry, %for.cond
566 %i.013 = phi i64 [ 0, %entry ], [ %inc, %for.cond ]
567 %arrayidx = getelementptr inbounds i8, i8* %ptr, i64 %i.013
568 %v0 = load i8, i8* %arrayidx
569 %arrayidx1 = getelementptr inbounds i8, i8* %add.ptr, i64 %i.013
570 %v1 = load i8, i8* %arrayidx1
571 %cmp3 = icmp eq i8 %v0, %v1
572 %inc = add nuw nsw i64 %i.013, 1
573 br i1 %cmp3, label %for.cond, label %cleanup
575 cleanup: ; preds = %for.cond, %for.body
576 %res = phi i1 [ false, %for.body ], [ true, %for.cond ]
580 define i1 @_Z45index_iteration_eq_const_size_partial_overlapPKc(i8* %ptr) {
581 ; CHECK-LABEL: @_Z45index_iteration_eq_const_size_partial_overlapPKc(
583 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 8
584 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
586 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC:%.*]], 16
587 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
589 ; CHECK-NEXT: [[I_013:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INC]], [[FOR_COND:%.*]] ]
590 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[I_013]]
591 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[ARRAYIDX]]
592 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, i8* [[ADD_PTR]], i64 [[I_013]]
593 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[ARRAYIDX1]]
594 ; CHECK-NEXT: [[CMP3:%.*]] = icmp eq i8 [[V0]], [[V1]]
595 ; CHECK-NEXT: [[INC]] = add nuw nsw i64 [[I_013]], 1
596 ; CHECK-NEXT: br i1 [[CMP3]], label [[FOR_COND]], label [[CLEANUP]]
598 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_COND]] ]
599 ; CHECK-NEXT: ret i1 [[RES]]
602 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
605 for.cond: ; preds = %for.body
606 %cmp = icmp ult i64 %inc, 16
607 br i1 %cmp, label %for.body, label %cleanup
609 for.body: ; preds = %entry, %for.cond
610 %i.013 = phi i64 [ 0, %entry ], [ %inc, %for.cond ]
611 %arrayidx = getelementptr inbounds i8, i8* %ptr, i64 %i.013
612 %v0 = load i8, i8* %arrayidx
613 %arrayidx1 = getelementptr inbounds i8, i8* %add.ptr, i64 %i.013
614 %v1 = load i8, i8* %arrayidx1
615 %cmp3 = icmp eq i8 %v0, %v1
616 %inc = add nuw nsw i64 %i.013, 1
617 br i1 %cmp3, label %for.cond, label %cleanup
619 cleanup: ; preds = %for.cond, %for.body
620 %res = phi i1 [ false, %for.body ], [ true, %for.cond ]
624 define i1 @_Z45index_iteration_eq_const_size_overlap_unknownPKcS0_(i8* %ptr0, i8* %ptr1) {
625 ; CHECK-LABEL: @_Z45index_iteration_eq_const_size_overlap_unknownPKcS0_(
627 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
629 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC:%.*]], 8
630 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
632 ; CHECK-NEXT: [[I_08:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INC]], [[FOR_COND:%.*]] ]
633 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[PTR0:%.*]], i64 [[I_08]]
634 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[ARRAYIDX]]
635 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, i8* [[PTR1:%.*]], i64 [[I_08]]
636 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[ARRAYIDX1]]
637 ; CHECK-NEXT: [[CMP3:%.*]] = icmp eq i8 [[V0]], [[V1]]
638 ; CHECK-NEXT: [[INC]] = add nuw nsw i64 [[I_08]], 1
639 ; CHECK-NEXT: br i1 [[CMP3]], label [[FOR_COND]], label [[CLEANUP]]
641 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_COND]] ]
642 ; CHECK-NEXT: ret i1 [[RES]]
647 for.cond: ; preds = %for.body
648 %cmp = icmp ult i64 %inc, 8
649 br i1 %cmp, label %for.body, label %cleanup
651 for.body: ; preds = %entry, %for.cond
652 %i.08 = phi i64 [ 0, %entry ], [ %inc, %for.cond ]
653 %arrayidx = getelementptr inbounds i8, i8* %ptr0, i64 %i.08
654 %v0 = load i8, i8* %arrayidx
655 %arrayidx1 = getelementptr inbounds i8, i8* %ptr1, i64 %i.08
656 %v1 = load i8, i8* %arrayidx1
657 %cmp3 = icmp eq i8 %v0, %v1
658 %inc = add nuw nsw i64 %i.08, 1
659 br i1 %cmp3, label %for.cond, label %cleanup
661 cleanup: ; preds = %for.cond, %for.body
662 %res = phi i1 [ false, %for.body ], [ true, %for.cond ]
666 define i1 @_Z43index_iteration_eq_variable_size_no_overlapPKcm(i8* %ptr, i64 %count) {
667 ; CHECK-LABEL: @_Z43index_iteration_eq_variable_size_no_overlapPKcm(
669 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 [[COUNT:%.*]]
670 ; CHECK-NEXT: [[CMP14:%.*]] = icmp eq i64 [[COUNT]], 0
671 ; CHECK-NEXT: br i1 [[CMP14]], label [[CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
672 ; CHECK: for.body.preheader:
673 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
675 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC:%.*]], [[COUNT]]
676 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP_LOOPEXIT:%.*]]
678 ; CHECK-NEXT: [[I_015:%.*]] = phi i64 [ [[INC]], [[FOR_COND:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
679 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[I_015]]
680 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[ARRAYIDX]]
681 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, i8* [[ADD_PTR]], i64 [[I_015]]
682 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[ARRAYIDX1]]
683 ; CHECK-NEXT: [[CMP3:%.*]] = icmp eq i8 [[V0]], [[V1]]
684 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_015]], 1
685 ; CHECK-NEXT: br i1 [[CMP3]], label [[FOR_COND]], label [[CLEANUP_LOOPEXIT]]
686 ; CHECK: cleanup.loopexit:
687 ; CHECK-NEXT: [[RES_PH:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_COND]] ]
688 ; CHECK-NEXT: br label [[CLEANUP]]
690 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RES_PH]], [[CLEANUP_LOOPEXIT]] ]
691 ; CHECK-NEXT: ret i1 [[RES]]
694 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %count
695 %cmp14 = icmp eq i64 %count, 0
696 br i1 %cmp14, label %cleanup, label %for.body
698 for.cond: ; preds = %for.body
699 %cmp = icmp ult i64 %inc, %count
700 br i1 %cmp, label %for.body, label %cleanup
702 for.body: ; preds = %entry, %for.cond
703 %i.015 = phi i64 [ %inc, %for.cond ], [ 0, %entry ]
704 %arrayidx = getelementptr inbounds i8, i8* %ptr, i64 %i.015
705 %v0 = load i8, i8* %arrayidx
706 %arrayidx1 = getelementptr inbounds i8, i8* %add.ptr, i64 %i.015
707 %v1 = load i8, i8* %arrayidx1
708 %cmp3 = icmp eq i8 %v0, %v1
709 %inc = add nuw i64 %i.015, 1
710 br i1 %cmp3, label %for.cond, label %cleanup
712 cleanup: ; preds = %for.body, %for.cond, %entry
713 %res = phi i1 [ true, %entry ], [ true, %for.cond ], [ false, %for.body ]
717 define i1 @_Z48index_iteration_eq_variable_size_partial_overlapPKcm(i8* %ptr, i64 %count) {
718 ; CHECK-LABEL: @_Z48index_iteration_eq_variable_size_partial_overlapPKcm(
720 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 [[COUNT:%.*]]
721 ; CHECK-NEXT: [[MUL:%.*]] = shl i64 [[COUNT]], 1
722 ; CHECK-NEXT: [[CMP14:%.*]] = icmp eq i64 [[MUL]], 0
723 ; CHECK-NEXT: br i1 [[CMP14]], label [[CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
724 ; CHECK: for.body.preheader:
725 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
727 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC:%.*]], [[MUL]]
728 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP_LOOPEXIT:%.*]]
730 ; CHECK-NEXT: [[I_015:%.*]] = phi i64 [ [[INC]], [[FOR_COND:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
731 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i64 [[I_015]]
732 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[ARRAYIDX]]
733 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, i8* [[ADD_PTR]], i64 [[I_015]]
734 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[ARRAYIDX1]]
735 ; CHECK-NEXT: [[CMP3:%.*]] = icmp eq i8 [[V0]], [[V1]]
736 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_015]], 1
737 ; CHECK-NEXT: br i1 [[CMP3]], label [[FOR_COND]], label [[CLEANUP_LOOPEXIT]]
738 ; CHECK: cleanup.loopexit:
739 ; CHECK-NEXT: [[RES_PH:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_COND]] ]
740 ; CHECK-NEXT: br label [[CLEANUP]]
742 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RES_PH]], [[CLEANUP_LOOPEXIT]] ]
743 ; CHECK-NEXT: ret i1 [[RES]]
746 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %count
747 %mul = shl i64 %count, 1
748 %cmp14 = icmp eq i64 %mul, 0
749 br i1 %cmp14, label %cleanup, label %for.body
751 for.cond: ; preds = %for.body
752 %cmp = icmp ult i64 %inc, %mul
753 br i1 %cmp, label %for.body, label %cleanup
755 for.body: ; preds = %entry, %for.cond
756 %i.015 = phi i64 [ %inc, %for.cond ], [ 0, %entry ]
757 %arrayidx = getelementptr inbounds i8, i8* %ptr, i64 %i.015
758 %v0 = load i8, i8* %arrayidx
759 %arrayidx1 = getelementptr inbounds i8, i8* %add.ptr, i64 %i.015
760 %v1 = load i8, i8* %arrayidx1
761 %cmp3 = icmp eq i8 %v0, %v1
762 %inc = add nuw i64 %i.015, 1
763 br i1 %cmp3, label %for.cond, label %cleanup
765 cleanup: ; preds = %for.body, %for.cond, %entry
766 %res = phi i1 [ true, %entry ], [ true, %for.cond ], [ false, %for.body ]
770 define i1 @_Z48index_iteration_eq_variable_size_overlap_unknownPKcS0_m(i8* %ptr0, i8* %ptr1, i64 %count) {
771 ; CHECK-LABEL: @_Z48index_iteration_eq_variable_size_overlap_unknownPKcS0_m(
773 ; CHECK-NEXT: [[CMP8:%.*]] = icmp eq i64 [[COUNT:%.*]], 0
774 ; CHECK-NEXT: br i1 [[CMP8]], label [[CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
775 ; CHECK: for.body.preheader:
776 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
778 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC:%.*]], [[COUNT]]
779 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP_LOOPEXIT:%.*]]
781 ; CHECK-NEXT: [[I_09:%.*]] = phi i64 [ [[INC]], [[FOR_COND:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
782 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[PTR0:%.*]], i64 [[I_09]]
783 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[ARRAYIDX]]
784 ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, i8* [[PTR1:%.*]], i64 [[I_09]]
785 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[ARRAYIDX1]]
786 ; CHECK-NEXT: [[CMP3:%.*]] = icmp eq i8 [[V0]], [[V1]]
787 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_09]], 1
788 ; CHECK-NEXT: br i1 [[CMP3]], label [[FOR_COND]], label [[CLEANUP_LOOPEXIT]]
789 ; CHECK: cleanup.loopexit:
790 ; CHECK-NEXT: [[RES_PH:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_COND]] ]
791 ; CHECK-NEXT: br label [[CLEANUP]]
793 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RES_PH]], [[CLEANUP_LOOPEXIT]] ]
794 ; CHECK-NEXT: ret i1 [[RES]]
797 %cmp8 = icmp eq i64 %count, 0
798 br i1 %cmp8, label %cleanup, label %for.body
800 for.cond: ; preds = %for.body
801 %cmp = icmp ult i64 %inc, %count
802 br i1 %cmp, label %for.body, label %cleanup
804 for.body: ; preds = %entry, %for.cond
805 %i.09 = phi i64 [ %inc, %for.cond ], [ 0, %entry ]
806 %arrayidx = getelementptr inbounds i8, i8* %ptr0, i64 %i.09
807 %v0 = load i8, i8* %arrayidx
808 %arrayidx1 = getelementptr inbounds i8, i8* %ptr1, i64 %i.09
809 %v1 = load i8, i8* %arrayidx1
810 %cmp3 = icmp eq i8 %v0, %v1
811 %inc = add nuw i64 %i.09, 1
812 br i1 %cmp3, label %for.cond, label %cleanup
814 cleanup: ; preds = %for.body, %for.cond, %entry
815 %res = phi i1 [ true, %entry ], [ true, %for.cond ], [ false, %for.body ]
819 define i1 @_Z38index_iteration_starting_from_negativePKcS0_(i8* %ptr0, i8* %ptr1) {
820 ; CHECK-LABEL: @_Z38index_iteration_starting_from_negativePKcS0_(
822 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
824 ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i64 [[INDVARS_IV_NEXT:%.*]], 4
825 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP:%.*]]
827 ; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ -4, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT]], [[FOR_COND:%.*]] ]
828 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[PTR0:%.*]], i64 [[INDVARS_IV]]
829 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[ARRAYIDX]]
830 ; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i8, i8* [[PTR1:%.*]], i64 [[INDVARS_IV]]
831 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[ARRAYIDX2]]
832 ; CHECK-NEXT: [[CMP4:%.*]] = icmp eq i8 [[V0]], [[V1]]
833 ; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], 1
834 ; CHECK-NEXT: br i1 [[CMP4]], label [[FOR_COND]], label [[CLEANUP]]
836 ; CHECK-NEXT: [[RET:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_COND]] ]
837 ; CHECK-NEXT: ret i1 [[RET]]
842 for.cond: ; preds = %for.body
843 %cmp = icmp slt i64 %indvars.iv.next, 4
844 br i1 %cmp, label %for.body, label %cleanup
846 for.body: ; preds = %entry, %for.cond
847 %indvars.iv = phi i64 [ -4, %entry ], [ %indvars.iv.next, %for.cond ]
848 %arrayidx = getelementptr inbounds i8, i8* %ptr0, i64 %indvars.iv
849 %v0 = load i8, i8* %arrayidx
850 %arrayidx2 = getelementptr inbounds i8, i8* %ptr1, i64 %indvars.iv
851 %v1 = load i8, i8* %arrayidx2
852 %cmp4 = icmp eq i8 %v0, %v1
853 %indvars.iv.next = add nsw i64 %indvars.iv, 1
854 br i1 %cmp4, label %for.cond, label %cleanup
856 cleanup: ; preds = %for.cond, %for.body
857 %ret = phi i1 [ false, %for.body ], [ true, %for.cond ]
861 define i1 @_Z43combined_iteration_eq_const_size_no_overlapPKc(i8* %ptr) {
862 ; CHECK-LABEL: @_Z43combined_iteration_eq_const_size_no_overlapPKc(
864 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 8
865 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
867 ; CHECK-NEXT: [[I_015:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_INC:%.*]] ]
868 ; CHECK-NEXT: [[PTR1_014:%.*]] = phi i8* [ [[ADD_PTR]], [[ENTRY]] ], [ [[INCDEC_PTR3:%.*]], [[FOR_INC]] ]
869 ; CHECK-NEXT: [[PTR0_013:%.*]] = phi i8* [ [[PTR]], [[ENTRY]] ], [ [[INCDEC_PTR:%.*]], [[FOR_INC]] ]
870 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[PTR0_013]]
871 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[PTR1_014]]
872 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[V0]], [[V1]]
873 ; CHECK-NEXT: br i1 [[CMP2]], label [[FOR_INC]], label [[CLEANUP:%.*]]
875 ; CHECK-NEXT: [[INC]] = add nuw nsw i64 [[I_015]], 1
876 ; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i8, i8* [[PTR0_013]], i64 1
877 ; CHECK-NEXT: [[INCDEC_PTR3]] = getelementptr inbounds i8, i8* [[PTR1_014]], i64 1
878 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], 8
879 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP]]
881 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_INC]] ]
882 ; CHECK-NEXT: ret i1 [[RES]]
885 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
888 for.body: ; preds = %entry, %for.inc
889 %i.015 = phi i64 [ 0, %entry ], [ %inc, %for.inc ]
890 %ptr1.014 = phi i8* [ %add.ptr, %entry ], [ %incdec.ptr3, %for.inc ]
891 %ptr0.013 = phi i8* [ %ptr, %entry ], [ %incdec.ptr, %for.inc ]
892 %v0 = load i8, i8* %ptr0.013
893 %v1 = load i8, i8* %ptr1.014
894 %cmp2 = icmp eq i8 %v0, %v1
895 br i1 %cmp2, label %for.inc, label %cleanup
897 for.inc: ; preds = %for.body
898 %inc = add nuw nsw i64 %i.015, 1
899 %incdec.ptr = getelementptr inbounds i8, i8* %ptr0.013, i64 1
900 %incdec.ptr3 = getelementptr inbounds i8, i8* %ptr1.014, i64 1
901 %cmp = icmp ult i64 %inc, 8
902 br i1 %cmp, label %for.body, label %cleanup
904 cleanup: ; preds = %for.inc, %for.body
905 %res = phi i1 [ false, %for.body ], [ true, %for.inc ]
909 define i1 @_Z48combined_iteration_eq_const_size_partial_overlapPKc(i8* %ptr) {
910 ; CHECK-LABEL: @_Z48combined_iteration_eq_const_size_partial_overlapPKc(
912 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 8
913 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
915 ; CHECK-NEXT: [[I_015:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_INC:%.*]] ]
916 ; CHECK-NEXT: [[PTR1_014:%.*]] = phi i8* [ [[ADD_PTR]], [[ENTRY]] ], [ [[INCDEC_PTR3:%.*]], [[FOR_INC]] ]
917 ; CHECK-NEXT: [[PTR0_013:%.*]] = phi i8* [ [[PTR]], [[ENTRY]] ], [ [[INCDEC_PTR:%.*]], [[FOR_INC]] ]
918 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[PTR0_013]]
919 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[PTR1_014]]
920 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[V0]], [[V1]]
921 ; CHECK-NEXT: br i1 [[CMP2]], label [[FOR_INC]], label [[CLEANUP:%.*]]
923 ; CHECK-NEXT: [[INC]] = add nuw nsw i64 [[I_015]], 1
924 ; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i8, i8* [[PTR0_013]], i64 1
925 ; CHECK-NEXT: [[INCDEC_PTR3]] = getelementptr inbounds i8, i8* [[PTR1_014]], i64 1
926 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], 16
927 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP]]
929 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_INC]] ]
930 ; CHECK-NEXT: ret i1 [[RES]]
933 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 8
936 for.body: ; preds = %entry, %for.inc
937 %i.015 = phi i64 [ 0, %entry ], [ %inc, %for.inc ]
938 %ptr1.014 = phi i8* [ %add.ptr, %entry ], [ %incdec.ptr3, %for.inc ]
939 %ptr0.013 = phi i8* [ %ptr, %entry ], [ %incdec.ptr, %for.inc ]
940 %v0 = load i8, i8* %ptr0.013
941 %v1 = load i8, i8* %ptr1.014
942 %cmp2 = icmp eq i8 %v0, %v1
943 br i1 %cmp2, label %for.inc, label %cleanup
945 for.inc: ; preds = %for.body
946 %inc = add nuw nsw i64 %i.015, 1
947 %incdec.ptr = getelementptr inbounds i8, i8* %ptr0.013, i64 1
948 %incdec.ptr3 = getelementptr inbounds i8, i8* %ptr1.014, i64 1
949 %cmp = icmp ult i64 %inc, 16
950 br i1 %cmp, label %for.body, label %cleanup
952 cleanup: ; preds = %for.inc, %for.body
953 %res = phi i1 [ false, %for.body ], [ true, %for.inc ]
957 define i1 @_Z48combined_iteration_eq_const_size_overlap_unknownPKcS0_(i8* %ptr0, i8* %ptr1) {
958 ; CHECK-LABEL: @_Z48combined_iteration_eq_const_size_overlap_unknownPKcS0_(
960 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
962 ; CHECK-NEXT: [[I_010:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_INC:%.*]] ]
963 ; CHECK-NEXT: [[PTR1_ADDR_09:%.*]] = phi i8* [ [[PTR1:%.*]], [[ENTRY]] ], [ [[INCDEC_PTR3:%.*]], [[FOR_INC]] ]
964 ; CHECK-NEXT: [[PTR0_ADDR_08:%.*]] = phi i8* [ [[PTR0:%.*]], [[ENTRY]] ], [ [[INCDEC_PTR:%.*]], [[FOR_INC]] ]
965 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[PTR0_ADDR_08]]
966 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[PTR1_ADDR_09]]
967 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[V0]], [[V1]]
968 ; CHECK-NEXT: br i1 [[CMP2]], label [[FOR_INC]], label [[CLEANUP:%.*]]
970 ; CHECK-NEXT: [[INC]] = add nuw nsw i64 [[I_010]], 1
971 ; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i8, i8* [[PTR0_ADDR_08]], i64 1
972 ; CHECK-NEXT: [[INCDEC_PTR3]] = getelementptr inbounds i8, i8* [[PTR1_ADDR_09]], i64 1
973 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], 8
974 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP]]
976 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_INC]] ]
977 ; CHECK-NEXT: ret i1 [[RES]]
982 for.body: ; preds = %entry, %for.inc
983 %i.010 = phi i64 [ 0, %entry ], [ %inc, %for.inc ]
984 %ptr1.addr.09 = phi i8* [ %ptr1, %entry ], [ %incdec.ptr3, %for.inc ]
985 %ptr0.addr.08 = phi i8* [ %ptr0, %entry ], [ %incdec.ptr, %for.inc ]
986 %v0 = load i8, i8* %ptr0.addr.08
987 %v1 = load i8, i8* %ptr1.addr.09
988 %cmp2 = icmp eq i8 %v0, %v1
989 br i1 %cmp2, label %for.inc, label %cleanup
991 for.inc: ; preds = %for.body
992 %inc = add nuw nsw i64 %i.010, 1
993 %incdec.ptr = getelementptr inbounds i8, i8* %ptr0.addr.08, i64 1
994 %incdec.ptr3 = getelementptr inbounds i8, i8* %ptr1.addr.09, i64 1
995 %cmp = icmp ult i64 %inc, 8
996 br i1 %cmp, label %for.body, label %cleanup
998 cleanup: ; preds = %for.inc, %for.body
999 %res = phi i1 [ false, %for.body ], [ true, %for.inc ]
1003 define i1 @_Z46combined_iteration_eq_variable_size_no_overlapPKcm(i8* %ptr, i64 %count) {
1004 ; CHECK-LABEL: @_Z46combined_iteration_eq_variable_size_no_overlapPKcm(
1005 ; CHECK-NEXT: entry:
1006 ; CHECK-NEXT: [[CMP14:%.*]] = icmp eq i64 [[COUNT:%.*]], 0
1007 ; CHECK-NEXT: br i1 [[CMP14]], label [[CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
1008 ; CHECK: for.body.preheader:
1009 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 [[COUNT]]
1010 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
1012 ; CHECK-NEXT: [[I_017:%.*]] = phi i64 [ [[INC:%.*]], [[FOR_INC:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
1013 ; CHECK-NEXT: [[PTR1_016:%.*]] = phi i8* [ [[INCDEC_PTR3:%.*]], [[FOR_INC]] ], [ [[ADD_PTR]], [[FOR_BODY_PREHEADER]] ]
1014 ; CHECK-NEXT: [[PTR0_015:%.*]] = phi i8* [ [[INCDEC_PTR:%.*]], [[FOR_INC]] ], [ [[PTR]], [[FOR_BODY_PREHEADER]] ]
1015 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[PTR0_015]]
1016 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[PTR1_016]]
1017 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[V0]], [[V1]]
1018 ; CHECK-NEXT: br i1 [[CMP2]], label [[FOR_INC]], label [[CLEANUP_LOOPEXIT:%.*]]
1020 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_017]], 1
1021 ; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i8, i8* [[PTR0_015]], i64 1
1022 ; CHECK-NEXT: [[INCDEC_PTR3]] = getelementptr inbounds i8, i8* [[PTR1_016]], i64 1
1023 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], [[COUNT]]
1024 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP_LOOPEXIT]]
1025 ; CHECK: cleanup.loopexit:
1026 ; CHECK-NEXT: [[RES_PH:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_INC]] ]
1027 ; CHECK-NEXT: br label [[CLEANUP]]
1029 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RES_PH]], [[CLEANUP_LOOPEXIT]] ]
1030 ; CHECK-NEXT: ret i1 [[RES]]
1033 %cmp14 = icmp eq i64 %count, 0
1034 br i1 %cmp14, label %cleanup, label %for.body.preheader
1036 for.body.preheader: ; preds = %entry
1037 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %count
1040 for.body: ; preds = %for.body.preheader, %for.inc
1041 %i.017 = phi i64 [ %inc, %for.inc ], [ 0, %for.body.preheader ]
1042 %ptr1.016 = phi i8* [ %incdec.ptr3, %for.inc ], [ %add.ptr, %for.body.preheader ]
1043 %ptr0.015 = phi i8* [ %incdec.ptr, %for.inc ], [ %ptr, %for.body.preheader ]
1044 %v0 = load i8, i8* %ptr0.015
1045 %v1 = load i8, i8* %ptr1.016
1046 %cmp2 = icmp eq i8 %v0, %v1
1047 br i1 %cmp2, label %for.inc, label %cleanup
1049 for.inc: ; preds = %for.body
1050 %inc = add nuw i64 %i.017, 1
1051 %incdec.ptr = getelementptr inbounds i8, i8* %ptr0.015, i64 1
1052 %incdec.ptr3 = getelementptr inbounds i8, i8* %ptr1.016, i64 1
1053 %cmp = icmp ult i64 %inc, %count
1054 br i1 %cmp, label %for.body, label %cleanup
1056 cleanup: ; preds = %for.body, %for.inc, %entry
1057 %res = phi i1 [ true, %entry ], [ true, %for.inc ], [ false, %for.body ]
1061 define i1 @_Z51combined_iteration_eq_variable_size_partial_overlapPKcm(i8* %ptr, i64 %count) {
1062 ; CHECK-LABEL: @_Z51combined_iteration_eq_variable_size_partial_overlapPKcm(
1063 ; CHECK-NEXT: entry:
1064 ; CHECK-NEXT: [[MUL:%.*]] = shl i64 [[COUNT:%.*]], 1
1065 ; CHECK-NEXT: [[CMP14:%.*]] = icmp eq i64 [[MUL]], 0
1066 ; CHECK-NEXT: br i1 [[CMP14]], label [[CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
1067 ; CHECK: for.body.preheader:
1068 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i64 [[COUNT]]
1069 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
1071 ; CHECK-NEXT: [[I_017:%.*]] = phi i64 [ [[INC:%.*]], [[FOR_INC:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
1072 ; CHECK-NEXT: [[PTR1_016:%.*]] = phi i8* [ [[INCDEC_PTR3:%.*]], [[FOR_INC]] ], [ [[ADD_PTR]], [[FOR_BODY_PREHEADER]] ]
1073 ; CHECK-NEXT: [[PTR0_015:%.*]] = phi i8* [ [[INCDEC_PTR:%.*]], [[FOR_INC]] ], [ [[PTR]], [[FOR_BODY_PREHEADER]] ]
1074 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[PTR0_015]]
1075 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[PTR1_016]]
1076 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[V0]], [[V1]]
1077 ; CHECK-NEXT: br i1 [[CMP2]], label [[FOR_INC]], label [[CLEANUP_LOOPEXIT:%.*]]
1079 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_017]], 1
1080 ; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i8, i8* [[PTR0_015]], i64 1
1081 ; CHECK-NEXT: [[INCDEC_PTR3]] = getelementptr inbounds i8, i8* [[PTR1_016]], i64 1
1082 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], [[MUL]]
1083 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP_LOOPEXIT]]
1084 ; CHECK: cleanup.loopexit:
1085 ; CHECK-NEXT: [[RES_PH:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_INC]] ]
1086 ; CHECK-NEXT: br label [[CLEANUP]]
1088 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RES_PH]], [[CLEANUP_LOOPEXIT]] ]
1089 ; CHECK-NEXT: ret i1 [[RES]]
1092 %mul = shl i64 %count, 1
1093 %cmp14 = icmp eq i64 %mul, 0
1094 br i1 %cmp14, label %cleanup, label %for.body.preheader
1096 for.body.preheader: ; preds = %entry
1097 %add.ptr = getelementptr inbounds i8, i8* %ptr, i64 %count
1100 for.body: ; preds = %for.body.preheader, %for.inc
1101 %i.017 = phi i64 [ %inc, %for.inc ], [ 0, %for.body.preheader ]
1102 %ptr1.016 = phi i8* [ %incdec.ptr3, %for.inc ], [ %add.ptr, %for.body.preheader ]
1103 %ptr0.015 = phi i8* [ %incdec.ptr, %for.inc ], [ %ptr, %for.body.preheader ]
1104 %v0 = load i8, i8* %ptr0.015
1105 %v1 = load i8, i8* %ptr1.016
1106 %cmp2 = icmp eq i8 %v0, %v1
1107 br i1 %cmp2, label %for.inc, label %cleanup
1109 for.inc: ; preds = %for.body
1110 %inc = add nuw i64 %i.017, 1
1111 %incdec.ptr = getelementptr inbounds i8, i8* %ptr0.015, i64 1
1112 %incdec.ptr3 = getelementptr inbounds i8, i8* %ptr1.016, i64 1
1113 %cmp = icmp ult i64 %inc, %mul
1114 br i1 %cmp, label %for.body, label %cleanup
1116 cleanup: ; preds = %for.body, %for.inc, %entry
1117 %res = phi i1 [ true, %entry ], [ true, %for.inc ], [ false, %for.body ]
1121 define i1 @_Z51combined_iteration_eq_variable_size_overlap_unknownPKcS0_m(i8* %ptr0, i8* %ptr1, i64 %count) {
1122 ; CHECK-LABEL: @_Z51combined_iteration_eq_variable_size_overlap_unknownPKcS0_m(
1123 ; CHECK-NEXT: entry:
1124 ; CHECK-NEXT: [[CMP8:%.*]] = icmp eq i64 [[COUNT:%.*]], 0
1125 ; CHECK-NEXT: br i1 [[CMP8]], label [[CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
1126 ; CHECK: for.body.preheader:
1127 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
1129 ; CHECK-NEXT: [[I_011:%.*]] = phi i64 [ [[INC:%.*]], [[FOR_INC:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
1130 ; CHECK-NEXT: [[PTR1_ADDR_010:%.*]] = phi i8* [ [[INCDEC_PTR3:%.*]], [[FOR_INC]] ], [ [[PTR1:%.*]], [[FOR_BODY_PREHEADER]] ]
1131 ; CHECK-NEXT: [[PTR0_ADDR_09:%.*]] = phi i8* [ [[INCDEC_PTR:%.*]], [[FOR_INC]] ], [ [[PTR0:%.*]], [[FOR_BODY_PREHEADER]] ]
1132 ; CHECK-NEXT: [[V0:%.*]] = load i8, i8* [[PTR0_ADDR_09]]
1133 ; CHECK-NEXT: [[V1:%.*]] = load i8, i8* [[PTR1_ADDR_010]]
1134 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[V0]], [[V1]]
1135 ; CHECK-NEXT: br i1 [[CMP2]], label [[FOR_INC]], label [[CLEANUP_LOOPEXIT:%.*]]
1137 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_011]], 1
1138 ; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i8, i8* [[PTR0_ADDR_09]], i64 1
1139 ; CHECK-NEXT: [[INCDEC_PTR3]] = getelementptr inbounds i8, i8* [[PTR1_ADDR_010]], i64 1
1140 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], [[COUNT]]
1141 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP_LOOPEXIT]]
1142 ; CHECK: cleanup.loopexit:
1143 ; CHECK-NEXT: [[RES_PH:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_INC]] ]
1144 ; CHECK-NEXT: br label [[CLEANUP]]
1146 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RES_PH]], [[CLEANUP_LOOPEXIT]] ]
1147 ; CHECK-NEXT: ret i1 [[RES]]
1150 %cmp8 = icmp eq i64 %count, 0
1151 br i1 %cmp8, label %cleanup, label %for.body
1153 for.body: ; preds = %entry, %for.inc
1154 %i.011 = phi i64 [ %inc, %for.inc ], [ 0, %entry ]
1155 %ptr1.addr.010 = phi i8* [ %incdec.ptr3, %for.inc ], [ %ptr1, %entry ]
1156 %ptr0.addr.09 = phi i8* [ %incdec.ptr, %for.inc ], [ %ptr0, %entry ]
1157 %v0 = load i8, i8* %ptr0.addr.09
1158 %v1 = load i8, i8* %ptr1.addr.010
1159 %cmp2 = icmp eq i8 %v0, %v1
1160 br i1 %cmp2, label %for.inc, label %cleanup
1162 for.inc: ; preds = %for.body
1163 %inc = add nuw i64 %i.011, 1
1164 %incdec.ptr = getelementptr inbounds i8, i8* %ptr0.addr.09, i64 1
1165 %incdec.ptr3 = getelementptr inbounds i8, i8* %ptr1.addr.010, i64 1
1166 %cmp = icmp ult i64 %inc, %count
1167 br i1 %cmp, label %for.body, label %cleanup
1169 cleanup: ; preds = %for.body, %for.inc, %entry
1170 %res = phi i1 [ true, %entry ], [ true, %for.inc ], [ false, %for.body ]
1174 define i1 @_Z55negated_pointer_iteration_variable_size_overlap_unknownPKcS0_m(i8* %ptr0, i8* %ptr1, i64 %count) {
1175 ; CHECK-LABEL: @_Z55negated_pointer_iteration_variable_size_overlap_unknownPKcS0_m(
1176 ; CHECK-NEXT: entry:
1177 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR0:%.*]], i64 [[COUNT:%.*]]
1178 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[COUNT]], 0
1179 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
1180 ; CHECK: for.body.i.i.preheader:
1181 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
1182 ; CHECK: for.body.i.i:
1183 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[PTR1:%.*]], [[FOR_BODY_I_I_PREHEADER]] ]
1184 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[PTR0]], [[FOR_BODY_I_I_PREHEADER]] ]
1185 ; CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
1186 ; CHECK-NEXT: [[T1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
1187 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[T0]], [[T1]]
1188 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT:%.*]]
1189 ; CHECK: for.inc.i.i:
1190 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
1191 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
1192 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
1193 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]], label [[FOR_BODY_I_I]]
1194 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit.loopexit:
1195 ; CHECK-NEXT: [[RETVAL_0_I_I_PH:%.*]] = phi i1 [ true, [[FOR_BODY_I_I]] ], [ false, [[FOR_INC_I_I]] ]
1196 ; CHECK-NEXT: br label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]]
1197 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
1198 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ false, [[ENTRY:%.*]] ], [ [[RETVAL_0_I_I_PH]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
1199 ; CHECK-NEXT: ret i1 [[RETVAL_0_I_I]]
1202 %add.ptr = getelementptr inbounds i8, i8* %ptr0, i64 %count
1203 %cmp5.i.i = icmp eq i64 %count, 0
1204 br i1 %cmp5.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
1206 for.body.i.i: ; preds = %entry, %for.inc.i.i
1207 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %ptr1, %entry ]
1208 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %ptr0, %entry ]
1209 %t0 = load i8, i8* %__first1.addr.06.i.i
1210 %t1 = load i8, i8* %__first2.addr.07.i.i
1211 %cmp.i.i.i = icmp eq i8 %t0, %t1
1212 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
1214 for.inc.i.i: ; preds = %for.body.i.i
1215 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
1216 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
1217 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %add.ptr
1218 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
1220 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i, %entry
1221 %retval.0.i.i = phi i1 [ false, %entry ], [ false, %for.inc.i.i ], [ true, %for.body.i.i ]
1222 ret i1 %retval.0.i.i
1225 define i1 @_Z55integer_pointer_iteration_variable_size_overlap_unknownPKiS0_m(i32* %ptr0, i32* %ptr1, i64 %count) {
1226 ; CHECK-LABEL: @_Z55integer_pointer_iteration_variable_size_overlap_unknownPKiS0_m(
1227 ; CHECK-NEXT: entry:
1228 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[PTR0:%.*]], i64 [[COUNT:%.*]]
1229 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[COUNT]], 0
1230 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[_ZNST3__15EQUALIPKIS2_EEBT_S3_T0__EXIT:%.*]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
1231 ; CHECK: for.body.i.i.preheader:
1232 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
1233 ; CHECK: for.body.i.i:
1234 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i32* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[PTR1:%.*]], [[FOR_BODY_I_I_PREHEADER]] ]
1235 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i32* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[PTR0]], [[FOR_BODY_I_I_PREHEADER]] ]
1236 ; CHECK-NEXT: [[T0:%.*]] = load i32, i32* [[__FIRST1_ADDR_06_I_I]]
1237 ; CHECK-NEXT: [[T1:%.*]] = load i32, i32* [[__FIRST2_ADDR_07_I_I]]
1238 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i32 [[T0]], [[T1]]
1239 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKIS2_EEBT_S3_T0__EXIT_LOOPEXIT:%.*]]
1240 ; CHECK: for.inc.i.i:
1241 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i32, i32* [[__FIRST1_ADDR_06_I_I]], i64 1
1242 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i32, i32* [[__FIRST2_ADDR_07_I_I]], i64 1
1243 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i32* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
1244 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKIS2_EEBT_S3_T0__EXIT_LOOPEXIT]], label [[FOR_BODY_I_I]]
1245 ; CHECK: _ZNSt3__15equalIPKiS2_EEbT_S3_T0_.exit.loopexit:
1246 ; CHECK-NEXT: [[RETVAL_0_I_I_PH:%.*]] = phi i1 [ false, [[FOR_BODY_I_I]] ], [ true, [[FOR_INC_I_I]] ]
1247 ; CHECK-NEXT: br label [[_ZNST3__15EQUALIPKIS2_EEBT_S3_T0__EXIT]]
1248 ; CHECK: _ZNSt3__15equalIPKiS2_EEbT_S3_T0_.exit:
1249 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RETVAL_0_I_I_PH]], [[_ZNST3__15EQUALIPKIS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
1250 ; CHECK-NEXT: ret i1 [[RETVAL_0_I_I]]
1253 %add.ptr = getelementptr inbounds i32, i32* %ptr0, i64 %count
1254 %cmp5.i.i = icmp eq i64 %count, 0
1255 br i1 %cmp5.i.i, label %_ZNSt3__15equalIPKiS2_EEbT_S3_T0_.exit, label %for.body.i.i
1257 for.body.i.i: ; preds = %entry, %for.inc.i.i
1258 %__first2.addr.07.i.i = phi i32* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %ptr1, %entry ]
1259 %__first1.addr.06.i.i = phi i32* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %ptr0, %entry ]
1260 %t0 = load i32, i32* %__first1.addr.06.i.i
1261 %t1 = load i32, i32* %__first2.addr.07.i.i
1262 %cmp.i.i.i = icmp eq i32 %t0, %t1
1263 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKiS2_EEbT_S3_T0_.exit
1265 for.inc.i.i: ; preds = %for.body.i.i
1266 %incdec.ptr.i.i = getelementptr inbounds i32, i32* %__first1.addr.06.i.i, i64 1
1267 %incdec.ptr1.i.i = getelementptr inbounds i32, i32* %__first2.addr.07.i.i, i64 1
1268 %cmp.i.i = icmp eq i32* %incdec.ptr.i.i, %add.ptr
1269 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKiS2_EEbT_S3_T0_.exit, label %for.body.i.i
1271 _ZNSt3__15equalIPKiS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i, %entry
1272 %retval.0.i.i = phi i1 [ true, %entry ], [ true, %for.inc.i.i ], [ false, %for.body.i.i ]
1273 ret i1 %retval.0.i.i
1276 define i1 @_Z21small_index_iterationPKcS0_i(i8* %ptr0, i8* %ptr1, i32 %count) {
1277 ; CHECK-LABEL: @_Z21small_index_iterationPKcS0_i(
1278 ; CHECK-NEXT: entry:
1279 ; CHECK-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[COUNT:%.*]], 0
1280 ; CHECK-NEXT: br i1 [[CMP8]], label [[FOR_BODY_PREHEADER:%.*]], label [[CLEANUP:%.*]]
1281 ; CHECK: for.body.preheader:
1282 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
1284 ; CHECK-NEXT: [[I_011:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_INC:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
1285 ; CHECK-NEXT: [[PTR1_ADDR_010:%.*]] = phi i8* [ [[INCDEC_PTR3:%.*]], [[FOR_INC]] ], [ [[PTR1:%.*]], [[FOR_BODY_PREHEADER]] ]
1286 ; CHECK-NEXT: [[PTR0_ADDR_09:%.*]] = phi i8* [ [[INCDEC_PTR:%.*]], [[FOR_INC]] ], [ [[PTR0:%.*]], [[FOR_BODY_PREHEADER]] ]
1287 ; CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[PTR0_ADDR_09]]
1288 ; CHECK-NEXT: [[T1:%.*]] = load i8, i8* [[PTR1_ADDR_010]]
1289 ; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[T0]], [[T1]]
1290 ; CHECK-NEXT: br i1 [[CMP2]], label [[FOR_INC]], label [[CLEANUP_LOOPEXIT:%.*]]
1292 ; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[I_011]], 1
1293 ; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i8, i8* [[PTR0_ADDR_09]], i64 1
1294 ; CHECK-NEXT: [[INCDEC_PTR3]] = getelementptr inbounds i8, i8* [[PTR1_ADDR_010]], i64 1
1295 ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[INC]], [[COUNT]]
1296 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP_LOOPEXIT]]
1297 ; CHECK: cleanup.loopexit:
1298 ; CHECK-NEXT: [[T2_PH:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_INC]] ]
1299 ; CHECK-NEXT: br label [[CLEANUP]]
1301 ; CHECK-NEXT: [[T2:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[T2_PH]], [[CLEANUP_LOOPEXIT]] ]
1302 ; CHECK-NEXT: ret i1 [[T2]]
1305 %cmp8 = icmp sgt i32 %count, 0
1306 br i1 %cmp8, label %for.body, label %cleanup
1308 for.body: ; preds = %entry, %for.inc
1309 %i.011 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
1310 %ptr1.addr.010 = phi i8* [ %incdec.ptr3, %for.inc ], [ %ptr1, %entry ]
1311 %ptr0.addr.09 = phi i8* [ %incdec.ptr, %for.inc ], [ %ptr0, %entry ]
1312 %t0 = load i8, i8* %ptr0.addr.09
1313 %t1 = load i8, i8* %ptr1.addr.010
1314 %cmp2 = icmp eq i8 %t0, %t1
1315 br i1 %cmp2, label %for.inc, label %cleanup
1317 for.inc: ; preds = %for.body
1318 %inc = add nuw nsw i32 %i.011, 1
1319 %incdec.ptr = getelementptr inbounds i8, i8* %ptr0.addr.09, i64 1
1320 %incdec.ptr3 = getelementptr inbounds i8, i8* %ptr1.addr.010, i64 1
1321 %cmp = icmp slt i32 %inc, %count
1322 br i1 %cmp, label %for.body, label %cleanup
1324 cleanup: ; preds = %for.body, %for.inc, %entry
1325 %t2 = phi i1 [ true, %entry ], [ true, %for.inc ], [ false, %for.body ]
1329 define i1 @_Z23three_pointer_iterationPKcS0_S0_(i8* %ptr0, i8* %ptr0_end, i8* %ptr1) {
1330 ; CHECK-LABEL: @_Z23three_pointer_iterationPKcS0_S0_(
1331 ; CHECK-NEXT: entry:
1332 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i8* [[PTR0:%.*]], [[PTR0_END:%.*]]
1333 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
1334 ; CHECK: for.body.i.i.preheader:
1335 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
1336 ; CHECK: for.body.i.i:
1337 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[PTR1:%.*]], [[FOR_BODY_I_I_PREHEADER]] ]
1338 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[PTR0]], [[FOR_BODY_I_I_PREHEADER]] ]
1339 ; CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
1340 ; CHECK-NEXT: [[T1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
1341 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[T0]], [[T1]]
1342 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT:%.*]]
1343 ; CHECK: for.inc.i.i:
1344 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
1345 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
1346 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[PTR0_END]]
1347 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]], label [[FOR_BODY_I_I]]
1348 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit.loopexit:
1349 ; CHECK-NEXT: [[RETVAL_0_I_I_PH:%.*]] = phi i1 [ false, [[FOR_BODY_I_I]] ], [ true, [[FOR_INC_I_I]] ]
1350 ; CHECK-NEXT: br label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]]
1351 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
1352 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RETVAL_0_I_I_PH]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
1353 ; CHECK-NEXT: ret i1 [[RETVAL_0_I_I]]
1356 %cmp5.i.i = icmp eq i8* %ptr0, %ptr0_end
1357 br i1 %cmp5.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
1359 for.body.i.i: ; preds = %entry, %for.inc.i.i
1360 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %ptr1, %entry ]
1361 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %ptr0, %entry ]
1362 %t0 = load i8, i8* %__first1.addr.06.i.i
1363 %t1 = load i8, i8* %__first2.addr.07.i.i
1364 %cmp.i.i.i = icmp eq i8 %t0, %t1
1365 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
1367 for.inc.i.i: ; preds = %for.body.i.i
1368 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
1369 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
1370 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %ptr0_end
1371 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
1373 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i, %entry
1374 %retval.0.i.i = phi i1 [ true, %entry ], [ true, %for.inc.i.i ], [ false, %for.body.i.i ]
1375 ret i1 %retval.0.i.i
1378 define i32 @_Z17value_propagationPKcS0_mii(i8* %ptr0, i8* %ptr1, i64 %count, i32 %on_equal, i32 %on_unequal) {
1379 ; CHECK-LABEL: @_Z17value_propagationPKcS0_mii(
1380 ; CHECK-NEXT: entry:
1381 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR0:%.*]], i64 [[COUNT:%.*]]
1382 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[COUNT]], 0
1383 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
1384 ; CHECK: for.body.i.i.preheader:
1385 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
1386 ; CHECK: for.body.i.i:
1387 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[PTR1:%.*]], [[FOR_BODY_I_I_PREHEADER]] ]
1388 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[PTR0]], [[FOR_BODY_I_I_PREHEADER]] ]
1389 ; CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
1390 ; CHECK-NEXT: [[T1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
1391 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[T0]], [[T1]]
1392 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT:%.*]]
1393 ; CHECK: for.inc.i.i:
1394 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
1395 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
1396 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
1397 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]], label [[FOR_BODY_I_I]]
1398 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit.loopexit:
1399 ; CHECK-NEXT: [[T2_PH:%.*]] = phi i32 [ [[ON_UNEQUAL:%.*]], [[FOR_BODY_I_I]] ], [ [[ON_EQUAL:%.*]], [[FOR_INC_I_I]] ]
1400 ; CHECK-NEXT: br label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]]
1401 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
1402 ; CHECK-NEXT: [[T2:%.*]] = phi i32 [ [[ON_EQUAL]], [[ENTRY:%.*]] ], [ [[T2_PH]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
1403 ; CHECK-NEXT: ret i32 [[T2]]
1406 %add.ptr = getelementptr inbounds i8, i8* %ptr0, i64 %count
1407 %cmp5.i.i = icmp eq i64 %count, 0
1408 br i1 %cmp5.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
1410 for.body.i.i: ; preds = %entry, %for.inc.i.i
1411 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %ptr1, %entry ]
1412 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %ptr0, %entry ]
1413 %t0 = load i8, i8* %__first1.addr.06.i.i
1414 %t1 = load i8, i8* %__first2.addr.07.i.i
1415 %cmp.i.i.i = icmp eq i8 %t0, %t1
1416 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
1418 for.inc.i.i: ; preds = %for.body.i.i
1419 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
1420 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
1421 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %add.ptr
1422 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
1424 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.inc.i.i, %for.body.i.i, %entry
1425 %t2 = phi i32 [ %on_equal, %entry ], [ %on_equal, %for.inc.i.i ], [ %on_unequal, %for.body.i.i ]
1429 define void @_Z20multiple_exit_blocksPKcS0_m(i8* %ptr0, i8* %ptr1, i64 %count) {
1430 ; CHECK-LABEL: @_Z20multiple_exit_blocksPKcS0_m(
1431 ; CHECK-NEXT: entry:
1432 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR0:%.*]], i64 [[COUNT:%.*]]
1433 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[COUNT]], 0
1434 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[IF_END:%.*]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
1435 ; CHECK: for.body.i.i.preheader:
1436 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
1437 ; CHECK: for.body.i.i:
1438 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[PTR1:%.*]], [[FOR_BODY_I_I_PREHEADER]] ]
1439 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[PTR0]], [[FOR_BODY_I_I_PREHEADER]] ]
1440 ; CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
1441 ; CHECK-NEXT: [[T1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
1442 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[T0]], [[T1]]
1443 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[IF_THEN:%.*]]
1444 ; CHECK: for.inc.i.i:
1445 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
1446 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
1447 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
1448 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[IF_END_LOOPEXIT:%.*]], label [[FOR_BODY_I_I]]
1450 ; CHECK-NEXT: tail call void @_Z17callee_on_unequalv()
1451 ; CHECK-NEXT: br label [[RETURN:%.*]]
1452 ; CHECK: if.end.loopexit:
1453 ; CHECK-NEXT: br label [[IF_END]]
1455 ; CHECK-NEXT: tail call void @_Z17callee_on_successv()
1456 ; CHECK-NEXT: br label [[RETURN]]
1458 ; CHECK-NEXT: ret void
1461 %add.ptr = getelementptr inbounds i8, i8* %ptr0, i64 %count
1462 %cmp5.i.i = icmp eq i64 %count, 0
1463 br i1 %cmp5.i.i, label %if.end, label %for.body.i.i
1465 for.body.i.i: ; preds = %entry, %for.inc.i.i
1466 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %ptr1, %entry ]
1467 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %ptr0, %entry ]
1468 %t0 = load i8, i8* %__first1.addr.06.i.i
1469 %t1 = load i8, i8* %__first2.addr.07.i.i
1470 %cmp.i.i.i = icmp eq i8 %t0, %t1
1471 br i1 %cmp.i.i.i, label %for.inc.i.i, label %if.then
1473 for.inc.i.i: ; preds = %for.body.i.i
1474 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
1475 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
1476 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %add.ptr
1477 br i1 %cmp.i.i, label %if.end, label %for.body.i.i
1479 if.then: ; preds = %for.body.i.i
1480 tail call void @_Z17callee_on_unequalv()
1483 if.end: ; preds = %for.inc.i.i, %entry
1484 tail call void @_Z17callee_on_successv()
1487 return: ; preds = %if.end, %if.then
1490 declare void @_Z17callee_on_unequalv()
1491 declare void @_Z17callee_on_successv()
1493 define void @_Z13multiple_phisPKcS0_mS0_S0_S0_S0_PS0_S1_(i8* %ptr0, i8* %ptr1, i64 %count, i8* %v0, i8* %v1, i8* %v2, i8* %v3, i8** %out0, i8** %out1) {
1494 ; CHECK-LABEL: @_Z13multiple_phisPKcS0_mS0_S0_S0_S0_PS0_S1_(
1495 ; CHECK-NEXT: entry:
1496 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[PTR0:%.*]], i64 [[COUNT:%.*]]
1497 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[COUNT]], 0
1498 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
1499 ; CHECK: for.body.i.i.preheader:
1500 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
1501 ; CHECK: for.body.i.i:
1502 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[PTR1:%.*]], [[FOR_BODY_I_I_PREHEADER]] ]
1503 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[PTR0]], [[FOR_BODY_I_I_PREHEADER]] ]
1504 ; CHECK-NEXT: [[T0:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
1505 ; CHECK-NEXT: [[T1:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
1506 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[T0]], [[T1]]
1507 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT:%.*]]
1508 ; CHECK: for.inc.i.i:
1509 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
1510 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
1511 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
1512 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]], label [[FOR_BODY_I_I]]
1513 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit.loopexit:
1514 ; CHECK-NEXT: [[T2_PH:%.*]] = phi i8* [ [[V2:%.*]], [[FOR_BODY_I_I]] ], [ [[V0:%.*]], [[FOR_INC_I_I]] ]
1515 ; CHECK-NEXT: [[T3_PH:%.*]] = phi i8* [ [[V3:%.*]], [[FOR_BODY_I_I]] ], [ [[V1:%.*]], [[FOR_INC_I_I]] ]
1516 ; CHECK-NEXT: br label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]]
1517 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
1518 ; CHECK-NEXT: [[T2:%.*]] = phi i8* [ [[V0]], [[ENTRY:%.*]] ], [ [[T2_PH]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
1519 ; CHECK-NEXT: [[T3:%.*]] = phi i8* [ [[V1]], [[ENTRY]] ], [ [[T3_PH]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
1520 ; CHECK-NEXT: store i8* [[T2]], i8** [[OUT0:%.*]]
1521 ; CHECK-NEXT: store i8* [[T3]], i8** [[OUT1:%.*]]
1522 ; CHECK-NEXT: ret void
1525 %add.ptr = getelementptr inbounds i8, i8* %ptr0, i64 %count
1526 %cmp5.i.i = icmp eq i64 %count, 0
1527 br i1 %cmp5.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
1529 for.body.i.i: ; preds = %entry, %for.inc.i.i
1530 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %ptr1, %entry ]
1531 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %ptr0, %entry ]
1532 %t0 = load i8, i8* %__first1.addr.06.i.i
1533 %t1 = load i8, i8* %__first2.addr.07.i.i
1534 %cmp.i.i.i = icmp eq i8 %t0, %t1
1535 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
1537 for.inc.i.i: ; preds = %for.body.i.i
1538 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
1539 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
1540 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %add.ptr
1541 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
1543 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.inc.i.i, %for.body.i.i, %entry
1544 %t2 = phi i8* [ %v0, %entry ], [ %v0, %for.inc.i.i ], [ %v2, %for.body.i.i ]
1545 %t3 = phi i8* [ %v1, %entry ], [ %v1, %for.inc.i.i ], [ %v3, %for.body.i.i ]
1546 store i8* %t2, i8** %out0
1547 store i8* %t3, i8** %out1
1551 define void @_Z16loop_within_loopmPPKcS1_Pm(i64 %outer_count, i8** %ptr0, i8** %ptr1, i64* %count) {
1552 ; CHECK-LABEL: @_Z16loop_within_loopmPPKcS1_Pm(
1553 ; CHECK-NEXT: entry:
1554 ; CHECK-NEXT: [[CMP11:%.*]] = icmp eq i64 [[OUTER_COUNT:%.*]], 0
1555 ; CHECK-NEXT: br i1 [[CMP11]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
1556 ; CHECK: for.body.preheader:
1557 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
1558 ; CHECK: for.cond.cleanup.loopexit:
1559 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
1560 ; CHECK: for.cond.cleanup:
1561 ; CHECK-NEXT: ret void
1563 ; CHECK-NEXT: [[I_012:%.*]] = phi i64 [ [[INC:%.*]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
1564 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[PTR0:%.*]], i64 [[I_012]]
1565 ; CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[ARRAYIDX]]
1566 ; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i64, i64* [[COUNT:%.*]], i64 [[I_012]]
1567 ; CHECK-NEXT: [[T1:%.*]] = load i64, i64* [[ARRAYIDX2]]
1568 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 [[T1]]
1569 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[T1]], 0
1570 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
1571 ; CHECK: for.body.i.i.preheader:
1572 ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i8*, i8** [[PTR1:%.*]], i64 [[I_012]]
1573 ; CHECK-NEXT: [[T2:%.*]] = load i8*, i8** [[ARRAYIDX3]]
1574 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
1575 ; CHECK: for.body.i.i:
1576 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[T2]], [[FOR_BODY_I_I_PREHEADER]] ]
1577 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[T0]], [[FOR_BODY_I_I_PREHEADER]] ]
1578 ; CHECK-NEXT: [[T3:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
1579 ; CHECK-NEXT: [[T4:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
1580 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[T3]], [[T4]]
1581 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT:%.*]]
1582 ; CHECK: for.inc.i.i:
1583 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
1584 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
1585 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
1586 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]], label [[FOR_BODY_I_I]]
1587 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit.loopexit:
1588 ; CHECK-NEXT: [[RETVAL_0_I_I_PH:%.*]] = phi i1 [ false, [[FOR_BODY_I_I]] ], [ true, [[FOR_INC_I_I]] ]
1589 ; CHECK-NEXT: br label [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT]]
1590 ; CHECK: _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit:
1591 ; CHECK-NEXT: [[RETVAL_0_I_I:%.*]] = phi i1 [ true, [[FOR_BODY]] ], [ [[RETVAL_0_I_I_PH]], [[_ZNST3__15EQUALIPKCS2_EEBT_S3_T0__EXIT_LOOPEXIT]] ]
1592 ; CHECK-NEXT: tail call void @_Z4sinkb(i1 [[RETVAL_0_I_I]])
1593 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_012]], 1
1594 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[INC]], [[OUTER_COUNT]]
1595 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]], label [[FOR_BODY]]
1598 %cmp11 = icmp eq i64 %outer_count, 0
1599 br i1 %cmp11, label %for.cond.cleanup, label %for.body
1601 for.cond.cleanup: ; preds = %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, %entry
1604 for.body: ; preds = %entry, %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
1605 %i.012 = phi i64 [ %inc, %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit ], [ 0, %entry ]
1606 %arrayidx = getelementptr inbounds i8*, i8** %ptr0, i64 %i.012
1607 %t0 = load i8*, i8** %arrayidx
1608 %arrayidx2 = getelementptr inbounds i64, i64* %count, i64 %i.012
1609 %t1 = load i64, i64* %arrayidx2
1610 %add.ptr = getelementptr inbounds i8, i8* %t0, i64 %t1
1611 %cmp5.i.i = icmp eq i64 %t1, 0
1612 br i1 %cmp5.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i.preheader
1614 for.body.i.i.preheader: ; preds = %for.body
1615 %arrayidx3 = getelementptr inbounds i8*, i8** %ptr1, i64 %i.012
1616 %t2 = load i8*, i8** %arrayidx3
1617 br label %for.body.i.i
1619 for.body.i.i: ; preds = %for.body.i.i.preheader, %for.inc.i.i
1620 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %t2, %for.body.i.i.preheader ]
1621 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %t0, %for.body.i.i.preheader ]
1622 %t3 = load i8, i8* %__first1.addr.06.i.i
1623 %t4 = load i8, i8* %__first2.addr.07.i.i
1624 %cmp.i.i.i = icmp eq i8 %t3, %t4
1625 br i1 %cmp.i.i.i, label %for.inc.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit
1627 for.inc.i.i: ; preds = %for.body.i.i
1628 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
1629 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
1630 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %add.ptr
1631 br i1 %cmp.i.i, label %_ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit, label %for.body.i.i
1633 _ZNSt3__15equalIPKcS2_EEbT_S3_T0_.exit: ; preds = %for.body.i.i, %for.inc.i.i, %for.body
1634 %retval.0.i.i = phi i1 [ true, %for.body ], [ true, %for.inc.i.i ], [ false, %for.body.i.i ]
1635 tail call void @_Z4sinkb(i1 %retval.0.i.i)
1636 %inc = add nuw i64 %i.012, 1
1637 %cmp = icmp eq i64 %inc, %outer_count
1638 br i1 %cmp, label %for.cond.cleanup, label %for.body
1640 declare void @_Z4sinkb(i1)
1642 define void @_Z42loop_within_loop_with_multiple_exit_blocksmPPKcS1_Pm(i64 %outer_count, i8** %ptr0, i8** %ptr1, i64* %count) {
1643 ; CHECK-LABEL: @_Z42loop_within_loop_with_multiple_exit_blocksmPPKcS1_Pm(
1644 ; CHECK-NEXT: entry:
1645 ; CHECK-NEXT: [[CMP11:%.*]] = icmp eq i64 [[OUTER_COUNT:%.*]], 0
1646 ; CHECK-NEXT: br i1 [[CMP11]], label [[CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
1647 ; CHECK: for.body.preheader:
1648 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
1650 ; CHECK-NEXT: [[I_012:%.*]] = phi i64 [ [[INC:%.*]], [[IF_END:%.*]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
1651 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8*, i8** [[PTR0:%.*]], i64 [[I_012]]
1652 ; CHECK-NEXT: [[T0:%.*]] = load i8*, i8** [[ARRAYIDX]]
1653 ; CHECK-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds i64, i64* [[COUNT:%.*]], i64 [[I_012]]
1654 ; CHECK-NEXT: [[T1:%.*]] = load i64, i64* [[ARRAYIDX2]]
1655 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[T0]], i64 [[T1]]
1656 ; CHECK-NEXT: [[CMP5_I_I:%.*]] = icmp eq i64 [[T1]], 0
1657 ; CHECK-NEXT: br i1 [[CMP5_I_I]], label [[IF_END]], label [[FOR_BODY_I_I_PREHEADER:%.*]]
1658 ; CHECK: for.body.i.i.preheader:
1659 ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i8*, i8** [[PTR1:%.*]], i64 [[I_012]]
1660 ; CHECK-NEXT: [[T2:%.*]] = load i8*, i8** [[ARRAYIDX3]]
1661 ; CHECK-NEXT: br label [[FOR_BODY_I_I:%.*]]
1662 ; CHECK: for.body.i.i:
1663 ; CHECK-NEXT: [[__FIRST2_ADDR_07_I_I:%.*]] = phi i8* [ [[INCDEC_PTR1_I_I:%.*]], [[FOR_INC_I_I:%.*]] ], [ [[T2]], [[FOR_BODY_I_I_PREHEADER]] ]
1664 ; CHECK-NEXT: [[__FIRST1_ADDR_06_I_I:%.*]] = phi i8* [ [[INCDEC_PTR_I_I:%.*]], [[FOR_INC_I_I]] ], [ [[T0]], [[FOR_BODY_I_I_PREHEADER]] ]
1665 ; CHECK-NEXT: [[T3:%.*]] = load i8, i8* [[__FIRST1_ADDR_06_I_I]]
1666 ; CHECK-NEXT: [[T4:%.*]] = load i8, i8* [[__FIRST2_ADDR_07_I_I]]
1667 ; CHECK-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i8 [[T3]], [[T4]]
1668 ; CHECK-NEXT: br i1 [[CMP_I_I_I]], label [[FOR_INC_I_I]], label [[IF_THEN:%.*]]
1669 ; CHECK: for.inc.i.i:
1670 ; CHECK-NEXT: [[INCDEC_PTR_I_I]] = getelementptr inbounds i8, i8* [[__FIRST1_ADDR_06_I_I]], i64 1
1671 ; CHECK-NEXT: [[INCDEC_PTR1_I_I]] = getelementptr inbounds i8, i8* [[__FIRST2_ADDR_07_I_I]], i64 1
1672 ; CHECK-NEXT: [[CMP_I_I:%.*]] = icmp eq i8* [[INCDEC_PTR_I_I]], [[ADD_PTR]]
1673 ; CHECK-NEXT: br i1 [[CMP_I_I]], label [[IF_END_LOOPEXIT:%.*]], label [[FOR_BODY_I_I]]
1675 ; CHECK-NEXT: tail call void @_Z17callee_on_unequalv()
1676 ; CHECK-NEXT: br label [[CLEANUP]]
1677 ; CHECK: if.end.loopexit:
1678 ; CHECK-NEXT: br label [[IF_END]]
1680 ; CHECK-NEXT: tail call void @_Z17callee_on_successv()
1681 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_012]], 1
1682 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[INC]], [[OUTER_COUNT]]
1683 ; CHECK-NEXT: br i1 [[CMP]], label [[CLEANUP_LOOPEXIT:%.*]], label [[FOR_BODY]]
1684 ; CHECK: cleanup.loopexit:
1685 ; CHECK-NEXT: br label [[CLEANUP]]
1687 ; CHECK-NEXT: ret void
1690 %cmp11 = icmp eq i64 %outer_count, 0
1691 br i1 %cmp11, label %cleanup, label %for.body
1693 for.body: ; preds = %entry, %if.end
1694 %i.012 = phi i64 [ %inc, %if.end ], [ 0, %entry ]
1695 %arrayidx = getelementptr inbounds i8*, i8** %ptr0, i64 %i.012
1696 %t0 = load i8*, i8** %arrayidx
1697 %arrayidx2 = getelementptr inbounds i64, i64* %count, i64 %i.012
1698 %t1 = load i64, i64* %arrayidx2
1699 %add.ptr = getelementptr inbounds i8, i8* %t0, i64 %t1
1700 %cmp5.i.i = icmp eq i64 %t1, 0
1701 br i1 %cmp5.i.i, label %if.end, label %for.body.i.i.preheader
1703 for.body.i.i.preheader: ; preds = %for.body
1704 %arrayidx3 = getelementptr inbounds i8*, i8** %ptr1, i64 %i.012
1705 %t2 = load i8*, i8** %arrayidx3
1706 br label %for.body.i.i
1708 for.body.i.i: ; preds = %for.body.i.i.preheader, %for.inc.i.i
1709 %__first2.addr.07.i.i = phi i8* [ %incdec.ptr1.i.i, %for.inc.i.i ], [ %t2, %for.body.i.i.preheader ]
1710 %__first1.addr.06.i.i = phi i8* [ %incdec.ptr.i.i, %for.inc.i.i ], [ %t0, %for.body.i.i.preheader ]
1711 %t3 = load i8, i8* %__first1.addr.06.i.i
1712 %t4 = load i8, i8* %__first2.addr.07.i.i
1713 %cmp.i.i.i = icmp eq i8 %t3, %t4
1714 br i1 %cmp.i.i.i, label %for.inc.i.i, label %if.then
1716 for.inc.i.i: ; preds = %for.body.i.i
1717 %incdec.ptr.i.i = getelementptr inbounds i8, i8* %__first1.addr.06.i.i, i64 1
1718 %incdec.ptr1.i.i = getelementptr inbounds i8, i8* %__first2.addr.07.i.i, i64 1
1719 %cmp.i.i = icmp eq i8* %incdec.ptr.i.i, %add.ptr
1720 br i1 %cmp.i.i, label %if.end, label %for.body.i.i
1722 if.then: ; preds = %for.body.i.i
1723 tail call void @_Z17callee_on_unequalv()
1726 if.end: ; preds = %for.inc.i.i, %for.body
1727 tail call void @_Z17callee_on_successv()
1728 %inc = add nuw i64 %i.012, 1
1729 %cmp = icmp eq i64 %inc, %outer_count
1730 br i1 %cmp, label %cleanup, label %for.body
1732 cleanup: ; preds = %if.end, %entry, %if.then
1736 define void @_Z21endless_loop_if_equalPiS_(i32* %a, i32* %b) {
1737 ; CHECK-LABEL: @_Z21endless_loop_if_equalPiS_(
1738 ; CHECK-NEXT: entry:
1739 ; CHECK-NEXT: br label [[FOR_COND:%.*]]
1740 ; CHECK: for.cond.loopexit:
1741 ; CHECK-NEXT: br label [[FOR_COND]]
1743 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
1745 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INDVARS_IV_NEXT:%.*]], 4
1746 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_LOOPEXIT:%.*]]
1748 ; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[FOR_COND]] ], [ [[INDVARS_IV_NEXT]], [[FOR_COND1:%.*]] ]
1749 ; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 [[INDVARS_IV]]
1750 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[ARRAYIDX]]
1751 ; CHECK-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds i32, i32* [[B:%.*]], i64 [[INDVARS_IV]]
1752 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, i32* [[ARRAYIDX3]]
1753 ; CHECK-NEXT: [[CMP4:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]]
1754 ; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
1755 ; CHECK-NEXT: br i1 [[CMP4]], label [[FOR_COND1]], label [[RETURN:%.*]]
1757 ; CHECK-NEXT: ret void
1762 for.cond: ; preds = %for.cond1, %entry
1765 for.cond1: ; preds = %for.body
1766 %cmp = icmp ult i64 %indvars.iv.next, 4
1767 br i1 %cmp, label %for.body, label %for.cond
1769 for.body: ; preds = %for.cond, %for.cond1
1770 %indvars.iv = phi i64 [ 0, %for.cond ], [ %indvars.iv.next, %for.cond1 ]
1771 %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
1772 %0 = load i32, i32* %arrayidx
1773 %arrayidx3 = getelementptr inbounds i32, i32* %b, i64 %indvars.iv
1774 %1 = load i32, i32* %arrayidx3
1775 %cmp4 = icmp eq i32 %0, %1
1776 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
1777 br i1 %cmp4, label %for.cond1, label %return
1779 return: ; preds = %for.body
1783 define i1 @_Z21load_of_bitcastsPKcPKfm(i8* %ptr0, float* %ptr1, i64 %count) {
1784 ; CHECK-LABEL: @_Z21load_of_bitcastsPKcPKfm(
1785 ; CHECK-NEXT: entry:
1786 ; CHECK-NEXT: [[CMP13:%.*]] = icmp eq i64 [[COUNT:%.*]], 0
1787 ; CHECK-NEXT: br i1 [[CMP13]], label [[CLEANUP3:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
1788 ; CHECK: for.body.preheader:
1789 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
1791 ; CHECK-NEXT: [[PTR0_ADDR_016:%.*]] = phi i8* [ [[ADD_PTR:%.*]], [[FOR_INC:%.*]] ], [ [[PTR0:%.*]], [[FOR_BODY_PREHEADER]] ]
1792 ; CHECK-NEXT: [[I_015:%.*]] = phi i64 [ [[INC:%.*]], [[FOR_INC]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
1793 ; CHECK-NEXT: [[PTR1_ADDR_014:%.*]] = phi float* [ [[INCDEC_PTR:%.*]], [[FOR_INC]] ], [ [[PTR1:%.*]], [[FOR_BODY_PREHEADER]] ]
1794 ; CHECK-NEXT: [[V0_0__SROA_CAST:%.*]] = bitcast i8* [[PTR0_ADDR_016]] to i32*
1795 ; CHECK-NEXT: [[V0_0_COPYLOAD:%.*]] = load i32, i32* [[V0_0__SROA_CAST]]
1796 ; CHECK-NEXT: [[V1_0__SROA_CAST:%.*]] = bitcast float* [[PTR1_ADDR_014]] to i32*
1797 ; CHECK-NEXT: [[V1_0_COPYLOAD:%.*]] = load i32, i32* [[V1_0__SROA_CAST]]
1798 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[V0_0_COPYLOAD]], [[V1_0_COPYLOAD]]
1799 ; CHECK-NEXT: br i1 [[CMP1]], label [[FOR_INC]], label [[CLEANUP3_LOOPEXIT:%.*]]
1801 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_015]], 1
1802 ; CHECK-NEXT: [[ADD_PTR]] = getelementptr inbounds i8, i8* [[PTR0_ADDR_016]], i64 4
1803 ; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds float, float* [[PTR1_ADDR_014]], i64 1
1804 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], [[COUNT]]
1805 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP3_LOOPEXIT]]
1806 ; CHECK: cleanup3.loopexit:
1807 ; CHECK-NEXT: [[RES_PH:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_INC]] ]
1808 ; CHECK-NEXT: br label [[CLEANUP3]]
1810 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RES_PH]], [[CLEANUP3_LOOPEXIT]] ]
1811 ; CHECK-NEXT: ret i1 [[RES]]
1814 %cmp13 = icmp eq i64 %count, 0
1815 br i1 %cmp13, label %cleanup3, label %for.body
1817 for.body: ; preds = %entry, %for.inc
1818 %ptr0.addr.016 = phi i8* [ %add.ptr, %for.inc ], [ %ptr0, %entry ]
1819 %i.015 = phi i64 [ %inc, %for.inc ], [ 0, %entry ]
1820 %ptr1.addr.014 = phi float* [ %incdec.ptr, %for.inc ], [ %ptr1, %entry ]
1821 %v0.0..sroa_cast = bitcast i8* %ptr0.addr.016 to i32*
1822 %v0.0.copyload = load i32, i32* %v0.0..sroa_cast
1823 %v1.0..sroa_cast = bitcast float* %ptr1.addr.014 to i32*
1824 %v1.0.copyload = load i32, i32* %v1.0..sroa_cast
1825 %cmp1 = icmp eq i32 %v0.0.copyload, %v1.0.copyload
1826 br i1 %cmp1, label %for.inc, label %cleanup3
1828 for.inc: ; preds = %for.body
1829 %inc = add nuw i64 %i.015, 1
1830 %add.ptr = getelementptr inbounds i8, i8* %ptr0.addr.016, i64 4
1831 %incdec.ptr = getelementptr inbounds float, float* %ptr1.addr.014, i64 1
1832 %cmp = icmp ult i64 %inc, %count
1833 br i1 %cmp, label %for.body, label %cleanup3
1835 cleanup3: ; preds = %for.body, %for.inc, %entry
1836 %res = phi i1 [ true, %entry ], [ true, %for.inc ], [ false, %for.body ]
1841 define i1 @_Z17overlapping_loadsPKcS0_m(i8* %ptr0, i8* %ptr1, i64 %count) {
1842 ; CHECK-LABEL: @_Z17overlapping_loadsPKcS0_m(
1843 ; CHECK-NEXT: entry:
1844 ; CHECK-NEXT: [[CMP14:%.*]] = icmp eq i64 [[COUNT:%.*]], 0
1845 ; CHECK-NEXT: br i1 [[CMP14]], label [[CLEANUP4:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
1846 ; CHECK: for.body.preheader:
1847 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
1849 ; CHECK-NEXT: [[PTR0_ADDR_017:%.*]] = phi i8* [ [[INCDEC_PTR:%.*]], [[FOR_INC:%.*]] ], [ [[PTR0:%.*]], [[FOR_BODY_PREHEADER]] ]
1850 ; CHECK-NEXT: [[I_016:%.*]] = phi i64 [ [[INC:%.*]], [[FOR_INC]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
1851 ; CHECK-NEXT: [[PTR1_ADDR_015:%.*]] = phi i8* [ [[INCDEC_PTR3:%.*]], [[FOR_INC]] ], [ [[PTR1:%.*]], [[FOR_BODY_PREHEADER]] ]
1852 ; CHECK-NEXT: [[V0_0__SROA_CAST:%.*]] = bitcast i8* [[PTR0_ADDR_017]] to i32*
1853 ; CHECK-NEXT: [[V0_0_COPYLOAD:%.*]] = load i32, i32* [[V0_0__SROA_CAST]]
1854 ; CHECK-NEXT: [[V1_0__SROA_CAST:%.*]] = bitcast i8* [[PTR1_ADDR_015]] to i32*
1855 ; CHECK-NEXT: [[V1_0_COPYLOAD:%.*]] = load i32, i32* [[V1_0__SROA_CAST]]
1856 ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[V0_0_COPYLOAD]], [[V1_0_COPYLOAD]]
1857 ; CHECK-NEXT: br i1 [[CMP1]], label [[FOR_INC]], label [[CLEANUP4_LOOPEXIT:%.*]]
1859 ; CHECK-NEXT: [[INC]] = add nuw i64 [[I_016]], 1
1860 ; CHECK-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i8, i8* [[PTR0_ADDR_017]], i64 1
1861 ; CHECK-NEXT: [[INCDEC_PTR3]] = getelementptr inbounds i8, i8* [[PTR1_ADDR_015]], i64 1
1862 ; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[INC]], [[COUNT]]
1863 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[CLEANUP4_LOOPEXIT]]
1864 ; CHECK: cleanup4.loopexit:
1865 ; CHECK-NEXT: [[RES_PH:%.*]] = phi i1 [ false, [[FOR_BODY]] ], [ true, [[FOR_INC]] ]
1866 ; CHECK-NEXT: br label [[CLEANUP4]]
1868 ; CHECK-NEXT: [[RES:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[RES_PH]], [[CLEANUP4_LOOPEXIT]] ]
1869 ; CHECK-NEXT: ret i1 [[RES]]
1872 %cmp14 = icmp eq i64 %count, 0
1873 br i1 %cmp14, label %cleanup4, label %for.body
1875 for.body: ; preds = %entry, %for.inc
1876 %ptr0.addr.017 = phi i8* [ %incdec.ptr, %for.inc ], [ %ptr0, %entry ]
1877 %i.016 = phi i64 [ %inc, %for.inc ], [ 0, %entry ]
1878 %ptr1.addr.015 = phi i8* [ %incdec.ptr3, %for.inc ], [ %ptr1, %entry ]
1879 %v0.0..sroa_cast = bitcast i8* %ptr0.addr.017 to i32*
1880 %v0.0.copyload = load i32, i32* %v0.0..sroa_cast
1881 %v1.0..sroa_cast = bitcast i8* %ptr1.addr.015 to i32*
1882 %v1.0.copyload = load i32, i32* %v1.0..sroa_cast
1883 %cmp1 = icmp eq i32 %v0.0.copyload, %v1.0.copyload
1884 br i1 %cmp1, label %for.inc, label %cleanup4
1886 for.inc: ; preds = %for.body
1887 %inc = add nuw i64 %i.016, 1
1888 %incdec.ptr = getelementptr inbounds i8, i8* %ptr0.addr.017, i64 1
1889 %incdec.ptr3 = getelementptr inbounds i8, i8* %ptr1.addr.015, i64 1
1890 %cmp = icmp ult i64 %inc, %count
1891 br i1 %cmp, label %for.body, label %cleanup4
1893 cleanup4: ; preds = %for.body, %for.inc, %entry
1894 %res = phi i1 [ true, %entry ], [ true, %for.inc ], [ false, %for.body ]