Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / Dependences / reduction_complex_location.ll
blob4a0a5b55cdf2ebda40ca118b102591dc1169c562
1 ; RUN: opt -basicaa %loadPolly -polly-detect-unprofitable -polly-dependences -analyze < %s | FileCheck %s
3 ; CHECK: RAW dependences:
4 ; CHECK:   {  }
5 ; CHECK: WAR dependences:
6 ; CHECK:   {  }
7 ; CHECK: WAW dependences:
8 ; CHECK:   {  }
9 ; CHECK: Reduction dependences:
10 ; CHECK:   { Stmt_for_body3[i0, i1] -> Stmt_for_body3[2 + i0, -1 + i1] : i0 <= 97 and i0 >= 0 and i1 <= 99 and i1 >= 1 }
12 ; void f(int *sum) {
13 ;   for (int i = 0; i < 100; i++)
14 ;     for (int j = 0; j < 100; j++)
15 ;       sum[i+j*2] += j * i;
16 ; }
17 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
19 define void @f(i32* %sum) {
20 entry:
21   br label %for.cond
23 for.cond:                                         ; preds = %for.inc6, %entry
24   %i.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ]
25   %exitcond1 = icmp ne i32 %i.0, 100
26   br i1 %exitcond1, label %for.body, label %for.end8
28 for.body:                                         ; preds = %for.cond
29   br label %for.cond1
31 for.cond1:                                        ; preds = %for.inc, %for.body
32   %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
33   %exitcond = icmp ne i32 %j.0, 100
34   br i1 %exitcond, label %for.body3, label %for.end
36 for.body3:                                        ; preds = %for.cond1
37   %mul = mul nsw i32 %j.0, %i.0
38   %mul4 = shl nsw i32 %j.0, 1
39   %add = add nsw i32 %i.0, %mul4
40   %arrayidx = getelementptr inbounds i32, i32* %sum, i32 %add
41   %tmp = load i32* %arrayidx, align 4
42   %add5 = add nsw i32 %tmp, %mul
43   store i32 %add5, i32* %arrayidx, 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