2015-10-06 23:36:44 +08:00
|
|
|
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
|
2014-02-21 05:29:09 +08:00
|
|
|
|
|
|
|
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
|
|
|
|
|
|
|
|
define void @f(i64* %a, i64 %N) {
|
|
|
|
entry:
|
|
|
|
br label %for
|
|
|
|
|
|
|
|
for:
|
|
|
|
%indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.backedge ]
|
|
|
|
br label %S1
|
|
|
|
|
|
|
|
S1:
|
2015-02-28 03:20:19 +08:00
|
|
|
%scevgep1 = getelementptr i64, i64* %a, i64 %indvar
|
2015-02-28 05:22:50 +08:00
|
|
|
%val = load i64, i64* %scevgep1, align 8
|
2014-02-21 05:29:09 +08:00
|
|
|
br label %S2
|
|
|
|
|
|
|
|
S2:
|
2015-02-28 03:20:19 +08:00
|
|
|
%scevgep2 = getelementptr i64, i64* %a, i64 %indvar
|
2014-02-21 05:29:09 +08:00
|
|
|
store i64 %val, i64* %scevgep2, align 8
|
|
|
|
br label %for.backedge
|
|
|
|
|
|
|
|
for.backedge:
|
|
|
|
%indvar.next = add nsw i64 %indvar, 1
|
|
|
|
%exitcond = icmp eq i64 %indvar.next, %N
|
|
|
|
br i1 %exitcond, label %return, label %for
|
|
|
|
|
|
|
|
return:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-08-21 02:04:22 +08:00
|
|
|
; CHECK: Arrays {
|
2015-11-10 22:02:54 +08:00
|
|
|
; CHECK: i64 MemRef_a[*];
|
|
|
|
; CHECK: i64 MemRef_val; [BasePtrOrigin: MemRef_a]
|
2015-08-21 02:04:22 +08:00
|
|
|
; CHECK: }
|
|
|
|
;
|
|
|
|
; CHECK: Arrays (Bounds as pw_affs) {
|
2015-11-10 22:02:54 +08:00
|
|
|
; CHECK: i64 MemRef_a[*];
|
|
|
|
; CHECK: i64 MemRef_val; [BasePtrOrigin: MemRef_a]
|
2015-08-21 02:04:22 +08:00
|
|
|
; CHECK: }
|
|
|
|
|
2014-02-21 05:29:09 +08:00
|
|
|
; CHECK: Stmt_S1
|
|
|
|
; CHECK: Domain :=
|
|
|
|
; CHECK: [N] -> { Stmt_S1[i0] : i0 >= 0 and i0 <= -1 + N };
|
2015-04-21 19:37:25 +08:00
|
|
|
; CHECK: Schedule :=
|
2015-02-02 21:45:54 +08:00
|
|
|
; CHECK: [N] -> { Stmt_S1[i0] -> [i0, 0] };
|
2014-02-21 05:29:09 +08:00
|
|
|
; CHECK: ReadAccess :=
|
|
|
|
; CHECK: [N] -> { Stmt_S1[i0] -> MemRef_a[i0] };
|
|
|
|
; CHECK: MustWriteAccess :=
|
2014-04-10 16:38:02 +08:00
|
|
|
; CHECK: [N] -> { Stmt_S1[i0] -> MemRef_val[] };
|
2014-02-21 05:29:09 +08:00
|
|
|
; CHECK: Stmt_S2
|
|
|
|
; CHECK: Domain :=
|
|
|
|
; CHECK: [N] -> { Stmt_S2[i0] : i0 >= 0 and i0 <= -1 + N };
|
2015-04-21 19:37:25 +08:00
|
|
|
; CHECK: Schedule :=
|
2015-02-02 21:45:54 +08:00
|
|
|
; CHECK: [N] -> { Stmt_S2[i0] -> [i0, 1] };
|
2014-02-21 05:29:09 +08:00
|
|
|
; CHECK: ReadAccess :=
|
2014-04-10 16:38:02 +08:00
|
|
|
; CHECK: [N] -> { Stmt_S2[i0] -> MemRef_val[] };
|
2014-02-21 05:29:09 +08:00
|
|
|
; CHECK: MustWriteAccess :=
|
|
|
|
; CHECK: [N] -> { Stmt_S2[i0] -> MemRef_a[i0] };
|