[Mlir-commits] [mlir] [mlir][linalg][gpu] Clean up printing. NFC. (PR #136330)

Jakub Kuderski llvmlistbot at llvm.org
Fri Apr 18 10:47:50 PDT 2025


================
@@ -3660,17 +3661,13 @@ ParseResult MatmulOp::parse(OpAsmParser &parser, OperationState &result) {
 }
 
 void MatmulOp::print(OpAsmPrinter &p) {
-  SmallVector<Attribute, 3> indexingMaps = llvm::map_to_vector(
+  SmallVector<Attribute, 3> indexingMaps = llvm::map_to_vector<3>(
       MatmulOp::getDefaultIndexingMaps(getContext()),
       [](AffineMap map) -> Attribute { return AffineMapAttr::get(map); });
-  if (!llvm::equal(getIndexingMaps(), indexingMaps)) {
-    p << " indexing_maps = [";
-    llvm::interleaveComma(getIndexingMaps(), p,
-                          [&](Attribute attr) { p.printAttribute(attr); });
-    p << "]";
-  }
+  if (!llvm::equal(getIndexingMaps(), indexingMaps))
+    p << " indexing_maps = " << llvm::interleaved_array(getIndexingMaps());
----------------
kuhar wrote:

See https://github.com/llvm/llvm-project/blob/733c250bd5b39db2fa0cd0e201730661da56cc87/llvm/unittests/Support/InterleavedRangeTest.cpp#L43

https://github.com/llvm/llvm-project/pull/136330


More information about the Mlir-commits mailing list