[mlir][arith] Add narrowing patterns to commute more vector ops
authorJakub Kuderski <kubak@google.com>
Mon, 1 May 2023 18:31:20 +0000 (14:31 -0400)
committerJakub Kuderski <kubak@google.com>
Mon, 1 May 2023 18:32:57 +0000 (14:32 -0400)
commit7f3b0e584513611bb1d804892eb269ae45d8e715
tree9a367573ce4435714db1ec2111dbc764ebcb9120
parent3ff870881f5f0d3d08753efd558ac5f05d04a574
[mlir][arith] Add narrowing patterns to commute more vector ops

This commutes the extension (`arith.extsi`, `arith.extui`) over the
following vector ops: `vector.broadcast`, `vector.shape_cast`,
`vector.transpose`, `vector.flat_transpose`.

I focused on these as I saw them getting created by vector unroll
patterns. Maybe except `vector.flat_transpose`.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D149534
mlir/lib/Dialect/Arith/Transforms/IntNarrowing.cpp
mlir/test/Dialect/Arith/int-narrowing.mlir