Files
clang-p2996/mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-memory-space-invalid.mlir
Matthias Springer c0b0b6a00a [mlir][bufferize] Infer memory space in all bufferization patterns
This change updates all remaining bufferization patterns (except for scf.while) and the remaining bufferization infrastructure to infer the memory space whenever possible instead of falling back to "0". (If a default memory space is set in the bufferization options, we still fall back to that value if the memory space could not be inferred.)

Differential Revision: https://reviews.llvm.org/D128423
2022-06-27 16:32:52 +02:00

20 lines
710 B
MLIR

// RUN: mlir-opt %s -allow-unregistered-dialect -one-shot-bufferize="must-infer-memory-space" -split-input-file -verify-diagnostics
func.func @alloc_tensor_without_memory_space() -> tensor<10xf32> {
// expected-error @+2 {{could not infer memory space}}
// expected-error @+1 {{failed to bufferize op}}
%0 = bufferization.alloc_tensor() : tensor<10xf32>
return %0 : tensor<10xf32>
}
// -----
func.func @memory_space_of_unknown_op() -> f32 {
%c0 = arith.constant 0 : index
// expected-error @+1 {{could not infer memory space}}
%t = "test.dummy_op"() : () -> (tensor<10xf32>)
// expected-error @+1 {{failed to bufferize op}}
%s = tensor.extract %t[%c0] : tensor<10xf32>
return %s : f32
}