[ForwardOpTree] Allow out-of-quota in examination part of forwardTree.
[polly-mirror.git] / test / DependenceInfo / reduction_only_reduction_like_access.ll
bloba4eca1ce2828d07a3a82023cedba4223424c0698
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:
12 ; CHECK:    {  }
14 ; void f(int *sum) {
15 ;   for (int i = 0; i < 100; i++)
16 ;     sum[i] = sum[99-i] + i;
17 ; }
18 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
20 define void @f(i32* %sum) {
21 entry:
22   br label %for.cond
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
36   br label %for.inc
38 for.inc:                                          ; preds = %for.body
39   %inc = add nsw i32 %i.0, 1
40   br label %for.cond
42 for.end:                                          ; preds = %for.cond
43   ret void