This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector][NFC] Change UnrollVectorPattern to not be statically dependent on an op type
ClosedPublic

Authored by ThomasRaoux on Dec 3 2020, 11:51 PM.

Details

Summary

Make UnrollVectorPattern inherit from RewritePattern instead of OpRewritePattern so that we don't need to create many patterns when applying to many different type of ops. Since we may want to apply the pattern to all arithmetic op, it is more convenient to filter dynamically.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Dec 3 2020, 11:51 PM
ThomasRaoux requested review of this revision.Dec 3 2020, 11:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 3 2020, 11:51 PM
bondhugula added inline comments.
mlir/test/lib/Transforms/TestVectorTransforms.cpp
38

Doc comment please.

154

This method is wrongly named: Contraint -> Constraint. (I understand this is due to a mix up with its French spelling contrainte. :-))

155

Nit side comment: Not sure why the setFilterConstraint argument function just doesn't return a bool instead of LogicalResult.

andydavis1 accepted this revision.Dec 4 2020, 7:54 AM

Thanks!

This revision is now accepted and ready to land.Dec 4 2020, 7:54 AM
nicolasvasilache accepted this revision.Dec 4 2020, 8:41 AM

Address review comments.

ThomasRaoux marked an inline comment as done.Dec 4 2020, 9:49 AM
ThomasRaoux added inline comments.
mlir/test/lib/Transforms/TestVectorTransforms.cpp
154

Fixed it :)

155

Not sure either but I'm leaving it for now as I don't know the reason behind it. Should be easy to do a clean up anytime if we want to.