brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 474c6ac Raw
40 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3;4;    void f(int *A) {5;      for (int i = 0; i < 1024; i++)6;        A[i % 2] += i;7;    }8;9; Verify that we detect the reduction on A10;11; CHECK: ReadAccess := [Reduction Type: +] [Scalar: 0]12; CHECK: MustWriteAccess :=  [Reduction Type: +] [Scalar: 0]13;14target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"15 16define void @f(ptr %A) {17entry:18  br label %for.cond19 20for.cond:                                         ; preds = %for.inc, %entry21  %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]22  %exitcond = icmp ne i32 %i.0, 102423  br i1 %exitcond, label %for.body, label %for.end24 25for.body:                                         ; preds = %for.cond26  %rem = srem i32 %i.0, 227  %arrayidx = getelementptr inbounds i32, ptr %A, i32 %rem28  %tmp = load i32, ptr %arrayidx, align 429  %add = add nsw i32 %tmp, %i.030  store i32 %add, ptr %arrayidx, align 431  br label %for.inc32 33for.inc:                                          ; preds = %for.body34  %inc = add nsw i32 %i.0, 135  br label %for.cond36 37for.end:                                          ; preds = %for.cond38  ret void39}40