Once we have tensor_to_memref ops suitable for type materializations, this pass can be split into a generic type conversion pattern. Part of the refactor discussed in: https://llvm.discourse.group/t/what-is-the-strategy-for-tensor-memref-conversion-bufferization/1938/17 Differential Revision: https://reviews.llvm.org/D89258
17 lines
502 B
MLIR
17 lines
502 B
MLIR
// RUN: mlir-opt -split-input-file -shape-bufferize <%s | FileCheck %s
|
|
|
|
// -----
|
|
// Check that shape.assuming returns a memref.
|
|
//
|
|
// CHECK-LABEL: @shape_assuming_returns_memref
|
|
func @shape_assuming_returns_memref() {
|
|
%0 = shape.const_witness true
|
|
// CHECK: shape.assuming %{{.*}} -> (memref<2xf16>) {
|
|
%1 = shape.assuming %0 -> (tensor<2xf16>) {
|
|
%2 = "test.source"() : () -> (tensor<2xf16>)
|
|
shape.assuming_yield %2 : tensor<2xf16>
|
|
}
|
|
"test.sink"(%1) : (tensor<2xf16>) -> ()
|
|
return
|
|
}
|