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,8 @@ namespace mlir { class MLIRContext; +class ModuleOp; +template class OpPassBase; class LinalgTypeConverter : public LLVMTypeConverter { public: @@ -25,6 +27,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 @@ -594,8 +594,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 @@ -360,7 +360,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 @@ -562,8 +562,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>(); } @@ -572,7 +571,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 @@ -238,7 +238,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 @@ -457,7 +457,7 @@ } std::unique_ptr> -mlir::linalg::createLinalgTilingPass(ArrayRef tileSizes) { +mlir::createLinalgTilingPass(ArrayRef tileSizes) { return std::make_unique(tileSizes); }