This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector] Change print format of ContractionOps iterator type attribute to enums.
Needs ReviewPublic

Authored by olegshyshkov on May 23 2023, 8:15 AM.

Details

Summary

The attribute type became enum in reviews.llvm.org/D133696. This change makes print format consistent, but using default parser/printer for enums, instead of manually converting from strings.

Diff Detail

Event Timeline

olegshyshkov created this revision.May 23 2023, 8:15 AM
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
olegshyshkov requested review of this revision.May 23 2023, 8:15 AM
mehdi_amini added inline comments.May 23 2023, 3:53 PM
mlir/lib/Dialect/Vector/IR/VectorOps.cpp
693

Seems to me that the whole function till now is pretty convoluted, and properties are potentially simplifying the logic drastically, but I may be missing something: why isn't this a declarative assembly format?
Wouldn't this "just work"?

let assemblyFormat = [{
  `indexing_maps =` $indexing_maps `,` `iterator_types =` $iterator_types `,` `kind =` $kind $lhs `,` $rhs `,` $acc attr-dict `:` type($lhs)  `,` type($rhs) `into` type($outs)";
}];

(with a custom directive for $iterator_types, see below)

mlir/test/Conversion/VectorToGPU/vector-to-mma-ops-mma-sync.mlir
92

This is a bit verbose: can we have a custom printer here that "unwrap" the "vector.iterator_type" to print just the enum values? (you could even print them as strings and avoid changing any test I think.

dcaballe added inline comments.May 23 2023, 5:33 PM
mlir/test/Conversion/VectorToGPU/vector-to-mma-ops-mma-sync.mlir
92

+1, that would be awesome!