This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector] Add canonializations for vector.contract
ClosedPublic

Authored by ThomasRaoux on Oct 19 2021, 9:28 PM.

Details

Summary

add several canonicalizations that will simplify contraction
vectorization in the future. With those canonicalizationns we will be
able to remove the special case for contration during vectorization and
rely on those transformations to avoid materizalizing broadcast ops.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Oct 19 2021, 9:28 PM
ThomasRaoux requested review of this revision.Oct 19 2021, 9:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2021, 9:28 PM

Thanks for adding this, Thomas. LGTM. Just a comment about the location of the patterns.

mlir/lib/Dialect/Vector/VectorOps.cpp
1013

IIUC, we may not want the mul+multi_reduction->contraction to happen all the time, right? I'm not sure about the other one. I think at least the multi_reduction one shouldn't be part of the canonicalizer but be in a separate populate*.

+1 for a separate populate function, thanks!

This revision is now accepted and ready to land.Oct 21 2021, 11:36 AM

Move the patterns out of canonicalizations

This revision was landed with ongoing or failed builds.Oct 21 2021, 2:04 PM
This revision was automatically updated to reflect the committed changes.