[ForwardOpTree] Allow out-of-quota in examination part of forwardTree.
[polly-mirror.git] / test / DependenceInfo / reduction_privatization_deps_5.ll
blob9c002b4353efcab5d7bffa469c370e6030b78335
1 ; RUN: opt %loadPolly -polly-dependences -analyze < %s | FileCheck %s
3 ; CHECK:      RAW dependences:
4 ; CHECK-NEXT:     { Stmt_S2[i0, 0] -> Stmt_S1[1 + i0, 0] : 0 <= i0 <= 97; Stmt_S1[i0, 0] -> Stmt_S2[i0, 0] : 0 <= i0 <= 98 }
5 ; CHECK-NEXT: WAR dependences:
6 ; CHECK-NEXT:     { Stmt_S2[i0, 0] -> Stmt_S1[1 + i0, 0] : 0 <= i0 <= 97; Stmt_S1[i0, 0] -> Stmt_S2[i0, 0] : 0 <= i0 <= 98 }
7 ; CHECK-NEXT: WAW dependences:
8 ; CHECK-NEXT:     { Stmt_S2[i0, 0] -> Stmt_S1[1 + i0, 0] : 0 <= i0 <= 97; Stmt_S1[i0, 0] -> Stmt_S2[i0, 0] : 0 <= i0 <= 98 }
9 ; CHECK-NEXT: Reduction dependences:
10 ; CHECK-NEXT:     { Stmt_S2[i0, i1] -> Stmt_S2[1 + i0, i1] : 0 <= i0 <= 97 and 0 < i1 <= 99 }
12 ;    void f(int *sum) {
13 ;      for (int i = 0; i < 99; i++) {
14 ;        for (int j = 0; j < 1; j++)
15 ; S1:      sum[j] += 42;
16 ;        for (int j = 0; j < 100; j++)
17 ; S2:      sum[j] += i * j;
18 ;      }
19 ;    }
21 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
23 define void @f(i32* %sum)  {
24 entry:
25   br label %for.cond
27 for.cond:                                         ; preds = %for.inc12, %entry
28   %i.0 = phi i32 [ 0, %entry ], [ %inc13, %for.inc12 ]
29   %exitcond2 = icmp ne i32 %i.0, 99
30   br i1 %exitcond2, label %for.body, label %for.end14
32 for.body:                                         ; preds = %for.cond
33   br label %for.cond1
35 for.cond1:                                        ; preds = %for.inc, %for.body
36   %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
37   %exitcond = icmp ne i32 %j.0, 1
38   br i1 %exitcond, label %for.body3, label %for.end
40 for.body3:                                        ; preds = %for.cond1
41   br label %S1
43 S1:                                               ; preds = %for.body3
44   %arrayidx = getelementptr inbounds i32, i32* %sum, i32 %j.0
45   %tmp = load i32, i32* %arrayidx, align 4
46   %add = add nsw i32 %tmp, 42
47   store i32 %add, i32* %arrayidx, align 4
48   br label %for.inc
50 for.inc:                                          ; preds = %S1
51   %inc = add nsw i32 %j.0, 1
52   br label %for.cond1
54 for.end:                                          ; preds = %for.cond1
55   br label %for.cond4
57 for.cond4:                                        ; preds = %for.inc9, %for.end
58   %j.1 = phi i32 [ 0, %for.end ], [ %inc10, %for.inc9 ]
59   %exitcond1 = icmp ne i32 %j.1, 100
60   br i1 %exitcond1, label %for.body6, label %for.end11
62 for.body6:                                        ; preds = %for.cond4
63   br label %S2
65 S2:                                               ; preds = %for.body6
66   %mul = mul nsw i32 %i.0, %j.1
67   %arrayidx7 = getelementptr inbounds i32, i32* %sum, i32 %j.1
68   %tmp3 = load i32, i32* %arrayidx7, align 4
69   %add8 = add nsw i32 %tmp3, %mul
70   store i32 %add8, i32* %arrayidx7, align 4
71   br label %for.inc9
73 for.inc9:                                         ; preds = %S2
74   %inc10 = add nsw i32 %j.1, 1
75   br label %for.cond4
77 for.end11:                                        ; preds = %for.cond4
78   br label %for.inc12
80 for.inc12:                                        ; preds = %for.end11
81   %inc13 = add nsw i32 %i.0, 1
82   br label %for.cond
84 for.end14:                                        ; preds = %for.cond
85   ret void