2015-10-06 23:36:44 +08:00
|
|
|
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
|
2015-02-07 04:13:15 +08:00
|
|
|
;
|
|
|
|
; float f(float *A, int N) {
|
|
|
|
; float tmp = 0;
|
|
|
|
; for (int i = 0; i < N; i++)
|
|
|
|
; tmp += A[i];
|
|
|
|
; }
|
|
|
|
;
|
|
|
|
; CHECK: Statements {
|
2015-05-27 02:05:45 +08:00
|
|
|
; CHECK-LABEL: Stmt_bb1
|
|
|
|
; CHECK-NOT: Access
|
2015-02-07 04:13:15 +08:00
|
|
|
; CHECK: ReadAccess := [Reduction Type: NONE]
|
2015-07-28 22:53:44 +08:00
|
|
|
; CHECK: [N] -> { Stmt_bb1[i0] -> MemRef_tmp_0__phi[] };
|
2015-05-27 02:05:45 +08:00
|
|
|
; CHECK-NOT: Access
|
2015-02-07 04:13:15 +08:00
|
|
|
; CHECK: MustWriteAccess := [Reduction Type: NONE]
|
|
|
|
; CHECK: [N] -> { Stmt_bb1[i0] -> MemRef_tmp_0[] };
|
2015-05-27 02:05:45 +08:00
|
|
|
; CHECK-NOT: Access
|
|
|
|
; CHECK-LABEL: Stmt_bb4
|
|
|
|
; CHECK-NOT: Access
|
2015-02-07 04:13:15 +08:00
|
|
|
; CHECK: MustWriteAccess := [Reduction Type: NONE]
|
2015-07-28 22:53:44 +08:00
|
|
|
; CHECK: [N] -> { Stmt_bb4[i0] -> MemRef_tmp_0__phi[] };
|
2015-05-27 02:05:45 +08:00
|
|
|
; CHECK-NOT: Access
|
2015-02-07 04:13:15 +08:00
|
|
|
; CHECK: ReadAccess := [Reduction Type: NONE]
|
|
|
|
; CHECK: [N] -> { Stmt_bb4[i0] -> MemRef_tmp_0[] };
|
2015-05-27 02:05:45 +08:00
|
|
|
; CHECK-NOT: Access
|
2015-02-07 04:13:15 +08:00
|
|
|
; CHECK: ReadAccess := [Reduction Type: NONE]
|
|
|
|
; CHECK: [N] -> { Stmt_bb4[i0] -> MemRef_A[i0] };
|
2015-05-27 02:05:45 +08:00
|
|
|
; CHECK-NOT: Access
|
2015-02-07 04:13:15 +08:00
|
|
|
; CHECK: }
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
|
|
|
|
define void @f(float* %A, i32 %N) {
|
|
|
|
bb:
|
|
|
|
%tmp = sext i32 %N to i64
|
|
|
|
br label %bb1
|
|
|
|
|
|
|
|
bb1: ; preds = %bb4, %bb
|
|
|
|
%indvars.iv = phi i64 [ %indvars.iv.next, %bb4 ], [ 0, %bb ]
|
|
|
|
%tmp.0 = phi float [ 0.000000e+00, %bb ], [ %tmp7, %bb4 ]
|
|
|
|
%tmp2 = icmp slt i64 %indvars.iv, %tmp
|
|
|
|
br i1 %tmp2, label %bb3, label %bb8
|
|
|
|
|
|
|
|
bb3: ; preds = %bb1
|
|
|
|
br label %bb4
|
|
|
|
|
|
|
|
bb4: ; preds = %bb3
|
2015-02-28 03:20:19 +08:00
|
|
|
%tmp5 = getelementptr inbounds float, float* %A, i64 %indvars.iv
|
2015-02-28 05:22:50 +08:00
|
|
|
%tmp6 = load float, float* %tmp5, align 4
|
2015-02-07 04:13:15 +08:00
|
|
|
%tmp7 = fadd float %tmp.0, %tmp6
|
|
|
|
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
|
|
|
|
br label %bb1
|
|
|
|
|
|
|
|
bb8: ; preds = %bb1
|
|
|
|
br label %exit
|
|
|
|
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|