This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector] Add more vector Ops canonicalization
ClosedPublic

Authored by ThomasRaoux on Dec 11 2020, 7:11 AM.

Details

Summary

Add canonicalization for BroadcastOp, ExtractStrideSlicesOp and ShapeCastOp

Diff Detail

Event Timeline

ThomasRaoux created this revision.Dec 11 2020, 7:11 AM
ThomasRaoux requested review of this revision.Dec 11 2020, 7:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 11 2020, 7:11 AM

ping, if anybody is around :)

aartbik added inline comments.Dec 21 2020, 2:19 PM
mlir/lib/Dialect/Vector/VectorOps.cpp
1116

is this always a valid transormation? can you add a few more comments reassuring the first time reader?

1895

nit: rewrite an

1913

lots of code here without clear documentation

I think this would benefit from a description of the kind of input pattern you are testing for

Address review comments.

ThomasRaoux marked an inline comment as done.Dec 22 2020, 10:35 AM
ThomasRaoux added inline comments.
mlir/lib/Dialect/Vector/VectorOps.cpp
1116

Makes sense. I added a comment explaining the reasoning. Hopefully that makes it more obvious.

1913

Added some explanation for the logic.

This looks fine to me, but I dont have detailed context on vector dialect.

aartbik accepted this revision.Dec 22 2020, 12:48 PM
aartbik added inline comments.
mlir/lib/Dialect/Vector/VectorOps.cpp
1117

nit: canonicalization check*s*

1801–1802

I know it was there, but can we replace -> with to
(subjectively I find programming symbols in text a bit awkward)

1895

same on the -> here

This revision is now accepted and ready to land.Dec 22 2020, 12:48 PM

Address more review comments.

ThomasRaoux marked 3 inline comments as done.Dec 22 2020, 4:33 PM

Thanks Aart and Mahesh

This revision was automatically updated to reflect the committed changes.
bondhugula added a subscriber: bondhugula.EditedDec 23 2020, 11:20 PM

@ThomasRaoux, not on a directly related note, but this file VectorOps.cpp is taking nearly 12-15s to build on a fast workstation -- directly increasing build times / critical path towards mlir-opt and other targets for everyone. It'd be great to consider refactoring among next steps.

@ThomasRaoux, not on a directly related note, but this file VectorOps.cpp is taking nearly 12-15s to build on a fast workstation -- directly increasing build times / critical path towards mlir-opt and other targets for everyone. It'd be great to consider refactoring among next steps.

@bondhugula, that's interesting, thanks for pointing it out. I'll investigate after the holidays.