[Mlir-commits] [mlir] [MLIR][Vector] Added ToElementsOp::fold for broadcast->to_elements pattern rewrite. (PR #160318)

Kunwar Grover llvmlistbot at llvm.org
Tue Sep 30 05:08:40 PDT 2025


================
@@ -2395,9 +2396,41 @@ foldToElementsFromElements(ToElementsOp toElementsOp,
   return success();
 }
 
+/// Folds vector.to_elements(vector.broadcast(%x)) for the scalar case only.
+///
+/// Cases handled:
+///  - %x is a scalar: replicate the scalar across all results.
----------------
Groverkss wrote:

If there is only 1 case handled, we dont need a bullet point list for it.

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


More information about the Mlir-commits mailing list