1; RUN: opt %loadPolly -basic-aa -polly-scops -analyze < %s | FileCheck %s
2;
3; int f() {
4;   int i, sum = 0, sth = 0;
5;   for (i = 0; i < 1024; i++) {
6;     sum += 5;
7;     sth = sth + sth * sth + sth;
8;     sum *= 5;
9;   }
10;   return sum + sth;
11; }
12;
13; CHECK-NOT: Reduction Type: +
14; CHECK-NOT: Reduction Type: *
15target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
16
17define i32 @f() {
18entry:
19  %sum.0 = alloca i32
20  %sth.0 = alloca i32
21  br label %entry.split
22
23entry.split:                                      ; preds = %entry
24  store i32 0, i32* %sum.0
25  store i32 0, i32* %sth.0
26  br label %for.cond
27
28for.cond:                                         ; preds = %for.cond, %entry.split
29  %i.0 = phi i32 [ 0, %entry.split ], [ %inc, %for.cond ]
30  %sth.0.reload = load i32, i32* %sth.0
31  %sum.0.reload = load i32, i32* %sum.0
32  %exitcond = icmp ne i32 %i.0, 1024
33  %mul = mul nsw i32 %sth.0.reload, %sth.0.reload
34  %add1 = add nsw i32 %sth.0.reload, %mul
35  %tmp = mul i32 %sum.0.reload, 5
36  store i32 %tmp, i32* %sum.0
37  %sum.1.reload = load i32, i32* %sum.0
38  %mul3 = add i32 %sum.1.reload, 25
39  %add2 = add nsw i32 %add1, %sth.0.reload
40  %inc = add nsw i32 %i.0, 1
41  store i32 %mul3, i32* %sum.0
42  store i32 %add2, i32* %sth.0
43  br i1 %exitcond, label %for.cond, label %for.end
44
45for.end:                                          ; preds = %for.cond
46  %sum.0.reload.2 = load i32, i32* %sum.0
47  %sth.0.reload.2 = load i32, i32* %sth.0
48  %add4 = add nsw i32 %sum.0.reload.2, %sth.0.reload.2
49  ret i32 %add4
50}
51