[mlir][vector] Add insertOp src shape check for BubbleUpBitCastForStridedSliceInsert
authorstanley-nod <stanley@nod-labs.com>
Fri, 11 Nov 2022 00:41:59 +0000 (16:41 -0800)
committerstanley-nod <stanley@nod-labs.com>
Fri, 11 Nov 2022 00:41:59 +0000 (16:41 -0800)
commitdc26c030661a763bdc50c759576fc3c34f3c496a
tree8448dddf37a76ec377b89e8ab63b5729613a7681
parent97105e5bf70fae5d9902081e917fd178b57f1717
[mlir][vector] Add insertOp src shape check for BubbleUpBitCastForStridedSliceInsert

Not all shape of vectors can be casted into other types, we add a check
to not fold insertOp into bitcast if the shape does not support it.

Examples of unsupported shape castings are f16 vectors to f32 if the
shape is not multiple of 2s. or int8 to int32 if shapes are not multiple
of 4.

Reviewed By: antiagainst, ThomasRaoux

Differential Revision: https://reviews.llvm.org/D137802
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
mlir/test/Dialect/Vector/vector-transforms.mlir