This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Fix vectorization bug in vector transfer indexing map calculation
ClosedPublic

Authored by ThomasRaoux on May 2 2021, 8:59 PM.

Details

Summary

The current implementation had a bug as it was relying on the target vector dimension sizes to calculate where to insert broadcast. If several dimensions have the same size we may insert the broadcast on the wrong dimension. The correct broadcast cannot be inferred from the type of the source and destination vector.
Instead when we want to extend transfer ops we calculate an "inverse" map to the projected permutation and insert broadcast in place of the projected dimensions.

Diff Detail

Event Timeline

ThomasRaoux created this revision.May 2 2021, 8:59 PM
ThomasRaoux requested review of this revision.May 2 2021, 8:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2021, 8:59 PM

Fix comment.

antiagainst accepted this revision.May 3 2021, 11:15 AM

LGTM. Thanks for fixing this, Thomas!

mlir/include/mlir/IR/AffineMap.h
407

.. where the non-projected ... ?

This revision is now accepted and ready to land.May 3 2021, 11:15 AM

Thanks Lei!

mlir/include/mlir/IR/AffineMap.h
407

I meant projected, basically the projected dimensions in the original map are transformed to broadcast. Let me know if you have any suggestion on how to make it clearer.