This is an archive of the discontinued LLVM Phabricator instance.

[mlir] [VectorOps] Implement vector.reduce operation
ClosedPublic

Authored by aartbik on Feb 10 2020, 5:01 PM.

Details

Summary

This new operation operates on 1-D vectors and
forms the bridge between vector.contract and
llvm intrinsics for vector reductions.

Diff Detail

Event Timeline

aartbik created this revision.Feb 10 2020, 5:01 PM
rriddle added inline comments.Feb 10 2020, 5:21 PM
mlir/include/mlir/Dialect/VectorOps/VectorOps.td
203

Looks like you are missing the into type on these examples.

aartbik updated this revision to Diff 243723.Feb 10 2020, 8:21 PM
aartbik marked 2 inline comments as done.

updated description, one more verify test

aartbik added inline comments.Feb 10 2020, 8:22 PM
mlir/include/mlir/Dialect/VectorOps/VectorOps.td
203

Good eye! Thanks for noticing.

nicolasvasilache accepted this revision.Feb 10 2020, 9:45 PM
nicolasvasilache added inline comments.
mlir/include/mlir/Dialect/VectorOps/VectorOps.td
210

if we had better dependent type support, would we want to drop the into f32 part of the op?

mlir/test/Dialect/VectorOps/invalid.mlir
998

what's a "joho" ? :)

This revision is now accepted and ready to land.Feb 10 2020, 9:45 PM
aartbik marked 4 inline comments as done.Feb 11 2020, 10:54 AM
aartbik added inline comments.
mlir/include/mlir/Dialect/VectorOps/VectorOps.td
210

Yes, at the moment that would make sense to get more concise syntax. In the longer run, we may want to add mixed type versions (e.g. i32 = reduce_max_index f32) where having the type may be more useful.

mlir/test/Dialect/VectorOps/invalid.mlir
998

Ha! Joho has been my "scratch" word since my very first computer (files names joho are always temporary, invalid syntax is shown with a joho keyword!)

aartbik updated this revision to Diff 243929.Feb 11 2020, 11:17 AM
aartbik marked 2 inline comments as done.

rebased

This revision was automatically updated to reflect the committed changes.