[Mlir-commits] [mlir] [MLIR][Vector] Generalize DropUnitDimFromElementwiseOps to non leading / trailing dimensions. (PR #98455)

Andrzej WarzyƄski llvmlistbot at llvm.org
Fri Jul 12 02:20:07 PDT 2024


================
@@ -1622,11 +1622,11 @@ struct ChainedReduction final : OpRewritePattern<vector::ReductionOp> {
   }
 };
 
-// Helper function dropping unit non-scalable dimension from a VectorType.
-// Scalable unit dimensions are not dropped. Folding such dimensions would
-// require "shifting" the scalable flag onto some other fixed-width dim (e.g.
-// vector<[1]x4xf32> -> vector<[4]xf32>). This could be implemented in the
-// future.
+// Helper function dropping unit non-scalable dimension from a VectorType
+// keeping at least 1 dimension. Scalable unit dimensions are not dropped.
----------------
banach-space wrote:

[nit] 
```suggestion
// keeping at least 1 dimension (to avoid generating 0-D vectors). Scalable unit dimensions are not dropped.
```

Tiny bit of extra context could save ourselves from scratching our heads in 6 months :)

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


More information about the Mlir-commits mailing list