Debian Codegraph @

llvm/test/tools/UpdateTestChecks/update_analyze_test_checks/Inputs/loop-access-analysis-common-output.ll.expected

raw
1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt -disable-output -passes='print<access-info>' %s 2>&1 | FileCheck %s --check-prefixes=CHECK,FULLDEPTH
3 ; RUN: opt -disable-output -passes='print<access-info>' -max-forked-scev-depth=2 %s 2>&1 | FileCheck %s --check-prefixes=CHECK,DEPTH2
4
5 define void @laa_common_output(ptr %Base, ptr %Dest, ptr %Preds) {
6 ; CHECK-LABEL: 'laa_common_output'
7 ; CHECK-NEXT: for.body:
8 ; CHECK-NEXT: Report: cannot identify array bounds
9 ; CHECK-NEXT: Dependences:
10 ; CHECK-NEXT: Run-time memory checks:
11 ; CHECK-NEXT: Grouped accesses:
12 ; CHECK-EMPTY:
13 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
14 ; CHECK-NEXT: SCEV assumptions:
15 ; CHECK-EMPTY:
16 ; CHECK-NEXT: Expressions re-written:
17 ;
18 entry:
19 br label %for.body
20
21 for.cond.cleanup: ; preds = %for.body
22 ret void
23
24 for.body: ; preds = %entry, %for.body
25 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
26 %i.014 = phi i32 [ 0, %entry ], [ %add, %for.body ]
27 %arrayidx = getelementptr inbounds i32, ptr %Preds, i64 %indvars.iv
28 %0 = load i32, ptr %arrayidx, align 4
29 %cmp1.not = icmp eq i32 %0, 0
30 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
31 %add = add nuw nsw i32 %i.014, 1
32 %1 = trunc i64 %indvars.iv to i32
33 %offset.0 = select i1 %cmp1.not, i32 %add, i32 %1
34 %idxprom213 = zext i32 %offset.0 to i64
35 %arrayidx3 = getelementptr inbounds float, ptr %Base, i64 %idxprom213
36 %2 = load float, ptr %arrayidx3, align 4
37 %arrayidx5 = getelementptr inbounds float, ptr %Dest, i64 %indvars.iv
38 store float %2, ptr %arrayidx5, align 4
39 %exitcond.not = icmp eq i64 %indvars.iv.next, 100
40 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
41 }
42
43 define void @laa_divergent_output(ptr %Base, ptr %Dest, ptr %Preds, i64 %extra_offset) {
44 ; FULLDEPTH-LABEL: 'laa_divergent_output'
45 ; FULLDEPTH-NEXT: for.body:
46 ; FULLDEPTH-NEXT: Memory dependences are safe with run-time checks
47 ; FULLDEPTH-NEXT: Dependences:
48 ; FULLDEPTH-NEXT: Run-time memory checks:
49 ; FULLDEPTH-NEXT: Check 0:
50 ; FULLDEPTH-NEXT: Comparing group GRP0:
51 ; FULLDEPTH-NEXT: %arrayidx5 = getelementptr inbounds float, ptr %Dest, i64 %indvars.iv
52 ; FULLDEPTH-NEXT: Against group GRP1:
53 ; FULLDEPTH-NEXT: %arrayidx = getelementptr inbounds i32, ptr %Preds, i64 %indvars.iv
54 ; FULLDEPTH-NEXT: Check 1:
55 ; FULLDEPTH-NEXT: Comparing group GRP0:
56 ; FULLDEPTH-NEXT: %arrayidx5 = getelementptr inbounds float, ptr %Dest, i64 %indvars.iv
57 ; FULLDEPTH-NEXT: Against group GRP2:
58 ; FULLDEPTH-NEXT: %arrayidx3 = getelementptr inbounds float, ptr %Base, i64 %offset
59 ; FULLDEPTH-NEXT: %arrayidx3 = getelementptr inbounds float, ptr %Base, i64 %offset
60 ; FULLDEPTH-NEXT: Grouped accesses:
61 ; FULLDEPTH-NEXT: Group GRP0:
62 ; FULLDEPTH-NEXT: (Low: %Dest High: (400 + %Dest))
63 ; FULLDEPTH-NEXT: Member: {%Dest,+,4}<nuw><%for.body>
64 ; FULLDEPTH-NEXT: Group GRP1:
65 ; FULLDEPTH-NEXT: (Low: %Preds High: (400 + %Preds))
66 ; FULLDEPTH-NEXT: Member: {%Preds,+,4}<nuw><%for.body>
67 ; FULLDEPTH-NEXT: Group GRP2:
68 ; FULLDEPTH-NEXT: (Low: ((4 * %extra_offset) + %Base) High: (404 + (4 * %extra_offset) + %Base))
69 ; FULLDEPTH-NEXT: Member: {(4 + (4 * %extra_offset) + %Base),+,4}<%for.body>
70 ; FULLDEPTH-NEXT: Member: {((4 * %extra_offset) + %Base),+,4}<%for.body>
71 ; FULLDEPTH-EMPTY:
72 ; FULLDEPTH-NEXT: Non vectorizable stores to invariant address were not found in loop.
73 ; FULLDEPTH-NEXT: SCEV assumptions:
74 ; FULLDEPTH-EMPTY:
75 ; FULLDEPTH-NEXT: Expressions re-written:
76 ;
77 ; DEPTH2-LABEL: 'laa_divergent_output'
78 ; DEPTH2-NEXT: for.body:
79 ; DEPTH2-NEXT: Report: cannot identify array bounds
80 ; DEPTH2-NEXT: Dependences:
81 ; DEPTH2-NEXT: Run-time memory checks:
82 ; DEPTH2-NEXT: Grouped accesses:
83 ; DEPTH2-EMPTY:
84 ; DEPTH2-NEXT: Non vectorizable stores to invariant address were not found in loop.
85 ; DEPTH2-NEXT: SCEV assumptions:
86 ; DEPTH2-EMPTY:
87 ; DEPTH2-NEXT: Expressions re-written:
88 ;
89 entry:
90 br label %for.body
91
92 for.cond.cleanup: ; preds = %for.body
93 ret void
94
95 for.body: ; preds = %entry, %for.body
96 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
97 %arrayidx = getelementptr inbounds i32, ptr %Preds, i64 %indvars.iv
98 %0 = load i32, ptr %arrayidx, align 4
99 %cmp.not = icmp eq i32 %0, 0
100 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
101 %sel = select i1 %cmp.not, i64 %indvars.iv.next, i64 %indvars.iv
102 %offset = add nuw nsw i64 %sel, %extra_offset
103 %arrayidx3 = getelementptr inbounds float, ptr %Base, i64 %offset
104 %1 = load float, ptr %arrayidx3, align 4
105 %arrayidx5 = getelementptr inbounds float, ptr %Dest, i64 %indvars.iv
106 store float %1, ptr %arrayidx5, align 4
107 %exitcond.not = icmp eq i64 %indvars.iv.next, 100
108 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
109 }