[Mlir-commits] [mlir] [mlir][linalg] Introduce transpose semantic to 'linalg.matmul' ops. (PR #104783)

Stella Laurenzo llvmlistbot at llvm.org
Tue Sep 24 15:19:27 PDT 2024


================
@@ -149,15 +154,30 @@ static void fillStructuredOpRegion(OpBuilder &opBuilder, Region &region,
   // iterator_types is an auto-generated method.
 }
 
+static void getDefaultIndexingMap(MLIRContext *context,
+                                  SmallVectorImpl<Attribute> &indexingMaps) {
+  Attribute mapAttr;
+  mapAttr = llvm::cast<AffineMapAttr>(
+      mlir::parseAttribute("affine_map<(d0, d1, d2)->(d0, d2)>", context));
----------------
stellaraccident wrote:

I think they got it from the OpDSL code generator where it was done because the DSL was defined in terms of the printed form of affine expressions. So it included a parse as a shortcut to the DSL needing to reify the build logic. That is tedious to do generally but not hard to do for any specific case: just use a normal API for constructing this specific affine map and don't use the parser.

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


More information about the Mlir-commits mailing list