1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 3
2 ; RUN: opt -passes='print<access-info>' -disable-output %s 2>&1 | FileCheck %s
4 define void @test_invar_dependence_before_positive_strided_access_1(ptr %a) {
5 ; CHECK-LABEL: 'test_invar_dependence_before_positive_strided_access_1'
7 ; CHECK-NEXT: Memory dependences are safe
8 ; CHECK-NEXT: Dependences:
9 ; CHECK-NEXT: Run-time memory checks:
10 ; CHECK-NEXT: Grouped accesses:
12 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
13 ; CHECK-NEXT: SCEV assumptions:
15 ; CHECK-NEXT: Expressions re-written:
18 %gep.off = getelementptr i8, ptr %a, i32 4
22 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
23 %gep = getelementptr i32, ptr %gep.off, i32 %iv
25 store i32 %l, ptr %gep
26 %iv.next = add i32 %iv, 1
27 %ec = icmp eq i32 %iv.next, 100
28 br i1 %ec, label %exit, label %loop
34 define void @test_invar_dependence_before_positive_strided_access_2(ptr %a) {
35 ; CHECK-LABEL: 'test_invar_dependence_before_positive_strided_access_2'
37 ; CHECK-NEXT: Memory dependences are safe
38 ; CHECK-NEXT: Dependences:
39 ; CHECK-NEXT: Run-time memory checks:
40 ; CHECK-NEXT: Grouped accesses:
42 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
43 ; CHECK-NEXT: SCEV assumptions:
45 ; CHECK-NEXT: Expressions re-written:
48 %gep.off = getelementptr i8, ptr %a, i32 4
52 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
53 %gep = getelementptr i32, ptr %gep.off, i32 %iv
54 %l = load i32, ptr %gep
56 %iv.next = add i32 %iv, 1
57 %ec = icmp eq i32 %iv.next, 100
58 br i1 %ec, label %exit, label %loop
64 define void @test_invar_dependence_not_before_positive_strided_access_1(ptr %a) {
65 ; CHECK-LABEL: 'test_invar_dependence_not_before_positive_strided_access_1'
67 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
68 ; CHECK-NEXT: Unknown data dependence.
69 ; CHECK-NEXT: Dependences:
70 ; CHECK-NEXT: Unknown:
71 ; CHECK-NEXT: %l = load i32, ptr %a, align 4 ->
72 ; CHECK-NEXT: store i32 %l, ptr %gep, align 4
74 ; CHECK-NEXT: Run-time memory checks:
75 ; CHECK-NEXT: Grouped accesses:
77 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
78 ; CHECK-NEXT: SCEV assumptions:
80 ; CHECK-NEXT: Expressions re-written:
83 %gep.off = getelementptr i8, ptr %a, i32 3
87 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
88 %gep = getelementptr i32, ptr %gep.off, i32 %iv
90 store i32 %l, ptr %gep
91 %iv.next = add i32 %iv, 1
92 %ec = icmp eq i32 %iv.next, 100
93 br i1 %ec, label %exit, label %loop
99 define void @test_invar_dependence_not_before_positive_strided_access_2(ptr %a) {
100 ; CHECK-LABEL: 'test_invar_dependence_not_before_positive_strided_access_2'
102 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
103 ; CHECK-NEXT: Unknown data dependence.
104 ; CHECK-NEXT: Dependences:
105 ; CHECK-NEXT: Unknown:
106 ; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->
107 ; CHECK-NEXT: store i32 %l, ptr %a, align 4
109 ; CHECK-NEXT: Run-time memory checks:
110 ; CHECK-NEXT: Grouped accesses:
112 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
113 ; CHECK-NEXT: SCEV assumptions:
115 ; CHECK-NEXT: Expressions re-written:
118 %gep.off = getelementptr i8, ptr %a, i32 3
122 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
123 %gep = getelementptr i32, ptr %gep.off, i32 %iv
124 %l = load i32, ptr %gep
126 %iv.next = add i32 %iv, 1
127 %ec = icmp eq i32 %iv.next, 100
128 br i1 %ec, label %exit, label %loop
134 define void @test_invar_dependence_before_positive_strided_access_1_different_access_sizes(ptr %a) {
135 ; CHECK-LABEL: 'test_invar_dependence_before_positive_strided_access_1_different_access_sizes'
137 ; CHECK-NEXT: Memory dependences are safe
138 ; CHECK-NEXT: Dependences:
139 ; CHECK-NEXT: Run-time memory checks:
140 ; CHECK-NEXT: Grouped accesses:
142 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
143 ; CHECK-NEXT: SCEV assumptions:
145 ; CHECK-NEXT: Expressions re-written:
148 %gep.off = getelementptr i8, ptr %a, i32 4
152 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
153 %gep = getelementptr i32, ptr %gep.off, i32 %iv
154 %l = load i32, ptr %a
155 %t = trunc i32 %l to i8
156 store i8 %t, ptr %gep
157 %iv.next = add i32 %iv, 1
158 %ec = icmp eq i32 %iv.next, 100
159 br i1 %ec, label %exit, label %loop
165 define void @test_invar_dependence_not_before_positive_strided_access_1_different_access_sizes(ptr %a) {
166 ; CHECK-LABEL: 'test_invar_dependence_not_before_positive_strided_access_1_different_access_sizes'
168 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
169 ; CHECK-NEXT: Unknown data dependence.
170 ; CHECK-NEXT: Dependences:
171 ; CHECK-NEXT: Unknown:
172 ; CHECK-NEXT: %l = load i64, ptr %a, align 4 ->
173 ; CHECK-NEXT: store i32 %t, ptr %gep, align 4
175 ; CHECK-NEXT: Run-time memory checks:
176 ; CHECK-NEXT: Grouped accesses:
178 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
179 ; CHECK-NEXT: SCEV assumptions:
181 ; CHECK-NEXT: Expressions re-written:
184 %gep.off = getelementptr i8, ptr %a, i32 4
188 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
189 %gep = getelementptr i32, ptr %gep.off, i32 %iv
190 %l = load i64, ptr %a
191 %t = trunc i64 %l to i32
192 store i32 %t, ptr %gep
193 %iv.next = add i32 %iv, 1
194 %ec = icmp eq i32 %iv.next, 100
195 br i1 %ec, label %exit, label %loop
201 define void @test_invar_dependence_before_negative_strided_access_1(ptr %a) {
202 ; CHECK-LABEL: 'test_invar_dependence_before_negative_strided_access_1'
204 ; CHECK-NEXT: Memory dependences are safe
205 ; CHECK-NEXT: Dependences:
206 ; CHECK-NEXT: Run-time memory checks:
207 ; CHECK-NEXT: Grouped accesses:
209 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
210 ; CHECK-NEXT: SCEV assumptions:
212 ; CHECK-NEXT: Expressions re-written:
215 %gep.off = getelementptr i32, ptr %a, i32 100
219 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
220 %gep = getelementptr i32, ptr %gep.off, i32 %iv
221 %l = load i32, ptr %a
222 store i32 %l, ptr %gep
223 %iv.next = sub i32 %iv, 1
224 %ec = icmp eq i32 %iv.next, -100
225 br i1 %ec, label %exit, label %loop
231 define void @test_invar_dependence_before_negative_strided_access_2(ptr %a) {
232 ; CHECK-LABEL: 'test_invar_dependence_before_negative_strided_access_2'
234 ; CHECK-NEXT: Memory dependences are safe
235 ; CHECK-NEXT: Dependences:
236 ; CHECK-NEXT: Run-time memory checks:
237 ; CHECK-NEXT: Grouped accesses:
239 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
240 ; CHECK-NEXT: SCEV assumptions:
242 ; CHECK-NEXT: Expressions re-written:
245 %gep.off = getelementptr i32, ptr %a, i32 100
249 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
250 %gep = getelementptr i32, ptr %gep.off, i32 %iv
251 %l = load i32, ptr %gep
253 %iv.next = sub i32 %iv, 1
254 %ec = icmp eq i32 %iv.next, -100
255 br i1 %ec, label %exit, label %loop
262 define void @test_invar_dependence_not_before_negative_strided_access_1(ptr %a) {
263 ; CHECK-LABEL: 'test_invar_dependence_not_before_negative_strided_access_1'
265 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
266 ; CHECK-NEXT: Unknown data dependence.
267 ; CHECK-NEXT: Dependences:
268 ; CHECK-NEXT: Unknown:
269 ; CHECK-NEXT: %l = load i32, ptr %a, align 4 ->
270 ; CHECK-NEXT: store i32 %l, ptr %gep, align 4
272 ; CHECK-NEXT: Run-time memory checks:
273 ; CHECK-NEXT: Grouped accesses:
275 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
276 ; CHECK-NEXT: SCEV assumptions:
278 ; CHECK-NEXT: Expressions re-written:
281 %gep.off = getelementptr i32, ptr %a, i32 99
285 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
286 %gep = getelementptr i32, ptr %gep.off, i32 %iv
287 %l = load i32, ptr %a
288 store i32 %l, ptr %gep
289 %iv.next = sub i32 %iv, 1
290 %ec = icmp eq i32 %iv.next, -100
291 br i1 %ec, label %exit, label %loop
297 define void @test_invar_dependence_not_before_negative_strided_access_2(ptr %a) {
298 ; CHECK-LABEL: 'test_invar_dependence_not_before_negative_strided_access_2'
300 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
301 ; CHECK-NEXT: Unknown data dependence.
302 ; CHECK-NEXT: Dependences:
303 ; CHECK-NEXT: Unknown:
304 ; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->
305 ; CHECK-NEXT: store i32 %l, ptr %a, align 4
307 ; CHECK-NEXT: Run-time memory checks:
308 ; CHECK-NEXT: Grouped accesses:
310 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
311 ; CHECK-NEXT: SCEV assumptions:
313 ; CHECK-NEXT: Expressions re-written:
316 %gep.off = getelementptr i32, ptr %a, i32 99
320 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
321 %gep = getelementptr i32, ptr %gep.off, i32 %iv
322 %l = load i32, ptr %gep
324 %iv.next = sub i32 %iv, 1
325 %ec = icmp eq i32 %iv.next, -100
326 br i1 %ec, label %exit, label %loop
332 define void @test_both_invar_before_1(ptr %a) {
333 ; CHECK-LABEL: 'test_both_invar_before_1'
335 ; CHECK-NEXT: Memory dependences are safe
336 ; CHECK-NEXT: Dependences:
337 ; CHECK-NEXT: Run-time memory checks:
338 ; CHECK-NEXT: Grouped accesses:
340 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
341 ; CHECK-NEXT: SCEV assumptions:
343 ; CHECK-NEXT: Expressions re-written:
346 %gep.off = getelementptr i8, ptr %a, i32 4
350 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
351 %l = load i32, ptr %a
352 store i32 %l, ptr %gep.off
353 %iv.next = add i32 %iv, 1
354 %ec = icmp eq i32 %iv.next, 100
355 br i1 %ec, label %exit, label %loop
361 define void @test_both_invar_before_2(ptr %a) {
362 ; CHECK-LABEL: 'test_both_invar_before_2'
364 ; CHECK-NEXT: Memory dependences are safe
365 ; CHECK-NEXT: Dependences:
366 ; CHECK-NEXT: Run-time memory checks:
367 ; CHECK-NEXT: Grouped accesses:
369 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
370 ; CHECK-NEXT: SCEV assumptions:
372 ; CHECK-NEXT: Expressions re-written:
375 %gep.off = getelementptr i8, ptr %a, i32 4
379 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
380 %l = load i32, ptr %gep.off
382 %iv.next = add i32 %iv, 1
383 %ec = icmp eq i32 %iv.next, 100
384 br i1 %ec, label %exit, label %loop
390 define void @test_both_invar_not_before_1(ptr %a) {
391 ; CHECK-LABEL: 'test_both_invar_not_before_1'
393 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
394 ; CHECK-NEXT: Unknown data dependence.
395 ; CHECK-NEXT: Dependences:
396 ; CHECK-NEXT: Unknown:
397 ; CHECK-NEXT: %l = load i32, ptr %a, align 4 ->
398 ; CHECK-NEXT: store i32 %l, ptr %gep.off, align 4
400 ; CHECK-NEXT: Run-time memory checks:
401 ; CHECK-NEXT: Grouped accesses:
403 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
404 ; CHECK-NEXT: SCEV assumptions:
406 ; CHECK-NEXT: Expressions re-written:
409 %gep.off = getelementptr i8, ptr %a, i32 3
413 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
414 %l = load i32, ptr %a
415 store i32 %l, ptr %gep.off
416 %iv.next = add i32 %iv, 1
417 %ec = icmp eq i32 %iv.next, 100
418 br i1 %ec, label %exit, label %loop
424 define void @test_both_invar_not_before_2(ptr %a) {
425 ; CHECK-LABEL: 'test_both_invar_not_before_2'
427 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
428 ; CHECK-NEXT: Unknown data dependence.
429 ; CHECK-NEXT: Dependences:
430 ; CHECK-NEXT: Unknown:
431 ; CHECK-NEXT: %l = load i32, ptr %gep.off, align 4 ->
432 ; CHECK-NEXT: store i32 %l, ptr %a, align 4
434 ; CHECK-NEXT: Run-time memory checks:
435 ; CHECK-NEXT: Grouped accesses:
437 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
438 ; CHECK-NEXT: SCEV assumptions:
440 ; CHECK-NEXT: Expressions re-written:
443 %gep.off = getelementptr i8, ptr %a, i32 3
447 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
448 %l = load i32, ptr %gep.off
450 %iv.next = add i32 %iv, 1
451 %ec = icmp eq i32 %iv.next, 100
452 br i1 %ec, label %exit, label %loop
458 define void @test_invar_dependence_before_via_loop_guard_positive_strided_access_1(ptr %a, i32 %off) {
459 ; CHECK-LABEL: 'test_invar_dependence_before_via_loop_guard_positive_strided_access_1'
461 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
462 ; CHECK-NEXT: Unknown data dependence.
463 ; CHECK-NEXT: Dependences:
464 ; CHECK-NEXT: Unknown:
465 ; CHECK-NEXT: %l = load i32, ptr %a, align 4 ->
466 ; CHECK-NEXT: store i32 %l, ptr %gep, align 4
468 ; CHECK-NEXT: Run-time memory checks:
469 ; CHECK-NEXT: Grouped accesses:
471 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
472 ; CHECK-NEXT: SCEV assumptions:
474 ; CHECK-NEXT: Expressions re-written:
477 %gep.off = getelementptr i8, ptr %a, i32 %off
478 %c = icmp sge i32 %off, 4
479 br i1 %c, label %loop, label %exit
482 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
483 %gep = getelementptr i32, ptr %gep.off, i32 %iv
484 %l = load i32, ptr %a
485 store i32 %l, ptr %gep
486 %iv.next = add i32 %iv, 1
487 %ec = icmp eq i32 %iv.next, 100
488 br i1 %ec, label %exit, label %loop
494 define void @test_invar_dependence_before_via_loop_guard_positive_strided_access_2(ptr %a, i32 %off) {
495 ; CHECK-LABEL: 'test_invar_dependence_before_via_loop_guard_positive_strided_access_2'
497 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
498 ; CHECK-NEXT: Unknown data dependence.
499 ; CHECK-NEXT: Dependences:
500 ; CHECK-NEXT: Unknown:
501 ; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->
502 ; CHECK-NEXT: store i32 %l, ptr %a, align 4
504 ; CHECK-NEXT: Run-time memory checks:
505 ; CHECK-NEXT: Grouped accesses:
507 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
508 ; CHECK-NEXT: SCEV assumptions:
510 ; CHECK-NEXT: Expressions re-written:
513 %gep.off = getelementptr i8, ptr %a, i32 %off
514 %c = icmp sge i32 %off, 4
515 br i1 %c, label %loop, label %exit
518 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
519 %gep = getelementptr i32, ptr %gep.off, i32 %iv
520 %l = load i32, ptr %gep
522 %iv.next = add i32 %iv, 1
523 %ec = icmp eq i32 %iv.next, 100
524 br i1 %ec, label %exit, label %loop
529 define void @test_invar_dependence_not_before_via_loop_guard_positive_strided_access_1(ptr %a, i32 %off) {
530 ; CHECK-LABEL: 'test_invar_dependence_not_before_via_loop_guard_positive_strided_access_1'
532 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
533 ; CHECK-NEXT: Unknown data dependence.
534 ; CHECK-NEXT: Dependences:
535 ; CHECK-NEXT: Unknown:
536 ; CHECK-NEXT: %l = load i32, ptr %a, align 4 ->
537 ; CHECK-NEXT: store i32 %l, ptr %gep, align 4
539 ; CHECK-NEXT: Run-time memory checks:
540 ; CHECK-NEXT: Grouped accesses:
542 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
543 ; CHECK-NEXT: SCEV assumptions:
545 ; CHECK-NEXT: Expressions re-written:
548 %gep.off = getelementptr i8, ptr %a, i32 %off
549 %c = icmp sge i32 %off, 3
550 br i1 %c, label %loop, label %exit
553 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
554 %gep = getelementptr i32, ptr %gep.off, i32 %iv
555 %l = load i32, ptr %a
556 store i32 %l, ptr %gep
557 %iv.next = add i32 %iv, 1
558 %ec = icmp eq i32 %iv.next, 100
559 br i1 %ec, label %exit, label %loop
565 define void @test_invar_dependence_not_before_via_loop_guard_positive_strided_access_2(ptr %a, i32 %off) {
566 ; CHECK-LABEL: 'test_invar_dependence_not_before_via_loop_guard_positive_strided_access_2'
568 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
569 ; CHECK-NEXT: Unknown data dependence.
570 ; CHECK-NEXT: Dependences:
571 ; CHECK-NEXT: Unknown:
572 ; CHECK-NEXT: %l = load i32, ptr %gep, align 4 ->
573 ; CHECK-NEXT: store i32 %l, ptr %a, align 4
575 ; CHECK-NEXT: Run-time memory checks:
576 ; CHECK-NEXT: Grouped accesses:
578 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
579 ; CHECK-NEXT: SCEV assumptions:
581 ; CHECK-NEXT: Expressions re-written:
584 %gep.off = getelementptr i8, ptr %a, i32 %off
585 %c = icmp sge i32 %off, 3
586 br i1 %c, label %loop, label %exit
589 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
590 %gep = getelementptr i32, ptr %gep.off, i32 %iv
591 %l = load i32, ptr %gep
593 %iv.next = add i32 %iv, 1
594 %ec = icmp eq i32 %iv.next, 100
595 br i1 %ec, label %exit, label %loop
601 define void @test_invar_dependence_before_positive_strided_access_via_loop_guard_1(ptr %a, i32 %off) {
602 ; CHECK-LABEL: 'test_invar_dependence_before_positive_strided_access_via_loop_guard_1'
604 ; CHECK-NEXT: Report: could not determine number of loop iterations
605 ; CHECK-NEXT: Dependences:
606 ; CHECK-NEXT: Run-time memory checks:
607 ; CHECK-NEXT: Grouped accesses:
609 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
610 ; CHECK-NEXT: SCEV assumptions:
612 ; CHECK-NEXT: Expressions re-written:
615 %gep.off = getelementptr i8, ptr %a, i32 4
616 %c = icmp sge i32 %off, 0
617 br i1 %c, label %loop, label %exit
620 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
621 %gep = getelementptr i32, ptr %gep.off, i32 %iv
622 %l = load i32, ptr %gep
624 %iv.next = add i32 %iv, %off
625 %ec = icmp eq i32 %iv.next, 100
626 br i1 %ec, label %exit, label %loop
632 define void @test_invar_dependence_before_positive_strided_access_via_loop_guard_2(ptr %a, i32 %off) {
633 ; CHECK-LABEL: 'test_invar_dependence_before_positive_strided_access_via_loop_guard_2'
635 ; CHECK-NEXT: Report: could not determine number of loop iterations
636 ; CHECK-NEXT: Dependences:
637 ; CHECK-NEXT: Run-time memory checks:
638 ; CHECK-NEXT: Grouped accesses:
640 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
641 ; CHECK-NEXT: SCEV assumptions:
643 ; CHECK-NEXT: Expressions re-written:
646 %gep.off = getelementptr i8, ptr %a, i32 4
647 %c = icmp sge i32 %off, 0
648 br i1 %c, label %loop, label %exit
651 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
652 %gep = getelementptr i32, ptr %gep.off, i32 %iv
653 %l = load i32, ptr %a
654 store i32 %l, ptr %gep
655 %iv.next = add i32 %iv, %off
656 %ec = icmp eq i32 %iv.next, 100
657 br i1 %ec, label %exit, label %loop
663 define void @test_invar_dependence_not_known_beforepositive_strided_access_not_known_via_loop_guard_1(ptr %a, i32 %off) {
664 ; CHECK-LABEL: 'test_invar_dependence_not_known_beforepositive_strided_access_not_known_via_loop_guard_1'
666 ; CHECK-NEXT: Report: could not determine number of loop iterations
667 ; CHECK-NEXT: Dependences:
668 ; CHECK-NEXT: Run-time memory checks:
669 ; CHECK-NEXT: Grouped accesses:
671 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
672 ; CHECK-NEXT: SCEV assumptions:
674 ; CHECK-NEXT: Expressions re-written:
677 %gep.off = getelementptr i8, ptr %a, i32 4
681 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
682 %gep = getelementptr i32, ptr %gep.off, i32 %iv
683 %l = load i32, ptr %a
684 store i32 %l, ptr %gep
685 %iv.next = add i32 %iv, %off
686 %ec = icmp eq i32 %iv.next, 100
687 br i1 %ec, label %exit, label %loop
693 define void @test_invar_dependence_not_known_beforepositive_strided_access_not_known_via_loop_guard_2(ptr %a, i32 %off) {
694 ; CHECK-LABEL: 'test_invar_dependence_not_known_beforepositive_strided_access_not_known_via_loop_guard_2'
696 ; CHECK-NEXT: Report: could not determine number of loop iterations
697 ; CHECK-NEXT: Dependences:
698 ; CHECK-NEXT: Run-time memory checks:
699 ; CHECK-NEXT: Grouped accesses:
701 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
702 ; CHECK-NEXT: SCEV assumptions:
704 ; CHECK-NEXT: Expressions re-written:
707 %gep.off = getelementptr i8, ptr %a, i32 4
711 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
712 %gep = getelementptr i32, ptr %gep.off, i32 %iv
713 %l = load i32, ptr %gep
715 %iv.next = add i32 %iv, %off
716 %ec = icmp eq i32 %iv.next, 100
717 br i1 %ec, label %exit, label %loop
723 define void @test_invar_vector_dependence_before_positive_strided_access_1(ptr %a) {
724 ; CHECK-LABEL: 'test_invar_vector_dependence_before_positive_strided_access_1'
726 ; CHECK-NEXT: Memory dependences are safe
727 ; CHECK-NEXT: Dependences:
728 ; CHECK-NEXT: Run-time memory checks:
729 ; CHECK-NEXT: Grouped accesses:
731 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
732 ; CHECK-NEXT: SCEV assumptions:
734 ; CHECK-NEXT: Expressions re-written:
737 %gep.off = getelementptr i8, ptr %a, i32 4
741 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
742 %gep = getelementptr i32, ptr %gep.off, i32 %iv
743 %l = load <4 x i8>, ptr %a
744 store i32 0, ptr %gep
745 %iv.next = add i32 %iv, 1
746 %ec = icmp eq i32 %iv.next, 100
747 br i1 %ec, label %exit, label %loop
753 define void @test_invar_scalable_dependence_before_positive_strided_access_1(ptr %a) {
754 ; CHECK-LABEL: 'test_invar_scalable_dependence_before_positive_strided_access_1'
756 ; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
757 ; CHECK-NEXT: Unknown data dependence.
758 ; CHECK-NEXT: Dependences:
759 ; CHECK-NEXT: Unknown:
760 ; CHECK-NEXT: %l = load <vscale x 4 x i8>, ptr %a, align 4 ->
761 ; CHECK-NEXT: store i32 0, ptr %gep, align 4
763 ; CHECK-NEXT: Run-time memory checks:
764 ; CHECK-NEXT: Grouped accesses:
766 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
767 ; CHECK-NEXT: SCEV assumptions:
769 ; CHECK-NEXT: Expressions re-written:
772 %gep.off = getelementptr i8, ptr %a, i32 4
776 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
777 %gep = getelementptr i32, ptr %gep.off, i32 %iv
778 %l = load <vscale x 4 x i8>, ptr %a
779 store i32 0, ptr %gep
780 %iv.next = add i32 %iv, 1
781 %ec = icmp eq i32 %iv.next, 100
782 br i1 %ec, label %exit, label %loop