1// RUN: mlir-opt %s -convert-linalg-to-std | FileCheck %s
2
3func private @print_memref_f32(memref<*xf32>)
4
5// CHECK:  func private @linalg_fill_f32_viewsxsxf32(f32, memref<?x?xf32, {{.*}}>) attributes {llvm.emit_c_interface}
6// CHECK:  func private @linalg_matmul_viewsxsxf32_viewsxsxf32_viewsxsxf32(memref<?x?xf32, {{.*}}>, memref<?x?xf32, {{.*}}>, memref<?x?xf32, {{.*}}>) attributes {llvm.emit_c_interface}
7
8func @matmul(%A: memref<?x?xf32>, %B: memref<?x?xf32>) -> (memref<?x?xf32>) {
9  %c0 = constant 0 : index
10  %c1 = constant 1 : index
11  %f0 = constant 0.0 : f32
12  %x = memref.dim %A, %c0 : memref<?x?xf32>
13  %y = memref.dim %B, %c1 : memref<?x?xf32>
14  %C = memref.alloc(%x, %y) : memref<?x?xf32>
15
16  // CHECK: call @linalg_fill_f32_viewsxsxf32({{.*}}) : (f32, memref<?x?xf32, {{.*}}>)
17  linalg.fill(%f0, %C) : f32, memref<?x?xf32>
18
19  // CHECK:  call @linalg_matmul_viewsxsxf32_viewsxsxf32_viewsxsxf32({{.*}}) : (memref<?x?xf32, {{.*}}>, memref<?x?xf32, {{.*}}>, memref<?x?xf32, {{.*}}>) -> ()
20  linalg.matmul ins(%A, %B: memref<?x?xf32>, memref<?x?xf32>)
21                outs(%C: memref<?x?xf32>)
22  return %C : memref<?x?xf32>
23}
24
25