1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -passes='print<access-info>' -disable-output 2>&1 < %s | FileCheck %s
4 define void @test(ptr noalias %x, ptr noalias %y, ptr noalias %z) {
7 ; 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
8 ; CHECK-NEXT: Unsafe indirect dependence.
9 ; CHECK-NEXT: Dependences:
10 ; CHECK-NEXT: IndirectUnsafe:
11 ; CHECK-NEXT: %load = load double, ptr %gep.sel, align 8 ->
12 ; CHECK-NEXT: store double %load, ptr %gep.sel2, align 8
14 ; CHECK-NEXT: Run-time memory checks:
15 ; CHECK-NEXT: Grouped accesses:
17 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
18 ; CHECK-NEXT: SCEV assumptions:
20 ; CHECK-NEXT: Expressions re-written:
23 %gep.y = getelementptr double, ptr %y, i64 -32
27 %iv = phi i64 [ %iv.next, %loop ], [ 0, %entry ]
28 %icmp = icmp ule i64 %iv, 32
29 %sel = select i1 %icmp, ptr %x, ptr %gep.y
30 %gep.sel = getelementptr inbounds double, ptr %sel, i64 %iv
31 %load = load double, ptr %gep.sel, align 8
32 %sel2 = select i1 %icmp, ptr %y, ptr %z
33 %gep.sel2 = getelementptr inbounds double, ptr %sel2, i64 %iv
34 store double %load, ptr %gep.sel2, align 8
35 %iv.next = add nuw nsw i64 %iv, 1
36 %exit.cond = icmp eq i64 %iv, 94
37 br i1 %exit.cond, label %exit, label %loop
43 ; Same as previous test, but with selects replaced by phis in the same block.
44 define void @test_phi(ptr noalias %x, ptr noalias %y, ptr noalias %z) {
45 ; CHECK-LABEL: 'test_phi'
47 ; 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
48 ; CHECK-NEXT: Unsafe indirect dependence.
49 ; CHECK-NEXT: Dependences:
50 ; CHECK-NEXT: IndirectUnsafe:
51 ; CHECK-NEXT: %load = load double, ptr %gep.sel, align 8 ->
52 ; CHECK-NEXT: store double %load, ptr %gep.sel2, align 8
54 ; CHECK-NEXT: Run-time memory checks:
55 ; CHECK-NEXT: Grouped accesses:
57 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
58 ; CHECK-NEXT: SCEV assumptions:
60 ; CHECK-NEXT: Expressions re-written:
63 %gep.y = getelementptr double, ptr %y, i64 -32
67 %iv = phi i64 [ %iv.next, %latch ], [ 0, %entry ]
68 %icmp = icmp ule i64 %iv, 32
69 br i1 %icmp, label %if, label %latch
75 %sel = phi ptr [ %x, %if ], [ %gep.y, %loop ]
76 %sel2 = phi ptr [ %y, %if ], [ %z, %loop ]
77 %gep.sel = getelementptr inbounds double, ptr %sel, i64 %iv
78 %load = load double, ptr %gep.sel, align 8
79 %gep.sel2 = getelementptr inbounds double, ptr %sel2, i64 %iv
80 store double %load, ptr %gep.sel2, align 8
81 %iv.next = add nuw nsw i64 %iv, 1
82 %exit.cond = icmp eq i64 %iv, 94
83 br i1 %exit.cond, label %exit, label %loop