[Mlir-commits] [mlir] [mlir][tensor] Make tensor::PadOp a ReifyRankedShapedTypeOpInterface … (PR #145732)
Fabian Mora
llvmlistbot at llvm.org
Wed Jun 25 09:46:05 PDT 2025
================
@@ -3791,13 +3792,78 @@ struct FoldConsecutiveConstantPadding : public OpRewritePattern<tensor::PadOp> {
}
};
+struct FoldReifiedShape : public OpRewritePattern<tensor::PadOp> {
+ using OpRewritePattern<tensor::PadOp>::OpRewritePattern;
+
+ LogicalResult matchAndRewrite(tensor::PadOp padOp,
+ PatternRewriter &rewriter) const override {
+ if (padOp.getNofold()) {
+ return rewriter.notifyMatchFailure(padOp, "skipping unfoldable pad");
+ }
----------------
fabianmcg wrote:
NIT:
```suggestion
if (padOp.getNofold())
return rewriter.notifyMatchFailure(padOp, "skipping unfoldable pad");
```
https://github.com/llvm/llvm-project/pull/145732
More information about the Mlir-commits
mailing list