[Mlir-commits] [mlir] [mlir] Add reshape propagation patterns for tensor.pad (PR #94489)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Jun 6 09:32:22 PDT 2024


================
@@ -1937,6 +2069,8 @@ void mlir::linalg::populateFoldReshapeOpsByExpansionPatterns(
     const ControlFusionFn &controlFoldingReshapes) {
   patterns.add<FoldReshapeWithGenericOpByExpansion>(patterns.getContext(),
                                                     controlFoldingReshapes);
+  patterns.add<FoldPadWithProducerReshapeOpByExpansion>(patterns.getContext(),
----------------
Max191 wrote:

`FoldPadWithProducerReshapeOpByExpansion` pushes the producer collapse_shape down, expanding the pad. `FoldPadWithProducerReshapeOpByCollapsing` pushes the producer expand_shape down, collapsing the pad. I think these are in the right places here.

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


More information about the Mlir-commits mailing list