1 ; RUN: opt %loadPolly -polly-import-jscop \
2 ; RUN: -polly-import-jscop-postfix=transformed -polly-simplify -analyze < %s \
5 ; void gemm(float A[][1024], float B[][1024], float C[][1024]) {
6 ; for (long i = 0; i < 1024; i++)
7 ; for (long j = 0; j < 1024; j++) {
9 ; for (long k = 0; k < 1024; k++)
10 ; tmp += A[i][k] * B[k][j];
15 ; CHECK: After accesses {
16 ; CHECK-NEXT: Stmt_bb13
17 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
18 ; CHECK-NEXT: { Stmt_bb13[i0, i1, i2] -> MemRef_tmp_0__phi[] };
19 ; CHECK-NEXT: new: { Stmt_bb13[i0, i1, i2] -> MemRef_C[i0, i1] };
20 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
21 ; CHECK-NEXT: { Stmt_bb13[i0, i1, i2] -> MemRef_A[i0, i2] };
22 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
23 ; CHECK-NEXT: { Stmt_bb13[i0, i1, i2] -> MemRef_B[i2, i1] };
24 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
25 ; CHECK-NEXT: { Stmt_bb13[i0, i1, i2] -> MemRef_tmp_0[] };
26 ; CHECK-NEXT: new: { Stmt_bb13[i0, i1, i2] -> MemRef_C[i0, i1] };
29 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
30 target triple = "x86_64-pc-linux-gnu"
32 define void @gemm([1024 x float]* %A, [1024 x float]* %B, [1024 x float]* %C) {
36 bb3: ; preds = %bb26, %bb
37 %i.0 = phi i64 [ 0, %bb ], [ %tmp27, %bb26 ]
38 %exitcond2 = icmp ne i64 %i.0, 1024
39 br i1 %exitcond2, label %bb5, label %bb4
47 bb6: ; preds = %bb23, %bb5
48 %j.0 = phi i64 [ 0, %bb5 ], [ %tmp24, %bb23 ]
49 %exitcond1 = icmp ne i64 %j.0, 1024
50 br i1 %exitcond1, label %bb8, label %bb7
56 %tmp = getelementptr inbounds [1024 x float], [1024 x float]* %C, i64 %i.0, i64 %j.0
57 %tmp9 = load float, float* %tmp, align 4, !tbaa !1
60 bb10: ; preds = %bb13, %bb8
61 %tmp.0 = phi float [ %tmp9, %bb8 ], [ %tmp19, %bb13 ]
62 %k.0 = phi i64 [ 0, %bb8 ], [ %tmp20, %bb13 ]
63 %exitcond = icmp ne i64 %k.0, 1024
64 br i1 %exitcond, label %bb12, label %bb11
67 %tmp.0.lcssa = phi float [ %tmp.0, %bb10 ]
74 %tmp14 = getelementptr inbounds [1024 x float], [1024 x float]* %A, i64 %i.0, i64 %k.0
75 %tmp15 = load float, float* %tmp14, align 4, !tbaa !1
76 %tmp16 = getelementptr inbounds [1024 x float], [1024 x float]* %B, i64 %k.0, i64 %j.0
77 %tmp17 = load float, float* %tmp16, align 4, !tbaa !1
78 %tmp18 = fmul float %tmp15, %tmp17
79 %tmp19 = fadd float %tmp.0, %tmp18
80 %tmp20 = add nuw nsw i64 %k.0, 1
84 %tmp22 = getelementptr inbounds [1024 x float], [1024 x float]* %C, i64 %i.0, i64 %j.0
85 store float %tmp.0.lcssa, float* %tmp22, align 4, !tbaa !1
89 %tmp24 = add nuw nsw i64 %j.0, 1
96 %tmp27 = add nuw nsw i64 %i.0, 1
103 declare void @llvm.lifetime.start(i64, i8* nocapture)
105 declare void @llvm.lifetime.end(i64, i8* nocapture)
110 !0 = !{!"Ubuntu clang version 3.7.1-3ubuntu4 (tags/RELEASE_371/final) (based on LLVM 3.7.1)"}
111 !1 = !{!2, !2, i64 0}
112 !2 = !{!"float", !3, i64 0}
113 !3 = !{!"omnipotent char", !4, i64 0}
114 !4 = !{!"Simple C/C++ TBAA"}