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

Lukas Sommer llvmlistbot at llvm.org
Fri Dec 12 09:07:16 PST 2025


================
@@ -63,6 +122,10 @@ struct TestLinalgDropUnitDims
 
     for (auto genericOp : genericOps) {
       rewriter.setInsertionPoint(genericOp);
+      if (collapseEncoded) {
+        (void)dropOutermostUnitDimsWithEncoding(rewriter, genericOp);
----------------
sommerlukas wrote:

I think we need to continue to ignore the return here, or at least we can't signal pass failure if this `failed()`. The reason is that the `dropUnitDims` API uses `failure()` to signal that the transformation was aborted and no transformation happened, which is more like a match failure, not a malicious failure. 

`drop_unit_dims_encoded_operand` and `drop_unit_dims_encoded_result` exercise that when running with default behavior.

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


More information about the Mlir-commits mailing list