1 ; RUN: opt %loadNPMPolly '-passes=print<polly-dependences>' -aa-pipeline=basic-aa -disable-output < %s | FileCheck %s
3 ; CHECK: RAW dependences:
5 ; CHECK-NEXT: WAR dependences:
7 ; CHECK-NEXT: WAW dependences:
9 ; CHECK-NEXT: Reduction dependences:
10 ; CHECK-NEXT: { Stmt_for_body3[i0, i1] -> Stmt_for_body3[i0, 1 + i1] : 0 <= i0 <= 99 and 0 <= i1 <= 98; Stmt_for_body3[i0, 99] -> Stmt_for_body3[1 + i0, 0] : 0 <= i0 <= 98 }
12 ; int f(int * restrict A, int * restrict sum) {
14 ; for (i = 0; i < 100; i++) {
15 ; for (j = 0; j < 100; j++) {
17 ; for (k = 0; k< 100; k++) {}
22 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
24 define void @f(ptr noalias %A, ptr noalias %sum) {
28 for.cond: ; preds = %for.inc11, %entry
29 %i.0 = phi i32 [ 0, %entry ], [ %inc12, %for.inc11 ]
30 %exitcond2 = icmp ne i32 %i.0, 100
31 br i1 %exitcond2, label %for.body, label %for.end13
33 for.body: ; preds = %for.cond
36 for.cond1: ; preds = %for.inc8, %for.body
37 %j.0 = phi i32 [ 0, %for.body ], [ %inc9, %for.inc8 ]
38 %exitcond1 = icmp ne i32 %j.0, 100
39 br i1 %exitcond1, label %for.body3, label %for.end10
41 for.body3: ; preds = %for.cond1
42 %add = add nsw i32 %i.0, %j.0
43 %arrayidx = getelementptr inbounds i32, ptr %A, i32 %add
44 %tmp3 = load i32, ptr %arrayidx, align 4
45 %tmp4 = load i32, ptr %sum, align 4
46 %add4 = add nsw i32 %tmp4, %tmp3
47 store i32 %add4, ptr %sum, align 4
50 for.cond5: ; preds = %for.inc, %for.body3
51 %k.0 = phi i32 [ 0, %for.body3 ], [ %inc, %for.inc ]
52 %exitcond = icmp ne i32 %k.0, 100
53 br i1 %exitcond, label %for.body7, label %for.end
55 for.body7: ; preds = %for.cond5
58 for.inc: ; preds = %for.body7
59 %inc = add nsw i32 %k.0, 1
62 for.end: ; preds = %for.cond5
65 for.inc8: ; preds = %for.end
66 %inc9 = add nsw i32 %j.0, 1
69 for.end10: ; preds = %for.cond1
72 for.inc11: ; preds = %for.end10
73 %inc12 = add nsw i32 %i.0, 1
76 for.end13: ; preds = %for.cond