This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Flipping vector dialect to both prefixed form.
ClosedPublic

Authored by jpienaar on Feb 11 2022, 4:52 PM.

Diff Detail

Event Timeline

jpienaar created this revision.Feb 11 2022, 4:52 PM
jpienaar requested review of this revision.Feb 11 2022, 4:52 PM
mehdi_amini accepted this revision.Feb 11 2022, 4:57 PM
This revision is now accepted and ready to land.Feb 11 2022, 4:57 PM
rriddle added inline comments.Feb 11 2022, 4:59 PM
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
72–74

getAsValueRange?

rriddle accepted this revision.Feb 11 2022, 4:59 PM
jpienaar added inline comments.Feb 14 2022, 6:23 PM
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
72–74

Here the storage is an array of Attribute type, so I'd have to getAsValueRange<Attribute, AffineMapAttr> and then map over that to get the AffineMap out before then constructing vector of AffineMap. That decreases the readability for me.

rriddle added inline comments.Feb 14 2022, 6:29 PM
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
72–74

Is $_self here not an ArrayAttr? If it is, $_self.getAsValueRange<AffineMapAttr>() should do the exact same thing as this map_range.

jpienaar added inline comments.Feb 15 2022, 8:53 AM
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
72–74

That would be true if this were returning a vector of AffineMapAttr. Here it is a vector of AffineMap, so there needs to be another mapping over the range to getValue on AffineMapAttr.

jpienaar added inline comments.Feb 15 2022, 9:24 AM
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
72–74

Seems I was making a typo there the whole time (tried a few combos and all failed, then just retried and it worked)

This revision was automatically updated to reflect the committed changes.