[MLIR][Linalg] Preserve DPS when decomposing Softmax
authorLorenzo Chelini <l.chelini@icloud.com>
Fri, 21 Jul 2023 11:28:45 +0000 (13:28 +0200)
committerLorenzo Chelini <l.chelini@icloud.com>
Fri, 21 Jul 2023 16:03:26 +0000 (18:03 +0200)
commit4fb25ca51c851015d7e0081b08da342285de2cb1
tree7980f0296303fd25d789d4cf58aad56ac237debd
parentb81b4cfc654784f19af7296f01719630ea24fc89
[MLIR][Linalg] Preserve DPS when decomposing Softmax

Preserve destination passing style (DPS) when decomposing
`linalg.Softmax`; instead of creating a new empty, which may materialize
as a new buffer after bufferization, use the result directly.

Reviewed By: qcolombet

Differential Revision: https://reviews.llvm.org/D155942
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/test/Dialect/Linalg/transform-op-decompose.mlir