brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 13675ad Raw
40 lines · plain
1; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa '-passes=polly-custom<deps>' -polly-print-deps -polly-allow-nonaffine -disable-output < %s | FileCheck %s2;3; CHECK: Reduction dependences:4; CHECK:   [N] -> { Stmt_for_body[i0] -> Stmt_for_body[1 + i0] : 0 <= i0 <= -2 + N }5;6;    void f(double *restrict A, int *restrict INDICES, int N) {7;      for (int i = 0; i < N; i++)8;        A[INDICES[i]] += N;9;    }10;11target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"12 13define void @f(ptr noalias %A, ptr noalias %INDICES, i32 %N) {14entry:15  br label %for.cond16 17for.cond:                                         ; preds = %for.inc, %entry18  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]19  %cmp = icmp slt i32 %i.0, %N20  br i1 %cmp, label %for.body, label %for.end21 22for.body:                                         ; preds = %for.cond23  %conv = sitofp i32 %N to double24  %arrayidx = getelementptr inbounds ptr, ptr %INDICES, i32 %i.025  %tmp = load i32, ptr %arrayidx, align 426  %arrayidx1 = getelementptr inbounds ptr, ptr %A, i32 %tmp27  %tmp1 = load double, ptr %arrayidx1, align 828  %add = fadd fast double %tmp1, %conv29  store double %add, double* %arrayidx1, align 830  br label %for.inc31 32for.inc:                                          ; preds = %for.body33  %inc = add nsw i32 %i.0, 134  br label %for.cond35 36for.end:                                          ; preds = %for.cond37  ret void38}39 40