Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Dependences / reduction_mixed_reduction_and_non_reduction_dependences.ll
blob6be0392e8b8a14106a50b93ae582cf6d5c74f890
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-dependences -analyze < %s | FileCheck %s
3 ; CHECK: RAW dependences:
4 ; CHECK-DAG: Stmt_for_body3[i0, i1] -> Stmt_for_body3[i0 + i1, o1] : i1 <= 1023 - i0 and i1 >= 0 and i1 <= 1 and i0 >= 0 and o1 <= 511 and o1 >= 1 
5 ; CHECK: WAR dependences:
6 ; CHECK:   {  }
7 ; CHECK: WAW dependences:
8 ; CHECK-DAG: Stmt_for_body3[i0, i1] -> Stmt_for_body3[1 + i0, -1 + i1] : i0 <= 1022 and i0 >= 0 and i1 <= 511 and i1 >= 2
9 ; CHECK-DAG: Stmt_for_body3[i0, 2] -> Stmt_for_body3[2 + i0, 0] : i0 <= 1021 and i0 >= 0
10 ; CHECK: Reduction dependences:
11 ; CHECK:   { Stmt_for_body3[i0, 1] -> Stmt_for_body3[1 + i0, 0] : i0 <= 1022 and i0 >= 0 }
13 ; void f(int *sum) {
14 ;   for (int i = 0; i < 1024; i++)
15 ;     for (int j = 0; j < 512; j++)
16 ;       sum[i + j] = sum[i] + 3;
17 ; }
18 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
20 define void @f(i32* %sum) {
21 entry:
22   br label %for.cond
24 for.cond:                                         ; preds = %for.inc6, %entry
25   %i.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ]
26   %exitcond1 = icmp ne i32 %i.0, 1024
27   br i1 %exitcond1, label %for.body, label %for.end8
29 for.body:                                         ; preds = %for.cond
30   br label %for.cond1
32 for.cond1:                                        ; preds = %for.inc, %for.body
33   %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
34   %exitcond = icmp ne i32 %j.0, 512
35   br i1 %exitcond, label %for.body3, label %for.end
37 for.body3:                                        ; preds = %for.cond1
38   %arrayidx = getelementptr inbounds i32, i32* %sum, i32 %i.0
39   %tmp = load i32* %arrayidx, align 4
40   %add = add nsw i32 %tmp, 3
41   %add4 = add nsw i32 %i.0, %j.0
42   %arrayidx5 = getelementptr inbounds i32, i32* %sum, i32 %add4
43   store i32 %add, i32* %arrayidx5, align 4
44   br label %for.inc
46 for.inc:                                          ; preds = %for.body3
47   %inc = add nsw i32 %j.0, 1
48   br label %for.cond1
50 for.end:                                          ; preds = %for.cond1
51   br label %for.inc6
53 for.inc6:                                         ; preds = %for.end
54   %inc7 = add nsw i32 %i.0, 1
55   br label %for.cond
57 for.end8:                                         ; preds = %for.cond
58   ret void