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.
16 lines
623 B
MLIR
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
|
|
}
|