1 ; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa '-passes=print<polly-dependences>' -polly-allow-nonaffine -disable-output < %s | FileCheck %s
3 ; CHECK: Reduction dependences:
4 ; CHECK: [N] -> { Stmt_for_body[i0] -> Stmt_for_body[1 + i0] : 0 <= i0 <= -2 + N }
6 ; void f(double *restrict A, int *restrict INDICES, int N) {
7 ; for (int i = 0; i < N; i++)
11 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
13 define void @f(ptr noalias %A, ptr noalias %INDICES, i32 %N) {
17 for.cond: ; preds = %for.inc, %entry
18 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
19 %cmp = icmp slt i32 %i.0, %N
20 br i1 %cmp, label %for.body, label %for.end
22 for.body: ; preds = %for.cond
23 %conv = sitofp i32 %N to double
24 %arrayidx = getelementptr inbounds ptr, ptr %INDICES, i32 %i.0
25 %tmp = load i32, ptr %arrayidx, align 4
26 %arrayidx1 = getelementptr inbounds ptr, ptr %A, i32 %tmp
27 %tmp1 = load double, ptr %arrayidx1, align 8
28 %add = fadd fast double %tmp1, %conv
29 store double %add, double* %arrayidx1, align 8
32 for.inc: ; preds = %for.body
33 %inc = add nsw i32 %i.0, 1
36 for.end: ; preds = %for.cond