1 ; RUN: opt %loadPolly -polly-dependences -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-dependences -polly-dependences-analysis-level=reference-wise -analyze < %s | FileCheck %s
3 ; RUN: opt %loadPolly -polly-dependences -polly-dependences-analysis-level=access-wise -analyze < %s | FileCheck %s
5 ; CHECK: RAW dependences:
7 ; CHECK-NEXT: WAR dependences:
9 ; CHECK-NEXT: WAW dependences:
11 ; CHECK-NEXT: Reduction dependences:
12 ; CHECK-NEXT: { Stmt_for_body3[i0, i1] -> Stmt_for_body3[2 + i0, -1 + i1] : 0 <= i0 <= 97 and 0 < i1 <= 99 }
15 ; for (int i = 0; i < 100; i++)
16 ; for (int j = 0; j < 100; j++)
17 ; sum[i+j*2] += j * i;
19 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
21 define void @f(i32* %sum) {
25 for.cond: ; preds = %for.inc6, %entry
26 %i.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ]
27 %exitcond1 = icmp ne i32 %i.0, 100
28 br i1 %exitcond1, label %for.body, label %for.end8
30 for.body: ; preds = %for.cond
33 for.cond1: ; preds = %for.inc, %for.body
34 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
35 %exitcond = icmp ne i32 %j.0, 100
36 br i1 %exitcond, label %for.body3, label %for.end
38 for.body3: ; preds = %for.cond1
39 %mul = mul nsw i32 %j.0, %i.0
40 %mul4 = shl nsw i32 %j.0, 1
41 %add = add nsw i32 %i.0, %mul4
42 %arrayidx = getelementptr inbounds i32, i32* %sum, i32 %add
43 %tmp = load i32, i32* %arrayidx, align 4
44 %add5 = add nsw i32 %tmp, %mul
45 store i32 %add5, i32* %arrayidx, align 4
48 for.inc: ; preds = %for.body3
49 %inc = add nsw i32 %j.0, 1
52 for.end: ; preds = %for.cond1
55 for.inc6: ; preds = %for.end
56 %inc7 = add nsw i32 %i.0, 1
59 for.end8: ; preds = %for.cond