diff --git a/mlir/include/mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h b/mlir/include/mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h --- a/mlir/include/mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h +++ b/mlir/include/mlir/Conversion/LinalgToLLVM/LinalgToLLVM.h @@ -13,6 +13,9 @@ namespace mlir { class MLIRContext; +class ModuleOp; +template +class OpPassBase; class LinalgTypeConverter : public LLVMTypeConverter { public: @@ -25,6 +28,9 @@ OwningRewritePatternList &patterns, MLIRContext *ctx); +/// Create a pass to convert Linalg operations to the LLVMIR dialect. +std::unique_ptr> createConvertLinalgToLLVMPass(); + } // namespace mlir #endif // MLIR_CONVERSION_LINALGTOLLVM_LINALGTOLLVM_H_ diff --git a/mlir/include/mlir/Dialect/Linalg/Passes.h b/mlir/include/mlir/Dialect/Linalg/Passes.h --- a/mlir/include/mlir/Dialect/Linalg/Passes.h +++ b/mlir/include/mlir/Dialect/Linalg/Passes.h @@ -21,7 +21,6 @@ class ModuleOp; template class OpPassBase; -namespace linalg { std::unique_ptr> createLinalgFusionPass(); std::unique_ptr> @@ -39,10 +38,6 @@ /// Placeholder for now, this is NYI. std::unique_ptr> createConvertLinalgToAffineLoopsPass(); -/// Create a pass to convert Linalg operations to the LLVMIR dialect. -std::unique_ptr> createConvertLinalgToLLVMPass(); - -} // namespace linalg } // namespace mlir #endif // MLIR_DIALECT_LINALG_PASSES_H_ diff --git a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp --- a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp +++ b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp @@ -588,8 +588,7 @@ signalPassFailure(); } -std::unique_ptr> -mlir::linalg::createConvertLinalgToLLVMPass() { +std::unique_ptr> mlir::createConvertLinalgToLLVMPass() { return std::make_unique(); } diff --git a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp @@ -337,7 +337,7 @@ }; } // namespace -std::unique_ptr> mlir::linalg::createLinalgFusionPass() { +std::unique_ptr> mlir::createLinalgFusionPass() { return std::make_unique(); } diff --git a/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp b/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp @@ -540,8 +540,7 @@ /// Create a pass to convert Linalg operations to loop.for loops and /// std.load/std.store accesses. -std::unique_ptr> -mlir::linalg::createConvertLinalgToLoopsPass() { +std::unique_ptr> mlir::createConvertLinalgToLoopsPass() { return std::make_unique< LowerLinalgToLoopsPass>(); } @@ -550,7 +549,7 @@ /// affine_load/affine_store accesses. /// Placeholder for now, this is NYI. std::unique_ptr> -mlir::linalg::createConvertLinalgToAffineLoopsPass() { +mlir::createConvertLinalgToAffineLoopsPass() { return std::make_unique< LowerLinalgToLoopsPass>(); } diff --git a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp @@ -233,7 +233,7 @@ } // namespace std::unique_ptr> -mlir::linalg::createLinalgPromotionPass(bool dynamicBuffers) { +mlir::createLinalgPromotionPass(bool dynamicBuffers) { return std::make_unique(dynamicBuffers); } diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp @@ -449,7 +449,7 @@ } std::unique_ptr> -mlir::linalg::createLinalgTilingPass(ArrayRef tileSizes) { +mlir::createLinalgTilingPass(ArrayRef tileSizes) { return std::make_unique(tileSizes); }