1 ; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
3 ; CHECK: Reduction Type: +
4 ; CHECK: Reduction Type: +
5 ; CHECK: Reduction Type: *
6 ; CHECK: Reduction Type: *
9 ; for (int i = 0; i < 1024; i++) {
10 ; for (int j = 0; j < 1024; j++) {
16 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
18 define void @f(i32* %sums) {
22 for.cond: ; preds = %for.inc6, %entry
23 %i.0 = phi i32 [ 0, %entry ], [ %inc7, %for.inc6 ]
24 %exitcond1 = icmp ne i32 %i.0, 1024
25 br i1 %exitcond1, label %for.body, label %for.end8
27 for.body: ; preds = %for.cond
30 for.cond1: ; preds = %for.inc, %for.body
31 %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
32 %exitcond = icmp ne i32 %j.0, 1024
33 br i1 %exitcond, label %for.body3, label %for.end
35 for.body3: ; preds = %for.cond1
36 %arrayidx = getelementptr inbounds i32, i32* %sums, i32 %i.0
37 %tmp = load i32, i32* %arrayidx, align 4
38 %add = add nsw i32 %tmp, 5
39 store i32 %add, i32* %arrayidx, align 4
40 %add4 = add nsw i32 %i.0, 1024
41 %arrayidx5 = getelementptr inbounds i32, i32* %sums, i32 %add4
42 %tmp2 = load i32, i32* %arrayidx5, align 4
43 %mul = mul nsw i32 %tmp2, 5
44 store i32 %mul, i32* %arrayidx5, align 4
47 for.inc: ; preds = %for.body3
48 %inc = add nsw i32 %j.0, 1
51 for.end: ; preds = %for.cond1
54 for.inc6: ; preds = %for.end
55 %inc7 = add nsw i32 %i.0, 1
58 for.end8: ; preds = %for.cond