diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td @@ -263,6 +263,18 @@ SmallVector getMixedHighPad() { return getMixedPadImpl(static_high(), high()); } + // Return true if low padding is guaranteed to be 0. + bool hasZeroLowPad() { + return llvm::all_of(getMixedLowPad(), [](OpFoldResult ofr) { + return mlir::isEqualConstantInt(ofr, 0); + }); + } + // Return true if high padding is guaranteed to be 0. + bool hasZeroHighPad() { + return llvm::all_of(getMixedHighPad(), [](OpFoldResult ofr) { + return mlir::isEqualConstantInt(ofr, 0); + }); + } }]; let builders = [