[mlir][vector] Add fold pattern to constant-fold InsertStridedSliceOp
authorJakub Kuderski <kubak@google.com>
Mon, 28 Nov 2022 19:24:04 +0000 (14:24 -0500)
committerJakub Kuderski <kubak@google.com>
Mon, 28 Nov 2022 19:25:28 +0000 (14:25 -0500)
commitf0fe38035c92bae9ccc827097ab55b37e2427a29
tree31c94b24cb1e24f4255ccb45b9873d5a58519887
parentad386a886b16ad83a982c0eff3f80d8ae8888882
[mlir][vector] Add fold pattern to constant-fold InsertStridedSliceOp

Fold InsertStridedOp(ConstantOp into ConstantOp) -> ConstantOp.

This pattern comes with vector size threshold to make sure we do not
introduce too many large constants.

This help clean up code created by the Wide Integer Emulation pass.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D138739
mlir/lib/Dialect/Vector/IR/VectorOps.cpp
mlir/test/Dialect/Vector/canonicalize.mlir