This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Extend vector.gather to accept tensor as base
ClosedPublic

Authored by pzread on Jul 19 2022, 9:33 AM.

Details

Summary

In addition to memref, accept ranked tensor as the base operand of vector.gather, similar to vector.trasnfer_read.

This will allow us to vectorize noncontiguous tensor.extract into vector.gather. Full discussion can be found here: https://github.com/iree-org/iree/issues/9198

Diff Detail

Event Timeline

pzread created this revision.Jul 19 2022, 9:33 AM
pzread edited the summary of this revision. (Show Details)Jul 19 2022, 9:37 AM
pzread edited the summary of this revision. (Show Details)
pzread published this revision for review.Jul 20 2022, 9:00 AM
pzread added a reviewer: hanchung.
dcaballe accepted this revision.Aug 2 2022, 3:55 PM
dcaballe added a subscriber: dcaballe.

Not familiar with bufferization but overall it looks good to me. Thanks!

mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
1773–1776

nit: format?

mlir/test/Dialect/Vector/ops.mlir
675

nit: we can avoid capturing/matching X = if X is not used. Basically // CHECK: vector.gather... should work.

This revision is now accepted and ready to land.Aug 2 2022, 3:55 PM
pzread updated this revision to Diff 449706.Aug 3 2022, 10:41 AM

Fix formating.

pzread marked 2 inline comments as done.Aug 3 2022, 10:42 AM
hanchung accepted this revision.Aug 9 2022, 11:11 AM
This revision was automatically updated to reflect the committed changes.