1 ; RUN: opt %loadPolly -polly-dependences -analyze < %s | FileCheck %s
3 ; FIXME: Change the comment once we allow different pointers
4 ; The statement is "almost" reduction like but should not yield any reduction dependences
6 ; We are limited to binary reductions at the moment and this is not one.
7 ; There are never at least two iterations which read __and__ write to the same
8 ; location, thus we won't find the RAW and WAW dependences of a reduction,
9 ; thus we should not find Reduction dependences.
11 ; CHECK: Reduction dependences:
15 ; for (int i = 0; i < 100; i++)
16 ; sum[i] = sum[99-i] + i;
18 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
20 define void @f(i32* %sum) {
24 for.cond: ; preds = %for.inc, %entry
25 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
26 %exitcond = icmp ne i32 %i.0, 100
27 br i1 %exitcond, label %for.body, label %for.end
29 for.body: ; preds = %for.cond
30 %sub = sub nsw i32 99, %i.0
31 %arrayidx = getelementptr inbounds i32, i32* %sum, i32 %sub
32 %tmp = load i32, i32* %arrayidx, align 4
33 %add = add nsw i32 %tmp, %i.0
34 %arrayidx1 = getelementptr inbounds i32, i32* %sum, i32 %i.0
35 store i32 %add, i32* %arrayidx1, align 4
38 for.inc: ; preds = %for.body
39 %inc = add nsw i32 %i.0, 1
42 for.end: ; preds = %for.cond