This is an archive of the discontinued LLVM Phabricator instance.

[mlir][VectorOps] Adds canonicalization rewrite patterns for vector ShapeCastOp.
ClosedPublic

Authored by andydavis1 on Feb 10 2020, 8:09 AM.

Details

Summary

Adds two rewrite patterns for the vector ShapeCastOp.
*) ShapeCastOp decomposer: decomposes ShapeCastOp on tuple-of-vectors to multiple ShapeCastOps each on vector types.
*) ShapeCastOp folder: folds canceling shape cast ops (e.g. shape_cast A -> B followed by shape_cast B -> A) away.

Diff Detail

Event Timeline

andydavis1 created this revision.Feb 10 2020, 8:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2020, 8:09 AM
nicolasvasilache accepted this revision.Feb 10 2020, 1:40 PM

Nice pattern composition Andy!

mlir/lib/Dialect/VectorOps/VectorTransforms.cpp
686

nit: we have historically spelled it out as Example:

697

nit: extra line

This revision is now accepted and ready to land.Feb 10 2020, 1:40 PM
andydavis1 marked 2 inline comments as done.Feb 11 2020, 12:54 PM

addressing comments

rebasing with head

This revision was automatically updated to reflect the committed changes.