1 ; RUN: opt %loadPolly -polly-opt-isl -polly-pattern-matching-based-opts=true \
2 ; RUN: -polly-target-throughput-vector-fma=1 \
3 ; RUN: -polly-target-latency-vector-fma=8 \
4 ; RUN: -polly-target-1st-cache-level-associativity=8 \
5 ; RUN: -polly-target-2nd-cache-level-associativity=8 \
6 ; RUN: -polly-target-1st-cache-level-size=32768 \
7 ; RUN: -polly-target-2nd-cache-level-size=262144 \
8 ; RUN: -polly-optimized-scops \
9 ; RUN: -polly-target-vector-register-bitwidth=256 \
10 ; RUN: -disable-output < %s 2>&1 | FileCheck %s
12 ; /* C := alpha*A*B + beta*C */
13 ; for (i = 0; i < _PB_NI; i++)
14 ; for (j = 0; j < _PB_NJ; j++)
17 ; for (k = 0; k < _PB_NK; ++k)
18 ; C[i][j] += alpha * A[i][k] * B[k][j];
21 ; CHECK: double Packed_B[ { [] -> [(256)] } ][ { [] -> [(256)] } ][ { [] -> [(8)] } ];
22 ; CHECK-NEXT: double Packed_A[ { [] -> [(24)] } ][ { [] -> [(256)] } ][ { [] -> [(4)] } ]; // Element size 8
24 ; CHECK: { Stmt_Copy_0[i0, i1, i2] -> MemRef_arg6[i0, i2] };
25 ; CHECK-NEXT: new: { Stmt_Copy_0[i0, i1, i2] -> Packed_A[o0, o1, o2] : 256*floor((-i2 + o1)/256) = -i2 + o1 and 96*floor((-i0 + 4o0 + o2)/96) = -i0 + 4o0 + o2 and 0 <= o1 <= 255 and o2 >= 0 and -4o0 <= o2 <= 95 - 4o0 and o2 <= 3 };
27 ; CHECK: { Stmt_Copy_0[i0, i1, i2] -> MemRef_arg7[i2, i1] };
28 ; CHECK-NEXT: new: { Stmt_Copy_0[i0, i1, i2] -> Packed_B[o0, o1, i1 - 8o0] : 256*floor((-i2 + o1)/256) = -i2 + o1 and -7 + i1 <= 8o0 <= i1 and 0 <= o1 <= 255 };
31 ; CHECK-NEXT: Domain :=
32 ; CHECK-NEXT: { CopyStmt_0[i0, i1, i2] : 0 <= i0 <= 1055 and 0 <= i1 <= 1055 and 0 <= i2 <= 1023 };
33 ; CHECK-NEXT: Schedule :=
35 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
37 ; CHECK-NEXT: new: { CopyStmt_0[i0, i1, i2] -> Packed_B[o0, o1, i1 - 8o0] : 256*floor((-i2 + o1)/256) = -i2 + o1 and -7 + i1 <= 8o0 <= i1 and 0 <= o1 <= 255 };
38 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
40 ; CHECK-NEXT: new: { CopyStmt_0[i0, i1, i2] -> MemRef_arg7[i2, i1] };
41 ; CHECK-NEXT: CopyStmt_1
42 ; CHECK-NEXT: Domain :=
43 ; CHECK-NEXT: { CopyStmt_1[i0, i1, i2] : 0 <= i0 <= 1055 and 0 <= i1 <= 1055 and 0 <= i2 <= 1023 };
44 ; CHECK-NEXT: Schedule :=
46 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
48 ; CHECK-NEXT: new: { CopyStmt_1[i0, i1, i2] -> Packed_A[o0, o1, o2] : 256*floor((-i2 + o1)/256) = -i2 + o1 and 96*floor((-i0 + 4o0 + o2)/96) = -i0 + 4o0 + o2 and 0 <= o1 <= 255 and o2 >= 0 and -4o0 <= o2 <= 95 - 4o0 and o2 <= 3 };
49 ; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
51 ; CHECK-NEXT: new: { CopyStmt_1[i0, i1, i2] -> MemRef_arg6[i0, i2] };
53 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
54 target triple = "x86_64-unknown-unknown"
56 define internal void @kernel_gemm(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %arg4, [1056 x double]* %arg5, [1024 x double]* %arg6, [1056 x double]* %arg7) #0 {
60 bb8: ; preds = %bb29, %bb
61 %tmp = phi i64 [ 0, %bb ], [ %tmp30, %bb29 ]
64 bb9: ; preds = %bb26, %bb8
65 %tmp10 = phi i64 [ 0, %bb8 ], [ %tmp27, %bb26 ]
66 %tmp11 = getelementptr inbounds [1056 x double], [1056 x double]* %arg5, i64 %tmp, i64 %tmp10
67 %tmp12 = load double, double* %tmp11, align 8
68 %tmp13 = fmul double %tmp12, %arg4
69 store double %tmp13, double* %tmp11, align 8
72 Copy_0: ; preds = %Copy_0, %bb9
73 %tmp15 = phi i64 [ 0, %bb9 ], [ %tmp24, %Copy_0 ]
74 %tmp16 = getelementptr inbounds [1024 x double], [1024 x double]* %arg6, i64 %tmp, i64 %tmp15
75 %tmp17 = load double, double* %tmp16, align 8
76 %tmp18 = fmul double %tmp17, %arg3
77 %tmp19 = getelementptr inbounds [1056 x double], [1056 x double]* %arg7, i64 %tmp15, i64 %tmp10
78 %tmp20 = load double, double* %tmp19, align 8
79 %tmp21 = fmul double %tmp18, %tmp20
80 %tmp22 = load double, double* %tmp11, align 8
81 %tmp23 = fadd double %tmp22, %tmp21
82 store double %tmp23, double* %tmp11, align 8
83 %tmp24 = add nuw nsw i64 %tmp15, 1
84 %tmp25 = icmp ne i64 %tmp24, 1024
85 br i1 %tmp25, label %Copy_0, label %bb26
87 bb26: ; preds = %Copy_0
88 %tmp27 = add nuw nsw i64 %tmp10, 1
89 %tmp28 = icmp ne i64 %tmp27, 1056
90 br i1 %tmp28, label %bb9, label %bb29
93 %tmp30 = add nuw nsw i64 %tmp, 1
94 %tmp31 = icmp ne i64 %tmp30, 1056
95 br i1 %tmp31, label %bb8, label %bb32
101 attributes #0 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+aes,+avx,+cmov,+cx16,+fxsr,+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+xsaveopt" }