1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt -passes='print<access-info>' < %s -disable-output 2>&1 | FileCheck %s
4 define void @laa(ptr nocapture readonly %Base1, ptr nocapture readonly %Base2, ptr %Dest) {
7 ; CHECK-NEXT: Memory dependences are safe with run-time checks
8 ; CHECK-NEXT: Dependences:
9 ; CHECK-NEXT: Run-time memory checks:
10 ; CHECK-NEXT: Check 0:
11 ; CHECK-NEXT: Comparing group ([[GRP1:0x[0-9a-f]+]]):
12 ; CHECK-NEXT: %gep.Dest = getelementptr inbounds float, ptr %Dest, i64 %iv
13 ; CHECK-NEXT: %gep.Dest = getelementptr inbounds float, ptr %Dest, i64 %iv
14 ; CHECK-NEXT: Against group ([[GRP2:0x[0-9a-f]+]]):
15 ; CHECK-NEXT: %select = select i1 %cmp, ptr %gep.1, ptr %gep.2
16 ; CHECK-NEXT: Check 1:
17 ; CHECK-NEXT: Comparing group ([[GRP1]]):
18 ; CHECK-NEXT: %gep.Dest = getelementptr inbounds float, ptr %Dest, i64 %iv
19 ; CHECK-NEXT: %gep.Dest = getelementptr inbounds float, ptr %Dest, i64 %iv
20 ; CHECK-NEXT: Against group ([[GRP3:0x[0-9a-f]+]]):
21 ; CHECK-NEXT: %select = select i1 %cmp, ptr %gep.1, ptr %gep.2
22 ; CHECK-NEXT: Grouped accesses:
23 ; CHECK-NEXT: Group [[GRP1]]:
24 ; CHECK-NEXT: (Low: %Dest High: (400 + %Dest))
25 ; CHECK-NEXT: Member: {%Dest,+,4}<nuw><%loop>
26 ; CHECK-NEXT: Member: {%Dest,+,4}<nuw><%loop>
27 ; CHECK-NEXT: Group [[GRP2]]:
28 ; CHECK-NEXT: (Low: %Base1 High: (400 + %Base1))
29 ; CHECK-NEXT: Member: {%Base1,+,4}<nw><%loop>
30 ; CHECK-NEXT: Group [[GRP3]]:
31 ; CHECK-NEXT: (Low: %Base2 High: (400 + %Base2))
32 ; CHECK-NEXT: Member: {%Base2,+,4}<nw><%loop>
34 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
35 ; CHECK-NEXT: SCEV assumptions:
37 ; CHECK-NEXT: Expressions re-written:
43 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
44 %gep.Dest = getelementptr inbounds float, ptr %Dest, i64 %iv
45 %l.Dest = load float, ptr %gep.Dest
46 %cmp = fcmp une float %l.Dest, 0.0
47 %gep.1 = getelementptr inbounds float, ptr %Base1, i64 %iv
48 %gep.2 = getelementptr inbounds float, ptr %Base2, i64 %iv
49 %select = select i1 %cmp, ptr %gep.1, ptr %gep.2
50 %sink = load float, ptr %select, align 4
51 store float %sink, ptr %gep.Dest, align 4
52 %iv.next = add nuw nsw i64 %iv, 1
53 %exitcond.not = icmp eq i64 %iv.next, 100
54 br i1 %exitcond.not, label %exit, label %loop
60 define void @test_brace_escapes(ptr noundef %arr) {
61 ; CHECK-LABEL: 'test_brace_escapes'
63 ; CHECK-NEXT: Report: could not determine number of loop iterations
64 ; CHECK-NEXT: Dependences:
65 ; CHECK-NEXT: Run-time memory checks:
66 ; CHECK-NEXT: Grouped accesses:
68 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
69 ; CHECK-NEXT: SCEV assumptions:
71 ; CHECK-NEXT: Expressions re-written:
73 ; CHECK-NEXT: Memory dependences are safe with run-time checks
74 ; CHECK-NEXT: Dependences:
75 ; CHECK-NEXT: Run-time memory checks:
76 ; CHECK-NEXT: Check 0:
77 ; CHECK-NEXT: Comparing group ([[GRP4:0x[0-9a-f]+]]):
78 ; CHECK-NEXT: %gep.iv.2 = getelementptr inbounds ptr, ptr %arr, i64 %iv.2
79 ; CHECK-NEXT: Against group ([[GRP5:0x[0-9a-f]+]]):
80 ; CHECK-NEXT: %gep.iv.1 = getelementptr inbounds ptr, ptr %arr, i64 %iv.1
81 ; CHECK-NEXT: Grouped accesses:
82 ; CHECK-NEXT: Group [[GRP4]]:
83 ; CHECK-NEXT: (Low: {(64 + %arr),+,64}<%loop.1> High: {(8064 + %arr),+,64}<%loop.1>)
84 ; CHECK-NEXT: Member: {{\{\{}}(64 + %arr),+,64}<%loop.1>,+,8}<%loop.2>
85 ; CHECK-NEXT: Group [[GRP5]]:
86 ; CHECK-NEXT: (Low: %arr High: (8000 + %arr))
87 ; CHECK-NEXT: Member: {%arr,+,8}<nuw><%loop.2>
89 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
90 ; CHECK-NEXT: SCEV assumptions:
92 ; CHECK-NEXT: Expressions re-written:
98 %iv = phi i64 [ %iv.next, %loop.1 ], [ 8, %entry ]
99 %arr.addr.0.i = phi ptr [ %incdec.ptr.i, %loop.1 ], [ %arr, %entry ]
100 %incdec.ptr.i = getelementptr inbounds ptr, ptr %arr.addr.0.i, i64 1
101 %0 = load ptr, ptr %arr.addr.0.i, align 8
102 %tobool.not.i = icmp eq ptr %0, null
103 %iv.next = add i64 %iv, 8
104 br i1 %tobool.not.i, label %loop.1.exit, label %loop.1
107 %iv.lcssa = phi i64 [ %iv, %loop.1 ]
111 %iv.1 = phi i64 [ 0, %loop.1.exit ], [ %iv.1.next, %loop.2 ]
112 %iv.2 = phi i64 [ %iv.lcssa, %loop.1.exit ], [ %iv.2.next, %loop.2 ]
113 %gep.iv.1 = getelementptr inbounds ptr, ptr %arr, i64 %iv.1
114 %l.1 = load ptr, ptr %gep.iv.1, align 8
115 %iv.2.next = add nsw i64 %iv.2, 1
116 %gep.iv.2 = getelementptr inbounds ptr, ptr %arr, i64 %iv.2
117 store ptr %l.1, ptr %gep.iv.2, align 8
118 %iv.1.next = add nuw nsw i64 %iv.1, 1
119 %cmp = icmp ult i64 %iv.1.next, 1000
120 br i1 %cmp, label %loop.2, label %exit