This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector] Add unrolling patterns for Transfer read/write
ClosedPublic

Authored by ThomasRaoux on Oct 12 2020, 8:23 PM.

Details

Summary

Adding unroll support for transfer read and transfer write operation. This allow to pick the ideal size for the memory access for a given target.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Oct 12 2020, 8:23 PM
ThomasRaoux requested review of this revision.Oct 12 2020, 8:23 PM
andydavis1 added inline comments.Oct 13 2020, 3:20 PM
mlir/lib/Dialect/Vector/VectorTransforms.cpp
679

Do you need the same here for TransferReadOp?

679

I meant do you need the same here for TransferWriteOp?

ThomasRaoux added inline comments.Oct 13 2020, 3:23 PM
mlir/lib/Dialect/Vector/VectorTransforms.cpp
679

Not sure I understand. Do you mean TransferWriteOp? TransferWriteOp is handled in a separate function since this function is meant to handle instructions with single result.

ThomasRaoux added inline comments.Oct 13 2020, 3:24 PM
mlir/lib/Dialect/Vector/VectorTransforms.cpp
679

Ha ok, yes I cannot handle TransferWriteOp here as it has no result. That's why I had to handle it separately in the parent function.

andydavis1 accepted this revision.Oct 14 2020, 1:57 PM

Looks good. Let's see if Nicolas has some feedback...

mlir/test/Dialect/Vector/vector-transfer-unroll.mlir
42

At some point, it would be good have a test which captures your full use-case here. Unroll VTR/VTW to some vector size, then unroll vector.contract to a different vector size, and check that the final IR is what you expect.

This revision is now accepted and ready to land.Oct 14 2020, 1:57 PM
ThomasRaoux added inline comments.Oct 15 2020, 9:24 AM
mlir/test/Dialect/Vector/vector-transfer-unroll.mlir
42

Good point. I'll add it in a future patch if it is okay.