Files
clang-p2996/mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-pass-statistics.mlir
Martin Erhart 6bf043e743 [mlir][bufferization] Remove allow-return-allocs and create-deallocs pass options, remove bufferization.escape attribute (#66619)
This commit removes the deallocation capabilities of
one-shot-bufferization. One-shot-bufferization should never deallocate
any memrefs as this should be entirely handled by the
ownership-based-buffer-deallocation pass going forward. This means the
`allow-return-allocs` pass option will default to true now,
`create-deallocs` defaults to false and they, as well as the escape
attribute indicating whether a memref escapes the current region, will
be removed. A new `allow-return-allocs-from-loops` option is added as a
temporary workaround for some bufferization limitations.
2023-09-18 16:44:48 +02:00

16 lines
623 B
MLIR

// REQUIRES: asserts
// RUN: mlir-opt %s -one-shot-bufferize="allow-unknown-ops" -mlir-pass-statistics 2>&1 | FileCheck %s
// CHECK: OneShotBufferize
// CHECK: (S) 1 num-buffer-alloc
// CHECK: (S) 1 num-tensor-in-place
// CHECK: (S) 2 num-tensor-out-of-place
func.func @read_after_write_conflict(%cst : f32, %idx : index, %idx2 : index)
-> (f32, f32) {
%t = "test.dummy_op"() : () -> (tensor<10xf32>)
%write = tensor.insert %cst into %t[%idx2] : tensor<10xf32>
%read = "test.some_use"(%t) : (tensor<10xf32>) -> (f32)
%read2 = tensor.extract %write[%idx] : tensor<10xf32>
return %read, %read2 : f32, f32
}