diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp --- a/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp @@ -93,9 +93,6 @@ *this, "test-tile-scalarize-dynamic-dims", llvm::cl::desc("Test tiling of dynamic dims by 1"), llvm::cl::init(false)}; - Option testPadPattern{*this, "test-pad-pattern", - llvm::cl::desc("Test pad pattern"), - llvm::cl::init(false)}; Option testTransformPadTensor{ *this, "test-transform-pad-tensor", llvm::cl::desc("Test transform pad tensor by copying with generic ops"), @@ -109,14 +106,6 @@ llvm::cl::desc("Test rewrite of subtensor(pad_tensor) into " "pad_tensor(subtensor)"), llvm::cl::init(false)}; - ListOption packPaddings{ - *this, "pack-paddings", - llvm::cl::desc("Operand packing flags when test-pad-pattern"), - llvm::cl::ZeroOrMore, llvm::cl::MiscFlags::CommaSeparated}; - ListOption hoistPaddings{ - *this, "hoist-paddings", - llvm::cl::desc("Operand hoisting depths when test-pad-pattern"), - llvm::cl::ZeroOrMore, llvm::cl::MiscFlags::CommaSeparated}; ListOption peeledLoops{ *this, "peeled-loops", llvm::cl::desc("Loops to be peeled when test-tile-pattern"), @@ -631,30 +620,6 @@ (void)applyPatternsAndFoldGreedily(funcOp, std::move(tilingPattern)); } -static void applyPadPattern(FuncOp funcOp, ArrayRef packPaddings, - ArrayRef hoistPaddings) { - MLIRContext *context = funcOp.getContext(); - RewritePatternSet padPattern(context); - auto linalgPaddingOptions = linalg::LinalgPaddingOptions(); - auto packFunc = [&](OpOperand &opOperand) { - return opOperand.getOperandNumber() < packPaddings.size() - ? packPaddings[opOperand.getOperandNumber()] - : false; - }; - auto hoistingFunc = [&](OpOperand &opOperand) { - return opOperand.getOperandNumber() < hoistPaddings.size() - ? hoistPaddings[opOperand.getOperandNumber()] - : 0; - }; - linalgPaddingOptions.setPaddingValueComputationFunction(getNeutralOfLinalgOp); - linalgPaddingOptions.setPaddingNoFoldComputationFunction(packFunc); - linalgPaddingOptions.setPaddingHoistComputationFunction(hoistingFunc); - padPattern.add( - context, linalgPaddingOptions, - LinalgTransformationFilter(Identifier::get("pad", context))); - (void)applyPatternsAndFoldGreedily(funcOp, std::move(padPattern)); -} - static void applyInterchangePattern(FuncOp funcOp, ArrayRef interchangeVector) { MLIRContext *context = funcOp.getContext(); @@ -785,8 +750,6 @@ if (testTileScalarizeDynamicDims) return applyTilePattern(getFunction(), loopType, tileSizes, /*peeledLoops=*/{}, /*scalarizeDynamicDims=*/true); - if (testPadPattern) - return applyPadPattern(getFunction(), packPaddings, hoistPaddings); if (testInterchangePattern.hasValue()) return applyInterchangePattern(getFunction(), testInterchangePattern); if (testDecomposeConvolutionPattern)