[Mlir-commits] [mlir] [mlir][linalg] Add folder for broadcast(broadcast) -> broadcast (PR #150825)

Renato Golin llvmlistbot at llvm.org
Sun Jul 27 16:09:53 PDT 2025


================
@@ -2292,9 +2292,40 @@ Speculation::Speculatability BroadcastOp::getSpeculatability() {
   return getGenericSpeculatabilityImpl(cast<LinalgOp>(getOperation()));
 }
 
+/// Fold broadcast with broadcast.
+struct FoldBroadcastWithBroadcast : OpRewritePattern<linalg::BroadcastOp> {
----------------
rengolin wrote:

Nit: I'd call it `FoldBroadcasts` (plural). The redundancy doesn't help understanding.

I'd also describe the comment with "fold back-to-back broadcasts together".

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


More information about the Mlir-commits mailing list