2015-08-28 00:55:18 +08:00
|
|
|
; RUN: opt %loadPolly -polly-analyze-read-only-scalars=false -polly-scops \
|
2015-10-06 23:36:44 +08:00
|
|
|
; RUN: -analyze < %s | FileCheck %s
|
2015-08-28 00:55:18 +08:00
|
|
|
; RUN: opt %loadPolly -polly-analyze-read-only-scalars=true -polly-scops \
|
2015-10-06 23:36:44 +08:00
|
|
|
; RUN: -analyze < %s | FileCheck %s \
|
2015-08-28 00:55:18 +08:00
|
|
|
; RUN: -check-prefix=SCALARS
|
2015-08-04 21:54:20 +08:00
|
|
|
|
|
|
|
; CHECK-NOT: Memref_scalar
|
|
|
|
|
2015-11-10 22:02:54 +08:00
|
|
|
; SCALARS: float MemRef_scalar; // Element size 4
|
2015-08-04 21:54:20 +08:00
|
|
|
|
|
|
|
; SCALARS: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
|
|
|
|
; SCALARS: { Stmt_stmt1[i0] -> MemRef_scalar[] };
|
2015-08-31 19:15:00 +08:00
|
|
|
; SCALARS: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
|
|
|
|
; SCALARS: { Stmt_stmt1[i0] -> MemRef_scalar2[] };
|
2015-08-04 21:54:20 +08:00
|
|
|
|
2015-08-31 19:15:00 +08:00
|
|
|
|
|
|
|
define void @foo(float* noalias %A, float* %B, float %scalar, float %scalar2) {
|
2015-08-04 21:54:20 +08:00
|
|
|
entry:
|
|
|
|
br label %loop
|
|
|
|
|
|
|
|
loop:
|
|
|
|
%indvar = phi i64 [0, %entry], [%indvar.next, %loop.backedge]
|
|
|
|
br label %stmt1
|
|
|
|
|
|
|
|
stmt1:
|
|
|
|
%val = load float, float* %A
|
|
|
|
%sum = fadd float %val, %scalar
|
|
|
|
store float %sum, float* %A
|
2015-08-31 19:15:00 +08:00
|
|
|
store float %scalar2, float* %B
|
2015-08-04 21:54:20 +08:00
|
|
|
br label %loop.backedge
|
|
|
|
|
|
|
|
loop.backedge:
|
|
|
|
%indvar.next = add i64 %indvar, 1
|
|
|
|
%cond = icmp sle i64 %indvar, 100
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|