• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: mlir-opt %s -inline | FileCheck %s
2
3// These tests verify that regions with operations from Lingalg dialect
4// can be inlined.
5
6#accesses = [
7  affine_map<(i) -> (i)>,
8  affine_map<(i) -> (i)>
9]
10
11#trait = {
12  indexing_maps = #accesses,
13  iterator_types = ["parallel"]
14}
15
16func @inline_into(%arg0: memref<?xf32>) {
17  // CHECK: linalg.generic
18  call @inlined_fn(%arg0) : (memref<?xf32>) -> ()
19  return
20}
21
22func @inlined_fn(%arg0: memref<?xf32>) {
23  // CHECK: linalg.generic
24  linalg.generic #trait
25     ins(%arg0 : memref<?xf32>)
26    outs(%arg0 : memref<?xf32>) {
27    ^bb(%0 : f32, %1 : f32) :
28      linalg.yield %0 : f32
29  }
30  return
31}
32