This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Expose vectorization precondition check as a utility function.
ClosedPublic

Authored by mravishankar on Oct 4 2022, 2:40 PM.

Details

Summary

This patch exposes the method to check if an op can be vectorized or
not for downstream uses. Also adds a check to mark elementwise operations
that have non-vectorizable ops (like tensor.extract) as non vectorizable.

Diff Detail

Event Timeline

mravishankar created this revision.Oct 4 2022, 2:40 PM
Herald added a project: Restricted Project. · View Herald Transcript
mravishankar requested review of this revision.Oct 4 2022, 2:40 PM
nicolasvasilache accepted this revision.Oct 4 2022, 2:42 PM
This revision is now accepted and ready to land.Oct 4 2022, 2:42 PM
ThomasRaoux accepted this revision.Oct 4 2022, 2:45 PM
dcaballe accepted this revision.Oct 4 2022, 2:59 PM
dcaballe added inline comments.
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
571

nit: regionOps -> regionOp

572

Don't we vectorize some tensor extract ops already?

bondhugula added inline comments.
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
571

You don't need getOperations().

571

Nit: The name regionOps isn't appropriate here.

Address comments.

mravishankar marked 3 inline comments as done.

Rebase

mravishankar marked an inline comment as done.Oct 5 2022, 10:25 AM
mravishankar added inline comments.
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
571

Used payloadOp instead.

572

I think not all tensor.extract operations are vectorized. This might need to be made tighter if needed. I'd just wait till all tensor.extract ops are vectorized to drop this here.

This revision was landed with ongoing or failed builds.Oct 5 2022, 10:25 AM
This revision was automatically updated to reflect the committed changes.
mravishankar marked an inline comment as done.