1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; CHECK: Reduction Type: +
6 ; for (int i = 0; i < 100; i++)
7 ; sum[i] = sum[99-i] + i;
9 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
11 define void @f(ptr %sum) {
15 for.cond: ; preds = %for.inc, %entry
16 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
17 %exitcond = icmp ne i32 %i.0, 100
18 br i1 %exitcond, label %for.body, label %for.end
20 for.body: ; preds = %for.cond
21 %sub = sub nsw i32 99, %i.0
22 %arrayidx = getelementptr inbounds i32, ptr %sum, i32 %sub
23 %tmp = load i32, ptr %arrayidx, align 4
24 %add = add nsw i32 %tmp, %i.0
25 %arrayidx1 = getelementptr inbounds i32, ptr %sum, i32 %i.0
26 store i32 %add, ptr %arrayidx1, align 4
29 for.inc: ; preds = %for.body
30 %inc = add nsw i32 %i.0, 1
33 for.end: ; preds = %for.cond