1 ; RUN: opt %loadPolly -basicaa -loop-rotate -indvars -polly-prepare -polly-scops -analyze < %s | FileCheck %s
2 ; RUN: opt %loadPolly -basicaa -loop-rotate -indvars -licm -polly-prepare -polly-scops -analyze < %s | FileCheck %s
6 ; void test(int n, double B[static const restrict n], int j) {
7 ; for (int i = 0; i < n; i += 1) {
12 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
14 define void @test(i32 %n, double* noalias nonnull %B, i32 %j) {
18 for.cond: ; preds = %for.inc, %entry
19 %i.0 = phi i32 [ 0, %entry ], [ %add1, %for.inc ]
20 %cmp = icmp slt i32 %i.0, %n
21 br i1 %cmp, label %for.body, label %for.end
23 for.body: ; preds = %for.cond
24 %conv = sitofp i32 %i.0 to double
25 %idxprom = sext i32 %j to i64
26 %arrayidx = getelementptr inbounds double, double* %B, i64 %idxprom
27 %tmp = load double, double* %arrayidx, align 8
28 %add = fadd double %tmp, %conv
29 store double %add, double* %arrayidx, align 8
32 for.inc: ; preds = %for.body
33 %add1 = add nuw nsw i32 %i.0, 1
36 for.end: ; preds = %for.cond
42 ; CHECK: Stmt_for_body
43 ; CHECK-DAG: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
44 ; CHECK-NEXT: [n, j] -> { Stmt_for_body[i0] -> MemRef_B[j] };
45 ; CHECK-DAG: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
46 ; CHECK-NEXT: [n, j] -> { Stmt_for_body[i0] -> MemRef_B[j] };