1 ; RUN: opt %loadPolly -basic-aa -polly-print-scops -disable-output -polly-allow-nonaffine < %s | FileCheck %s
3 ; Validate that the accesses to INDICES[i] is not part of a reduction.
5 ; CHECK: Reduction Type: NONE
6 ; CHECK: MemRef_INDICES[i0]
7 ; CHECK: Reduction Type: +
9 ; CHECK: Reduction Type: +
11 ; CHECK: Reduction Type: NONE
12 ; CHECK: MemRef_INDICES[i0]
14 ; void f(double *restrict A, int *restrict INDICES, int N) {
15 ; for (int i = 0; i < N; i++) {
21 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
23 define void @f(double* noalias %A, i32* noalias %INDICES, i32 %N) {
27 for.cond: ; preds = %for.inc, %entry
28 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
29 %cmp = icmp slt i32 %i.0, %N
30 br i1 %cmp, label %for.body, label %for.end
32 for.body: ; preds = %for.cond
33 %conv = sitofp i32 %N to double
34 %arrayidx = getelementptr inbounds i32, i32* %INDICES, i32 %i.0
35 %tmp = load i32, i32* %arrayidx, align 4
36 %arrayidx1 = getelementptr inbounds double, double* %A, i32 %tmp
37 %tmp1 = load double, double* %arrayidx1, align 8
38 %add = fadd fast double %tmp1, %conv
39 store double %add, double* %arrayidx1, align 8
40 %add3 = add nsw i32 %tmp, %N
41 store i32 %add3, i32* %arrayidx, align 4
44 for.inc: ; preds = %for.body
45 %inc = add nsw i32 %i.0, 1
48 for.end: ; preds = %for.cond