This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector] Add insertOp src shape check for BubbleUpBitCastForStridedSliceInsert
ClosedPublic

Authored by raikonenfnu on Nov 10 2022, 1:46 PM.

Details

Summary

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.

Diff Detail

Event Timeline

raikonenfnu created this revision.Nov 10 2022, 1:46 PM
Herald added a project: Restricted Project. · View Herald Transcript
raikonenfnu requested review of this revision.Nov 10 2022, 1:46 PM

please add a test.

antiagainst requested changes to this revision.Nov 10 2022, 2:19 PM

Yeah please add a test for this.

mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
2506

s/src/source/. Typically we'd prefer to spell out the word in comments.

2509

Nit: s/unitCastNumel/numElements/?

This revision now requires changes to proceed.Nov 10 2022, 2:19 PM

Added tests and fix nits

ThomasRaoux accepted this revision.Nov 10 2022, 4:01 PM
antiagainst accepted this revision.Nov 10 2022, 4:34 PM
This revision is now accepted and ready to land.Nov 10 2022, 4:34 PM
This revision was landed with ongoing or failed builds.Nov 10 2022, 4:42 PM
This revision was automatically updated to reflect the committed changes.