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 = "e-m:e-i64:64-i128:128-n32:64-S128"
6 ; void vectorizable_Read_Write(int *A) {
7 ; for (unsigned i = 1022; i >= 0; i--)
11 define void @vectorizable_Read_Write(ptr nocapture %A) {
12 ; CHECK-LABEL: 'vectorizable_Read_Write'
14 ; CHECK-NEXT: Memory dependences are safe
15 ; CHECK-NEXT: Dependences:
16 ; CHECK-NEXT: Forward:
17 ; CHECK-NEXT: %l = load i32, ptr %gep.A, align 4 ->
18 ; CHECK-NEXT: store i32 %add, ptr %gep.A.plus.1, align 4
20 ; CHECK-NEXT: Run-time memory checks:
21 ; CHECK-NEXT: Grouped accesses:
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:
29 %A.plus.1 = getelementptr i32, ptr %A, i64 1
33 %iv = phi i64 [ 1022, %entry ], [ %iv.next, %loop ]
34 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
35 %l = load i32, ptr %gep.A, align 4
36 %add = add nsw i32 %l, 1
37 %gep.A.plus.1 = getelementptr i32, ptr %A.plus.1, i64 %iv
38 store i32 %add, ptr %gep.A.plus.1, align 4
39 %iv.next = add nsw i64 %iv, -1
40 %cmp.not = icmp eq i64 %iv, 0
41 br i1 %cmp.not, label %exit, label %loop
47 define void @neg_step_ForwardButPreventsForwarding(ptr nocapture %A, ptr noalias %B) {
48 ; CHECK-LABEL: 'neg_step_ForwardButPreventsForwarding'
50 ; 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
51 ; CHECK-NEXT: Forward loop carried data dependence that prevents store-to-load forwarding.
52 ; CHECK-NEXT: Dependences:
53 ; CHECK-NEXT: ForwardButPreventsForwarding:
54 ; CHECK-NEXT: store i32 0, ptr %gep.A, align 4 ->
55 ; CHECK-NEXT: %l = load i32, ptr %gep.A.plus.1, align 4
57 ; CHECK-NEXT: Run-time memory checks:
58 ; CHECK-NEXT: Grouped accesses:
60 ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
61 ; CHECK-NEXT: SCEV assumptions:
63 ; CHECK-NEXT: Expressions re-written:
66 %A.plus.1 = getelementptr i32, ptr %A, i64 1
70 %iv = phi i64 [ 1022, %entry ], [ %iv.next, %loop ]
71 %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv
72 store i32 0, ptr %gep.A, align 4
73 %gep.A.plus.1 = getelementptr i32, ptr %A.plus.1, i64 %iv
74 %l = load i32, ptr %gep.A.plus.1, align 4
76 %iv.next = add nsw i64 %iv, -1
77 %cmp.not = icmp eq i64 %iv, 0
78 br i1 %cmp.not, label %exit, label %loop