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 %s 2>&1 | FileCheck %s
4 define void @all_exits_dominate_latch_countable_exits_at_most_500_iterations(ptr %A, ptr %B) {
5 ; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_500_iterations'
6 ; CHECK-NEXT: loop.header:
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.B = getelementptr inbounds i32, ptr %B, i64 %iv
13 ; CHECK-NEXT: Against group ([[GRP2:0x[0-9a-f]+]]):
14 ; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
15 ; CHECK-NEXT: Grouped accesses:
16 ; CHECK-NEXT: Group [[GRP1]]:
17 ; CHECK-NEXT: (Low: %B High: (2000 + %B))
18 ; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>
19 ; CHECK-NEXT: Group [[GRP2]]:
20 ; CHECK-NEXT: (Low: %A High: (2000 + %A))
21 ; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>
23 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
24 ; CHECK-NEXT: SCEV assumptions:
26 ; CHECK-NEXT: Expressions re-written:
32 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]
33 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
34 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv
35 %l = load i32, ptr %gep.A, align 4
36 store i32 0, ptr %gep.B, align 4
37 %cntable.c.1 = icmp ult i64 %iv, 1000
38 %iv.next = add nuw nsw i64 %iv, 1
39 br i1 %cntable.c.1, label %b2, label %e.1
42 %uncntable.c.0 = icmp eq i32 %l, 0
43 br i1 %uncntable.c.0, label %e.2, label %b3
46 %cntable.c.2 = icmp eq i64 %iv.next, 500
47 br i1 %cntable.c.2, label %cleanup4, label %latch
64 define i32 @all_exits_dominate_latch_countable_exits_at_most_1000_iterations(ptr %A, ptr %B) {
65 ; CHECK-LABEL: 'all_exits_dominate_latch_countable_exits_at_most_1000_iterations'
66 ; CHECK-NEXT: loop.header:
67 ; CHECK-NEXT: Memory dependences are safe with run-time checks
68 ; CHECK-NEXT: Dependences:
69 ; CHECK-NEXT: Run-time memory checks:
70 ; CHECK-NEXT: Check 0:
71 ; CHECK-NEXT: Comparing group ([[GRP3:0x[0-9a-f]+]]):
72 ; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv
73 ; CHECK-NEXT: Against group ([[GRP4:0x[0-9a-f]+]]):
74 ; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
75 ; CHECK-NEXT: Grouped accesses:
76 ; CHECK-NEXT: Group [[GRP3]]:
77 ; CHECK-NEXT: (Low: %B High: (4004 + %B))
78 ; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>
79 ; CHECK-NEXT: Group [[GRP4]]:
80 ; CHECK-NEXT: (Low: %A High: (4004 + %A))
81 ; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>
83 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
84 ; CHECK-NEXT: SCEV assumptions:
86 ; CHECK-NEXT: Expressions re-written:
92 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]
93 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
94 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv
95 %l = load i32, ptr %gep.A, align 4
96 store i32 0, ptr %gep.B, align 4
97 %cntable.c.1 = icmp ult i64 %iv, 1000
98 br i1 %cntable.c.1, label %b2, label %e.1
101 %uncntable.c.0 = icmp eq i32 %l, 0
102 br i1 %uncntable.c.0, label %e.2, label %b3
105 %iv.next = add nuw nsw i64 %iv, 1
106 %cntable.c.2 = icmp eq i64 %iv.next, 2000
107 br i1 %cntable.c.2, label %e.0, label %latch
110 br label %loop.header
123 define i32 @not_all_exits_dominate_latch(ptr %A, ptr %B) {
124 ; CHECK-LABEL: 'not_all_exits_dominate_latch'
125 ; CHECK-NEXT: loop.header:
126 ; CHECK-NEXT: Report: could not determine number of loop iterations
127 ; CHECK-NEXT: Dependences:
128 ; CHECK-NEXT: Run-time memory checks:
129 ; CHECK-NEXT: Grouped accesses:
131 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
132 ; CHECK-NEXT: SCEV assumptions:
134 ; CHECK-NEXT: Expressions re-written:
137 br label %loop.header
140 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]
141 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
142 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv
143 %l = load i32, ptr %gep.A, align 4
144 store i32 0, ptr %gep.B, align 4
145 %cntable.c.1 = icmp ult i64 %iv, 1000
146 %iv.next = add nuw nsw i64 %iv, 1
147 br i1 %cntable.c.1, label %b2, label %latch
150 %uncntable.c.0 = icmp eq i32 %l, 0
151 br i1 %uncntable.c.0, label %e.2, label %b3
154 %cntable.c.2 = icmp eq i64 %iv.next, 2000
155 br i1 %cntable.c.2, label %e.0, label %latch
158 br label %loop.header
167 define i32 @b3_does_not_dominate_latch(ptr %A, ptr %B) {
168 ; CHECK-LABEL: 'b3_does_not_dominate_latch'
169 ; CHECK-NEXT: loop.header:
170 ; CHECK-NEXT: Memory dependences are safe with run-time checks
171 ; CHECK-NEXT: Dependences:
172 ; CHECK-NEXT: Run-time memory checks:
173 ; CHECK-NEXT: Check 0:
174 ; CHECK-NEXT: Comparing group ([[GRP5:0x[0-9a-f]+]]):
175 ; CHECK-NEXT: %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv
176 ; CHECK-NEXT: Against group ([[GRP6:0x[0-9a-f]+]]):
177 ; CHECK-NEXT: %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
178 ; CHECK-NEXT: Grouped accesses:
179 ; CHECK-NEXT: Group [[GRP5]]:
180 ; CHECK-NEXT: (Low: %B High: (4004 + %B))
181 ; CHECK-NEXT: Member: {%B,+,4}<nuw><%loop.header>
182 ; CHECK-NEXT: Group [[GRP6]]:
183 ; CHECK-NEXT: (Low: %A High: (4004 + %A))
184 ; CHECK-NEXT: Member: {%A,+,4}<nuw><%loop.header>
186 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
187 ; CHECK-NEXT: SCEV assumptions:
189 ; CHECK-NEXT: Expressions re-written:
192 br label %loop.header
195 %iv = phi i64 [ 0, %entry ], [ %iv.next, %latch ]
196 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
197 %gep.B = getelementptr inbounds i32, ptr %B, i64 %iv
198 %l = load i32, ptr %gep.A, align 4
199 store i32 0, ptr %gep.B, align 4
200 %cntable.c.1 = icmp ult i64 %iv, 1000
201 %iv.next = add nuw nsw i64 %iv, 1
202 br i1 %cntable.c.1, label %b2, label %e.1
205 %uncntable.c.0 = icmp eq i32 %l, 0
206 br i1 %uncntable.c.0, label %latch, label %b3
209 %cntable.c.2 = icmp eq i64 %iv.next, 500
210 br i1 %cntable.c.2, label %e.0, label %latch
213 br label %loop.header