1 ; RUN: opt %loadPolly -polly-dependences -analyze < %s | FileCheck %s
3 ; CHECK: RAW dependences:
4 ; CHECK-NEXT: { Stmt_S0[i0] -> Stmt_S1[i0, o1] : 0 <= i0 <= 99 and 0 <= o1 <= 99; Stmt_S2[i0] -> Stmt_S0[1 + i0] : 0 <= i0 <= 98; Stmt_S1[i0, i1] -> Stmt_S2[i0] : 0 <= i0 <= 99 and 0 <= i1 <= 99 }
5 ; CHECK-NEXT: WAR dependences:
6 ; CHECK-NEXT: { Stmt_S0[i0] -> Stmt_S1[i0, o1] : 0 <= i0 <= 99 and 0 <= o1 <= 99; Stmt_S2[i0] -> Stmt_S0[1 + i0] : 0 <= i0 <= 98; Stmt_S1[i0, i1] -> Stmt_S2[i0] : 0 <= i0 <= 99 and 0 <= i1 <= 99 }
7 ; CHECK-NEXT: WAW dependences:
8 ; CHECK-NEXT: { Stmt_S0[i0] -> Stmt_S1[i0, o1] : 0 <= i0 <= 99 and 0 <= o1 <= 99; Stmt_S2[i0] -> Stmt_S0[1 + i0] : 0 <= i0 <= 98; Stmt_S1[i0, i1] -> Stmt_S2[i0] : 0 <= i0 <= 99 and 0 <= i1 <= 99 }
9 ; CHECK-NEXT: Reduction dependences:
10 ; CHECK-NEXT: { Stmt_S1[i0, i1] -> Stmt_S1[i0, 1 + i1] : 0 <= i0 <= 99 and 0 <= i1 <= 98 }
13 ; for (int i = 0; i < 100; i++) {
15 ; for (int j = 0; j < 100; j++)
21 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
23 define void @f(i32* %sum) {
27 for.cond: ; preds = %for.inc6, %entry
28 %i.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ]
29 %exitcond1 = icmp ne i32 %i.0, 100
30 br i1 %exitcond1, label %for.body, label %for.end8
32 for.body: ; preds = %for.cond
35 S0: ; preds = %for.body
36 %tmp = load i32, i32* %sum, align 4
37 %mul = mul nsw i32 %tmp, 42
38 store i32 %mul, i32* %sum, align 4
41 for.cond1: ; preds = %for.inc, %S0
42 %j.0 = phi i32 [ 0, %S0 ], [ %inc, %for.inc ]
43 %exitcond = icmp ne i32 %j.0, 100
44 br i1 %exitcond, label %for.body3, label %for.end
46 for.body3: ; preds = %for.cond1
49 S1: ; preds = %for.body3
50 %mul4 = mul nsw i32 %i.0, %j.0
51 %tmp2 = load i32, i32* %sum, align 4
52 %add = add nsw i32 %tmp2, %mul4
53 store i32 %add, i32* %sum, align 4
56 for.inc: ; preds = %S1
57 %inc = add nsw i32 %j.0, 1
60 for.end: ; preds = %for.cond1
63 S2: ; preds = %for.end
64 %tmp3 = load i32, i32* %sum, align 4
65 %mul5 = mul nsw i32 %tmp3, 7
66 store i32 %mul5, i32* %sum, align 4
69 for.inc6: ; preds = %S2
70 %inc7 = add nsw i32 %i.0, 1
73 for.end8: ; preds = %for.cond