1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes='print<access-info>' -disable-output %s 2>&1 | FileCheck %s
4 target datalayout = "S16-p:16:16-i1:16-i8:8-i32:16-i64:16-i128:16"
6 define void @safe_deps_1_due_to_dependence_distance(i16 %n, ptr %p) {
7 ; CHECK-LABEL: 'safe_deps_1_due_to_dependence_distance'
9 ; CHECK-NEXT: Memory dependences are safe
10 ; CHECK-NEXT: Dependences:
11 ; CHECK-NEXT: Run-time memory checks:
12 ; CHECK-NEXT: Grouped accesses:
14 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
15 ; CHECK-NEXT: SCEV assumptions:
17 ; CHECK-NEXT: Expressions re-written:
20 %cmp42 = icmp sgt i16 %n, 0
21 br i1 %cmp42, label %ph, label %exit
24 %gep.off = getelementptr i32, ptr %p, i16 %n
28 %iv = phi i16 [ 0, %ph ], [ %iv.next, %loop ]
29 %gep.iv = getelementptr inbounds i32, ptr %p, i16 %iv
30 store i32 0, ptr %gep.iv, align 1
31 %gep.off.iv = getelementptr i32, ptr %gep.off, i16 %iv
32 store i32 1, ptr %gep.off.iv, align 1
33 %iv.next = add i16 %iv, 1
34 %exitcond.not = icmp eq i16 %iv.next, %n
35 br i1 %exitcond.not, label %exit, label %loop
41 define void @safe_deps_2_due_to_dependence_distance(i16 %n, ptr %p3, i16 noundef %q, ptr %p1, ptr %p2) {
42 ; CHECK-LABEL: 'safe_deps_2_due_to_dependence_distance'
44 ; CHECK-NEXT: Memory dependences are safe
45 ; CHECK-NEXT: Dependences:
46 ; CHECK-NEXT: Run-time memory checks:
47 ; CHECK-NEXT: Grouped accesses:
49 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
50 ; CHECK-NEXT: SCEV assumptions:
52 ; CHECK-NEXT: Expressions re-written:
56 %alloca = alloca [2 x i32], i16 %0
57 %arrayidx1 = getelementptr inbounds i32, ptr %p1, i16 %q
58 %arrayidx2 = getelementptr inbounds i8, ptr %p3, i16 2
59 %arrayidx4 = getelementptr inbounds i32, ptr %p2, i16 %q
60 %cmp42 = icmp sgt i16 %n, 0
61 br i1 %cmp42, label %ph, label %exit
64 %arrayidx40 = getelementptr inbounds [2 x i32], ptr %alloca, i16 %n
68 %iv = phi i16 [ 0, %ph ], [ %iv.next, %loop ]
69 %arrayidx6 = getelementptr inbounds i32, ptr %arrayidx1, i16 %iv
70 %arrayidx11 = getelementptr inbounds i32, ptr %arrayidx4, i16 %iv
71 %arrayidx22 = getelementptr inbounds [2 x i32], ptr %alloca, i16 %iv
72 store i32 10, ptr %arrayidx22
73 %arrayidx33 = getelementptr inbounds i8, ptr %arrayidx22, i16 4
74 store i32 16, ptr %arrayidx33
75 %arrayidx42 = getelementptr inbounds [2 x i32], ptr %arrayidx40, i16 %iv
76 store i32 19, ptr %arrayidx42
77 %arrayidx53 = getelementptr inbounds i8, ptr %arrayidx42, i16 4
78 store i32 23, ptr %arrayidx53
79 %iv.next = add nuw nsw i16 %iv, 1
80 %exitcond.not = icmp eq i16 %iv.next, %n
81 br i1 %exitcond.not, label %exit, label %loop