1; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-analyze-read-only-scalars=false -polly-scops \
2; RUN:                -analyze < %s | FileCheck %s
3; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-analyze-read-only-scalars=true -polly-scops \
4; RUN:                -analyze < %s | FileCheck %s \
5; RUN:                -check-prefix=SCALARS
6
7; CHECK-NOT: Memref_scalar
8
9; SCALARS: float MemRef_scalar; // Element size 4
10
11; SCALARS: ReadAccess :=  [Reduction Type: NONE] [Scalar: 1]
12; SCALARS:     { Stmt_stmt1[i0] -> MemRef_scalar[] };
13; SCALARS: ReadAccess :=       [Reduction Type: NONE] [Scalar: 1]
14; SCALARS:     { Stmt_stmt1[i0] -> MemRef_scalar2[] };
15
16
17define void @foo(float* noalias %A, float* %B, float %scalar, float %scalar2) {
18entry:
19  br label %loop
20
21loop:
22  %indvar = phi i64 [0, %entry], [%indvar.next, %loop.backedge]
23  br label %stmt1
24
25stmt1:
26  %val = load float, float* %A
27  %sum = fadd float %val, %scalar
28  store float %sum, float* %A
29  store float %scalar2, float* %B
30  br label %loop.backedge
31
32loop.backedge:
33  %indvar.next = add i64 %indvar, 1
34  %cond = icmp sle i64 %indvar, 100
35  br i1 %cond, label %loop, label %exit
36
37exit:
38  ret void
39}
40