Page MenuHomePhabricator

[mlir][Vector] Generalize and improve folding of ExtractOp from Insert/Transpose chain.

Authored by nicolasvasilache on Jan 14 2022, 8:09 AM.



This revision fixes a bug where the iterative algorithm would walk back def-use chains to an incorrect operand.
This exposed opportunities for a larger refactoring and behavior improvement.
The new algorithm has improved folding behavior and proceeds by tracking both the
permutation of the extraction position and the internal vector permutation.
Multiple partial intersection cases with a candidate insertOp are supported.

The refactoring of the implementation should also help it generalize to strided insert/extract op.

This also subsumes the previous foldExtractOpFromTranspose which is now a simple special case and can be deleted.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Jan 14 2022, 8:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2022, 8:09 AM
ThomasRaoux accepted this revision.Jan 14 2022, 6:17 PM
ThomasRaoux added inline comments.

changed by mistake?

This revision is now accepted and ready to land.Jan 14 2022, 6:17 PM

Rebase and address

This revision was landed with ongoing or failed builds.Jan 17 2022, 8:05 AM
This revision was automatically updated to reflect the committed changes.