[Mlir-commits] [mlir] [mlir][Linalg] Allow more control in drop unit dims (PR #171796)

Lukas Sommer llvmlistbot at llvm.org
Fri Dec 12 09:08:21 PST 2025


================
@@ -516,6 +516,28 @@ LogicalResult vectorizeOpPrecondition(Operation *op,
 
 using LinalgLoops = SmallVector<Operation *, 4>;
 
+// Forward declaration
+struct ControlDropUnitDims;
+
+/// Collapse the given \p value to \p targetShape. The \p reassociation is used
+/// when `rankReductionStrategy` of \p control is set to
+/// `RankReductionStrategy::ReassociativeReshape`. Will return failure if the
+/// operand has memref type with a non-identity layout or tensor type with an
+/// encoding.
+FailureOr<Value> collapseValue(RewriterBase &rewriter, Location loc,
----------------
sommerlukas wrote:

I've turned them into private `static` class functions. Using a `static` `std::function` member would require a global constructor, triggering a warning.

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


More information about the Mlir-commits mailing list