[ForwardOpTree] Allow out-of-quota in examination part of forwardTree.
[polly-mirror.git] / test / DependenceInfo / reduction_two_reductions_different_rloops.ll
blob1404d157dcb333338353ba9dba51d8fdefd5d5d6
1 ; RUN: opt %loadPolly -basicaa -polly-dependences -analyze < %s | FileCheck %s
3 ; CHECK:      RAW dependences:
4 ; CHECK-NEXT:     {  }
5 ; CHECK-NEXT: WAR dependences:
6 ; CHECK-NEXT:     {  }
7 ; CHECK-NEXT: WAW dependences:
8 ; CHECK-NEXT:     {  }
9 ; CHECK-NEXT: Reduction dependences:
10 ; CHECK-NEXT:     { Stmt_for_body3[i0, i1] -> Stmt_for_body3[o0, 1 + i0 + i1 - o0] : i0 >= 0 and i1 >= 0 and o0 >= -1022 + i0 + i1 and i0 <= o0 <= 1023 and o0 <= 1 + i0 }
12 ; void f(int *restrict A, int *restrict B, int *restrict Values) {
13 ;   for (int i = 0; i < 1024; i++) {
14 ;     for (int j = 0; j < 1024; j++) {
15 ;       A[i] += Values[i + j - 1];
16 ;       B[j] += Values[i + j + 42];
17 ;     }
18 ;   }
19 ; }
21 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
23 define void @f(i32* noalias %A, i32* noalias %B, i32* noalias %Values)  {
24 entry:
25   br label %for.cond
27 for.cond:                                         ; preds = %for.inc11, %entry
28   %i.0 = phi i32 [ 0, %entry ], [ %inc12, %for.inc11 ]
29   %exitcond1 = icmp ne i32 %i.0, 1024
30   br i1 %exitcond1, label %for.body, label %for.end13
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, 1024
38   br i1 %exitcond, label %for.body3, label %for.end
40 for.body3:                                        ; preds = %for.cond1
41   %add = add nsw i32 %i.0, %j.0
42   %sub = add nsw i32 %add, -1
43   %arrayidx = getelementptr inbounds i32, i32* %Values, i32 %sub
44   %tmp = load i32, i32* %arrayidx, align 4
45   %arrayidx4 = getelementptr inbounds i32, i32* %A, i32 %i.0
46   %tmp2 = load i32, i32* %arrayidx4, align 4
47   %add5 = add nsw i32 %tmp2, %tmp
48   store i32 %add5, i32* %arrayidx4, align 4
49   %add6 = add nsw i32 %i.0, %j.0
50   %add7 = add nsw i32 %add6, 42
51   %arrayidx8 = getelementptr inbounds i32, i32* %Values, i32 %add7
52   %tmp3 = load i32, i32* %arrayidx8, align 4
53   %arrayidx9 = getelementptr inbounds i32, i32* %B, i32 %j.0
54   %tmp4 = load i32, i32* %arrayidx9, align 4
55   %add10 = add nsw i32 %tmp4, %tmp3
56   store i32 %add10, i32* %arrayidx9, align 4
57   br label %for.inc
59 for.inc:                                          ; preds = %for.body3
60   %inc = add nsw i32 %j.0, 1
61   br label %for.cond1
63 for.end:                                          ; preds = %for.cond1
64   br label %for.inc11
66 for.inc11:                                        ; preds = %for.end
67   %inc12 = add nsw i32 %i.0, 1
68   br label %for.cond
70 for.end13:                                        ; preds = %for.cond
71   ret void