This is an archive of the discontinued LLVM Phabricator instance.

[mlir] [VectorOps] Add scatter/gather operations to Vector dialect
ClosedPublic

Authored by aartbik on Jul 17 2020, 9:20 AM.

Details

Summary

Introduces the scatter/gather operations to the Vector dialect
(important memory operations for sparse computations), together
with a first reference implementation that lowers to the LLVM IR
dialect to enable running on CPU (and other targets that support
the corresponding LLVM IR intrinsics).

The operations can be used directly where applicable, or can be used
during progressively lowering to bring other memory operations closer to
hardware ISA support for a gather/scatter. The semantics of the operation
closely correspond to those of the corresponding llvm intrinsics.

Note that the operation allows for a dynamic index vector (which is
important for sparse computations). However, this first reference
lowering implementation "serializes" the address computation when
base + index_vector is converted to a vector of pointers. Exploring
how to use SIMD properly during these step is TBD. More general
memrefs and idiomatic versions of striding are also TBD.

Diff Detail

Event Timeline

aartbik created this revision.Jul 17 2020, 9:20 AM
arpith-jacob accepted this revision.Jul 21 2020, 10:31 AM
This revision is now accepted and ready to land.Jul 21 2020, 10:31 AM
This revision was automatically updated to reflect the committed changes.