[mlir][bufferization] Improve analysis for element-wise operations
Before this change, two equivalent operands that bufferize to a memory read and write, respectively, were always conflicting. This change improves the analysis for ops that bufferize to element-wise access. Such ops can bufferize in-place, because an original element value is not needed anymore after computing and writing an updated element value. This change allows ops such as the following one to bufferize in-place: ``` %0 = linalg.elemwise_binary {fun = #linalg.binary_fn<add>} ins(%a, %b : tensor<5xf32>, tensor<5xf32>) outs(%a : tensor<5xf32>) -> tensor<5xf32> ``` Differential Revision: https://reviews.llvm.org/D156887
Loading
Please sign in to comment