[Mlir-commits] [mlir] [mlir][vector] Fold transpose(broadcast(shape_cast)) to broadcast (PR #215940)

Adam Siemieniuk llvmlistbot at llvm.org
Fri Aug 21 01:59:49 PDT 2026


================
@@ -7523,9 +7523,32 @@ class FoldTransposeFromElements final : public OpRewritePattern<TransposeOp> {
   }
 };
 
-/// Folds transpose(broadcast(x)) to broadcast(x) if the transpose is
-/// 'order preserving', where 'order preserving' means the flattened
-/// inputs and outputs of the transpose have identical (numerical) values.
+/// Positions (in order) of `type`'s non-broadcast dims: the data-carrying dims
+/// (size != 1, or a scalable [1]) a broadcast copies verbatim. Size-1 dims are
----------------
adam-smnk wrote:

nit: I'd rephrase to make the comment more abstract without implementation details

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


More information about the Mlir-commits mailing list