diff --git a/mlir/lib/Linalg/Transforms/Tiling.cpp b/mlir/lib/Linalg/Transforms/Tiling.cpp index 4ceeed1f1199..1a8cb6506903 100644 --- a/mlir/lib/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Linalg/Transforms/Tiling.cpp @@ -505,6 +505,7 @@ static void tileLinalgOps(FuncOp f, ArrayRef tileSizes, namespace { struct LinalgTilingPass : public FunctionPass { + LinalgTilingPass() = default; LinalgTilingPass(ArrayRef sizes, bool promoteViews); void runOnFunction() { @@ -513,13 +514,6 @@ struct LinalgTilingPass : public FunctionPass { SmallVector tileSizes; bool promoteViews; - -protected: - LinalgTilingPass() {} -}; - -struct LinalgTilingPassCLI : public LinalgTilingPass { - LinalgTilingPassCLI(); }; } // namespace @@ -528,16 +522,16 @@ LinalgTilingPass::LinalgTilingPass(ArrayRef sizes, bool promoteViews) { this->promoteViews = promoteViews; } -LinalgTilingPassCLI::LinalgTilingPassCLI() : LinalgTilingPass() { - this->tileSizes.assign(clTileSizes.begin(), clTileSizes.end()); - this->promoteViews = clPromoteFullTileViews; -} - FunctionPassBase * mlir::linalg::createLinalgTilingPass(ArrayRef tileSizes, bool promoteViews) { return new LinalgTilingPass(tileSizes, promoteViews); } -static PassRegistration - pass("linalg-tile", "Tile operations in the linalg dialect"); +static PassRegistration + pass("linalg-tile", "Tile operations in the linalg dialect", [] { + auto *pass = new LinalgTilingPass(); + pass->tileSizes.assign(clTileSizes.begin(), clTileSizes.end()); + pass->promoteViews = clPromoteFullTileViews; + return pass; + });