1 ; RUN: opt %loadNPMPolly '-passes=polly-import-jscop,print<polly-simplify>' -polly-import-jscop-postfix=transformed -disable-output < %s | FileCheck %s
3 ; void gemm(float A[][1024], float B[][1024], float C[][1024]) {
4 ; for (long i = 0; i < 1024; i++)
5 ; for (long j = 0; j < 1024; j++) {
7 ; for (long k = 0; k < 1024; k++)
8 ; tmp += A[i][k] * B[k][j];
13 ; CHECK: After accesses {
14 ; CHECK-NEXT: Stmt_bb13
15 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
16 ; CHECK-NEXT: { Stmt_bb13[i0, i1, i2] -> MemRef_tmp_0__phi[] };
17 ; CHECK-NEXT: new: { Stmt_bb13[i0, i1, i2] -> MemRef_C[i0, i1] };
18 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
19 ; CHECK-NEXT: { Stmt_bb13[i0, i1, i2] -> MemRef_A[i0, i2] };
20 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
21 ; CHECK-NEXT: { Stmt_bb13[i0, i1, i2] -> MemRef_B[i2, i1] };
22 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
23 ; CHECK-NEXT: { Stmt_bb13[i0, i1, i2] -> MemRef_tmp_0[] };
24 ; CHECK-NEXT: new: { Stmt_bb13[i0, i1, i2] -> MemRef_C[i0, i1] };
27 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
28 target triple = "x86_64-pc-linux-gnu"
30 define void @gemm(ptr %A, ptr %B, ptr %C) {
34 bb3: ; preds = %bb26, %bb
35 %i.0 = phi i64 [ 0, %bb ], [ %tmp27, %bb26 ]
36 %exitcond2 = icmp ne i64 %i.0, 1024
37 br i1 %exitcond2, label %bb5, label %bb4
45 bb6: ; preds = %bb23, %bb5
46 %j.0 = phi i64 [ 0, %bb5 ], [ %tmp24, %bb23 ]
47 %exitcond1 = icmp ne i64 %j.0, 1024
48 br i1 %exitcond1, label %bb8, label %bb7
54 %tmp = getelementptr inbounds [1024 x float], ptr %C, i64 %i.0, i64 %j.0
55 %tmp9 = load float, ptr %tmp, align 4, !tbaa !1
58 bb10: ; preds = %bb13, %bb8
59 %tmp.0 = phi float [ %tmp9, %bb8 ], [ %tmp19, %bb13 ]
60 %k.0 = phi i64 [ 0, %bb8 ], [ %tmp20, %bb13 ]
61 %exitcond = icmp ne i64 %k.0, 1024
62 br i1 %exitcond, label %bb12, label %bb11
65 %tmp.0.lcssa = phi float [ %tmp.0, %bb10 ]
72 %tmp14 = getelementptr inbounds [1024 x float], ptr %A, i64 %i.0, i64 %k.0
73 %tmp15 = load float, ptr %tmp14, align 4, !tbaa !1
74 %tmp16 = getelementptr inbounds [1024 x float], ptr %B, i64 %k.0, i64 %j.0
75 %tmp17 = load float, ptr %tmp16, align 4, !tbaa !1
76 %tmp18 = fmul float %tmp15, %tmp17
77 %tmp19 = fadd float %tmp.0, %tmp18
78 %tmp20 = add nuw nsw i64 %k.0, 1
82 %tmp22 = getelementptr inbounds [1024 x float], ptr %C, i64 %i.0, i64 %j.0
83 store float %tmp.0.lcssa, ptr %tmp22, align 4, !tbaa !1
87 %tmp24 = add nuw nsw i64 %j.0, 1
94 %tmp27 = add nuw nsw i64 %i.0, 1
101 declare void @llvm.lifetime.start(i64, ptr nocapture)
103 declare void @llvm.lifetime.end(i64, ptr nocapture)
108 !0 = !{!"Ubuntu clang version 3.7.1-3ubuntu4 (tags/RELEASE_371/final) (based on LLVM 3.7.1)"}
109 !1 = !{!2, !2, i64 0}
110 !2 = !{!"float", !3, i64 0}
111 !3 = !{!"omnipotent char", !4, i64 0}
112 !4 = !{!"Simple C/C++ TBAA"}