1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
5 ; for (int i = 0; i < 1024; i++)
9 ; Verify that we detect the reduction on A
11 ; CHECK: ReadAccess := [Reduction Type: +] [Scalar: 0]
12 ; CHECK: MustWriteAccess := [Reduction Type: +] [Scalar: 0]
14 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
16 define void @f(ptr %A) {
20 for.cond: ; preds = %for.inc, %entry
21 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
22 %exitcond = icmp ne i32 %i.0, 1024
23 br i1 %exitcond, label %for.body, label %for.end
25 for.body: ; preds = %for.cond
26 %rem = srem i32 %i.0, 2
27 %arrayidx = getelementptr inbounds i32, ptr %A, i32 %rem
28 %tmp = load i32, ptr %arrayidx, align 4
29 %add = add nsw i32 %tmp, %i.0
30 store i32 %add, ptr %arrayidx, align 4
33 for.inc: ; preds = %for.body
34 %inc = add nsw i32 %i.0, 1
37 for.end: ; preds = %for.cond