xref: /llvm-project/mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-pass-statistics.mlir (revision 6bf043e7433680c6f4e36393734ef83699b30f14)
1// REQUIRES: asserts
2// RUN: mlir-opt %s -one-shot-bufferize="allow-unknown-ops" -mlir-pass-statistics 2>&1 | FileCheck %s
3
4// CHECK: OneShotBufferize
5// CHECK:  (S) 1 num-buffer-alloc
6// CHECK:  (S) 1 num-tensor-in-place
7// CHECK:  (S) 2 num-tensor-out-of-place
8func.func @read_after_write_conflict(%cst : f32, %idx : index, %idx2 : index)
9    -> (f32, f32) {
10  %t = "test.dummy_op"() : () -> (tensor<10xf32>)
11  %write = tensor.insert %cst into %t[%idx2] : tensor<10xf32>
12  %read = "test.some_use"(%t) : (tensor<10xf32>) -> (f32)
13  %read2 = tensor.extract %write[%idx] : tensor<10xf32>
14  return %read, %read2 : f32, f32
15}
16