[Mlir-commits] [mlir] [mlir][linalg] Implement patterns for reducing rank of named linalg contraction ops (PR #95710)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Fri Jun 21 01:04:47 PDT 2024


================
@@ -833,4 +833,245 @@ struct LinalgFoldUnitExtentDimsPass
     (void)applyPatternsAndFoldGreedily(op, std::move(patterns));
   }
 };
+
+} // namespace
+
+namespace {
+
+static SmallVector<ReassociationIndices>
+getReassociationForReshapeAtDim(int64_t rank, int64_t pos) {
+  SmallVector<ReassociationIndices> reassociation(rank - 1, {0, 1});
+  auto lastDim = pos == rank - 1;
----------------
ftynse wrote:

Nit: expand auto unless the type is obvious from the RHS (a cast or another template where the template argument controls the return type) or long/impossible to spell (iterators, lambdas).

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


More information about the Mlir-commits mailing list