You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
641 B
32 lines
641 B
4 months ago
|
// RUN: mlir-opt %s -inline | FileCheck %s
|
||
|
|
||
|
// These tests verify that regions with operations from Lingalg dialect
|
||
|
// can be inlined.
|
||
|
|
||
|
#accesses = [
|
||
|
affine_map<(i) -> (i)>,
|
||
|
affine_map<(i) -> (i)>
|
||
|
]
|
||
|
|
||
|
#trait = {
|
||
|
indexing_maps = #accesses,
|
||
|
iterator_types = ["parallel"]
|
||
|
}
|
||
|
|
||
|
func @inline_into(%arg0: memref<?xf32>) {
|
||
|
// CHECK: linalg.generic
|
||
|
call @inlined_fn(%arg0) : (memref<?xf32>) -> ()
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func @inlined_fn(%arg0: memref<?xf32>) {
|
||
|
// CHECK: linalg.generic
|
||
|
linalg.generic #trait
|
||
|
ins(%arg0 : memref<?xf32>)
|
||
|
outs(%arg0 : memref<?xf32>) {
|
||
|
^bb(%0 : f32, %1 : f32) :
|
||
|
linalg.yield %0 : f32
|
||
|
}
|
||
|
return
|
||
|
}
|