2015-10-16 02:26:06 +08:00
|
|
|
; RUN: opt %loadPolly -polly-scops -analyze \
|
|
|
|
; RUN: -S < %s | FileCheck %s
|
|
|
|
|
2016-01-15 08:48:42 +08:00
|
|
|
; CHECK: Statements {
|
|
|
|
; CHECK-NEXT: Stmt_loop__TO__backedge
|
2015-10-16 02:26:06 +08:00
|
|
|
; CHECK-NEXT: Domain :=
|
2016-01-15 23:54:45 +08:00
|
|
|
; CHECK-NEXT: { Stmt_loop__TO__backedge[i0] : 0 <= i0 <= 100 };
|
2015-10-16 02:26:06 +08:00
|
|
|
; CHECK-NEXT: Schedule :=
|
|
|
|
; CHECK-NEXT: { Stmt_loop__TO__backedge[i0] -> [i0, 0] };
|
2016-01-15 08:48:42 +08:00
|
|
|
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
|
2015-10-16 02:26:06 +08:00
|
|
|
; CHECK-NEXT: { Stmt_loop__TO__backedge[i0] -> MemRef_merge__phi[] };
|
2016-01-15 08:48:42 +08:00
|
|
|
; CHECK-NEXT: Stmt_backedge
|
2015-10-16 02:26:06 +08:00
|
|
|
; CHECK-NEXT: Domain :=
|
2016-01-15 23:54:45 +08:00
|
|
|
; CHECK-NEXT: { Stmt_backedge[i0] : 0 <= i0 <= 100 };
|
2015-10-16 02:26:06 +08:00
|
|
|
; CHECK-NEXT: Schedule :=
|
|
|
|
; CHECK-NEXT: { Stmt_backedge[i0] -> [i0, 1] };
|
2016-01-15 08:48:42 +08:00
|
|
|
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
|
2015-10-16 02:26:06 +08:00
|
|
|
; CHECK-NEXT: { Stmt_backedge[i0] -> MemRef_merge__phi[] };
|
2016-01-15 08:48:42 +08:00
|
|
|
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
|
2015-10-16 02:26:06 +08:00
|
|
|
; CHECK-NEXT: { Stmt_backedge[i0] -> MemRef_A[0] };
|
2016-01-15 08:48:42 +08:00
|
|
|
; CHECK-NEXT: }
|
2015-10-16 02:26:06 +08:00
|
|
|
|
|
|
|
define void @foo(float* %A, i1 %cond0, i1 %cond1) {
|
|
|
|
entry:
|
|
|
|
br label %loop
|
|
|
|
|
|
|
|
loop:
|
|
|
|
%indvar = phi i64 [0, %entry], [%indvar.next, %backedge]
|
|
|
|
%val0 = fadd float 1.0, 2.0
|
|
|
|
%val1 = fadd float 1.0, 2.0
|
|
|
|
br i1 %cond0, label %branch1, label %backedge
|
|
|
|
|
|
|
|
branch1:
|
|
|
|
%val2 = fadd float 1.0, 2.0
|
|
|
|
br i1 %cond1, label %branch2, label %backedge
|
|
|
|
|
|
|
|
branch2:
|
|
|
|
br label %backedge
|
|
|
|
|
|
|
|
backedge:
|
|
|
|
%merge = phi float [%val0, %loop], [%val1, %branch1], [%val2, %branch2]
|
|
|
|
%indvar.next = add i64 %indvar, 1
|
|
|
|
store float %merge, float* %A
|
|
|
|
%cmp = icmp sle i64 %indvar.next, 100
|
|
|
|
br i1 %cmp, label %loop, label %exit
|
|
|
|
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|