45 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<deps>' -polly-print-deps -disable-output < %s | FileCheck %s2;3; FIXME: Change the comment once we allow different pointers4; The statement is "almost" reduction like but should not yield any reduction dependences5;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 same8; 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; }18target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"19 20define void @f(ptr %sum) {21entry:22 br label %for.cond23 24for.cond: ; preds = %for.inc, %entry25 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]26 %exitcond = icmp ne i32 %i.0, 10027 br i1 %exitcond, label %for.body, label %for.end28 29for.body: ; preds = %for.cond30 %sub = sub nsw i32 99, %i.031 %arrayidx = getelementptr inbounds i32, ptr %sum, i32 %sub32 %tmp = load i32, ptr %arrayidx, align 433 %add = add nsw i32 %tmp, %i.034 %arrayidx1 = getelementptr inbounds i32, ptr %sum, i32 %i.035 store i32 %add, ptr %arrayidx1, align 436 br label %for.inc37 38for.inc: ; preds = %for.body39 %inc = add nsw i32 %i.0, 140 br label %for.cond41 42for.end: ; preds = %for.cond43 ret void44}45