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 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
6 ; FIXME: Start == End for access group with AddRec.
7 define void @runtime_checks_with_symbolic_max_btc_neg_1(ptr %P, ptr %S, i32 %x, i32 %y) {
8 ; CHECK-LABEL: 'runtime_checks_with_symbolic_max_btc_neg_1'
10 ; CHECK-NEXT: Memory dependences are safe with run-time checks
11 ; CHECK-NEXT: Dependences:
12 ; CHECK-NEXT: Run-time memory checks:
13 ; CHECK-NEXT: Check 0:
14 ; CHECK-NEXT: Comparing group ([[GRP1:0x[0-9a-f]+]]):
15 ; CHECK-NEXT: %gep.iv = getelementptr inbounds i32, ptr %P, i32 %iv
16 ; CHECK-NEXT: Against group ([[GRP2:0x[0-9a-f]+]]):
18 ; CHECK-NEXT: Grouped accesses:
19 ; CHECK-NEXT: Group [[GRP1]]:
20 ; CHECK-NEXT: (Low: ((4 * %y) + %P) High: ((4 * %y) + %P))
21 ; CHECK-NEXT: Member: {((4 * %y) + %P),+,4}<%loop>
22 ; CHECK-NEXT: Group [[GRP2]]:
23 ; CHECK-NEXT: (Low: %S High: (4 + %S))
24 ; CHECK-NEXT: Member: %S
26 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
27 ; CHECK-NEXT: SCEV assumptions:
29 ; CHECK-NEXT: Expressions re-written:
35 %iv = phi i32 [ %y, %entry ], [ %iv.next, %loop ]
36 %gep.iv = getelementptr inbounds i32, ptr %P, i32 %iv
38 store i32 %l, ptr %gep.iv, align 4
39 %iv.next = add nsw i32 %iv, 1
40 %c.2 = icmp slt i32 %iv.next, %l
41 br i1 %c.2, label %loop, label %exit
47 ; FIXME: Start > End for access group with AddRec.
48 define void @runtime_check_with_symbolic_max_btc_neg_2(ptr %P, ptr %S, i32 %x, i32 %y) {
49 ; CHECK-LABEL: 'runtime_check_with_symbolic_max_btc_neg_2'
51 ; CHECK-NEXT: Memory dependences are safe with run-time checks
52 ; CHECK-NEXT: Dependences:
53 ; CHECK-NEXT: Run-time memory checks:
54 ; CHECK-NEXT: Check 0:
55 ; CHECK-NEXT: Comparing group ([[GRP3:0x[0-9a-f]+]]):
56 ; CHECK-NEXT: %gep.iv = getelementptr inbounds i32, ptr %P, i32 %iv
57 ; CHECK-NEXT: Against group ([[GRP4:0x[0-9a-f]+]]):
59 ; CHECK-NEXT: Grouped accesses:
60 ; CHECK-NEXT: Group [[GRP3]]:
61 ; CHECK-NEXT: (Low: ((4 * %y) + %P) High: (-4 + (4 * %y) + %P))
62 ; CHECK-NEXT: Member: {((4 * %y) + %P),+,4}<%loop>
63 ; CHECK-NEXT: Group [[GRP4]]:
64 ; CHECK-NEXT: (Low: %S High: (4 + %S))
65 ; CHECK-NEXT: Member: %S
67 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
68 ; CHECK-NEXT: SCEV assumptions:
70 ; CHECK-NEXT: Expressions re-written:
76 %iv = phi i32 [ %y, %entry ], [ %iv.next, %loop ]
77 %gep.iv = getelementptr inbounds i32, ptr %P, i32 %iv
79 store i32 %l, ptr %gep.iv, align 4
80 %iv.next = add nsw i32 %iv, 1
82 %c.2 = icmp slt i32 %iv.next, %a
83 br i1 %c.2, label %loop, label %exit
89 define i32 @check_no_dep_via_bounds_compare_symbolic_max_btc_neg_1(ptr %P, i32 %x, i32 %y) {
90 ; CHECK-LABEL: 'check_no_dep_via_bounds_compare_symbolic_max_btc_neg_1'
92 ; 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
93 ; CHECK-NEXT: Unknown data dependence.
94 ; CHECK-NEXT: Dependences:
95 ; CHECK-NEXT: Unknown:
96 ; CHECK-NEXT: store i64 0, ptr %gep.iv, align 4 ->
97 ; CHECK-NEXT: %l.2 = load i32, ptr %gep.P.4, align 4
99 ; CHECK-NEXT: Unknown:
100 ; CHECK-NEXT: %l = load i32, ptr %gep.iv, align 4 ->
101 ; CHECK-NEXT: store i64 0, ptr %gep.iv, align 4
103 ; CHECK-NEXT: Run-time memory checks:
104 ; CHECK-NEXT: Grouped accesses:
106 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
107 ; CHECK-NEXT: SCEV assumptions:
109 ; CHECK-NEXT: Expressions re-written:
112 %gep.P.4 = getelementptr inbounds nuw i8, ptr %P, i32 4
113 %gep.P.8 = getelementptr inbounds nuw i8, ptr %P, i32 8
117 %1 = phi i32 [ %x, %entry ], [ %sel, %loop.latch ]
118 %iv = phi i32 [ %y, %entry ], [ %iv.next, %loop.latch ]
119 %gep.iv = getelementptr inbounds i64, ptr %gep.P.8, i32 %iv
120 %l = load i32, ptr %gep.iv, align 4
121 %c.1 = icmp eq i32 %l, 3
122 br i1 %c.1, label %loop.latch, label %if.then
124 if.then: ; preds = %for.body
125 store i64 0, ptr %gep.iv, align 4
126 %l.2 = load i32, ptr %gep.P.4
130 %sel = phi i32 [ %l.2, %if.then ], [ %1, %loop ]
131 %iv.next = add nsw i32 %iv, 1
132 %c.2 = icmp slt i32 %iv.next, %sel
133 br i1 %c.2, label %loop, label %exit
136 %res = phi i32 [ %iv.next, %loop.latch ]