[mlir][arith] Extend the `floordivsi` converter
authorAndrzej Warzynski <andrzej.warzynski@gmail.com>
Thu, 23 Mar 2023 17:39:48 +0000 (17:39 +0000)
committerAndrzej Warzynski <andrzej.warzynski@gmail.com>
Fri, 24 Mar 2023 08:48:55 +0000 (08:48 +0000)
commitcf60d3f1a688671c8eb7859bf0572c403c3c0cca
tree80e18d8929349e9db019c436216cab35d6b53ccc
parent6a7d04c6b44de91dd1188d9e614b6e681d378b0e
[mlir][arith] Extend the `floordivsi` converter

This patch extends the `createConst` method so that it can generate
constant vectors (it can already generate scalars). This change is
required to be able to apply the converter for `arith.floordivsi`
(i.e. `FloorDivSIOpConverter`) to vectors.

While `arith.floordivsi` is my main motivation for this change, this
patch should also allow other Arith ops to be converted in vector cases.
In my example, the Linalg vectorizer updates `arith.floordivsi` to
operate on vectors and hence the need for this change.

Differential Revision: https://reviews.llvm.org/D146741
mlir/include/mlir/Dialect/Arith/Transforms/Passes.td
mlir/lib/Dialect/Arith/Transforms/ExpandOps.cpp
mlir/test/Dialect/Arith/expand-ops.mlir