236
|
1 ; RUN: opt %loadPolly -polly-print-dependences -disable-output < %s | FileCheck %s
|
150
|
2 ;
|
|
3 ; FIXME: Change the comment once we allow different pointers
|
|
4 ; The statement is "almost" reduction like but should not yield any reduction dependences
|
|
5 ;
|
|
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.
|
|
10 ;
|
|
11 ; CHECK: Reduction dependences:
|
|
12 ; CHECK: { }
|
|
13 ;
|
|
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"
|
|
19
|
252
|
20 define void @f(ptr %sum) {
|
150
|
21 entry:
|
|
22 br label %for.cond
|
|
23
|
|
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
|
|
28
|
|
29 for.body: ; preds = %for.cond
|
|
30 %sub = sub nsw i32 99, %i.0
|
252
|
31 %arrayidx = getelementptr inbounds i32, ptr %sum, i32 %sub
|
|
32 %tmp = load i32, ptr %arrayidx, align 4
|
150
|
33 %add = add nsw i32 %tmp, %i.0
|
252
|
34 %arrayidx1 = getelementptr inbounds i32, ptr %sum, i32 %i.0
|
|
35 store i32 %add, ptr %arrayidx1, align 4
|
150
|
36 br label %for.inc
|
|
37
|
|
38 for.inc: ; preds = %for.body
|
|
39 %inc = add nsw i32 %i.0, 1
|
|
40 br label %for.cond
|
|
41
|
|
42 for.end: ; preds = %for.cond
|
|
43 ret void
|
|
44 }
|