16 lines · plain
1// REQUIRES: asserts2// RUN: mlir-opt %s -one-shot-bufferize="allow-unknown-ops" -mlir-pass-statistics 2>&1 | FileCheck %s3 4// CHECK: OneShotBufferize5// CHECK: (S) 1 num-buffer-alloc6// CHECK: (S) 1 num-tensor-in-place7// CHECK: (S) 2 num-tensor-out-of-place8func.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, f3215}16