diff --git a/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.h b/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.h deleted file mode 100644 --- a/mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.h +++ /dev/null @@ -1,27 +0,0 @@ -//===- VectorInterfaceImpl.h - Vector Impl. of BufferizableOpInterface ----===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef MLIR_DIALECT_LINALG_COMPREHENSIVEBUFFERIZE_VECTORINTERFACEIMPL_H -#define MLIR_DIALECT_LINALG_COMPREHENSIVEBUFFERIZE_VECTORINTERFACEIMPL_H - -namespace mlir { - -class DialectRegistry; - -namespace linalg { -namespace comprehensive_bufferize { -namespace vector_ext { - -void registerBufferizableOpInterfaceExternalModels(DialectRegistry ®istry); - -} // namespace vector_ext -} // namespace comprehensive_bufferize -} // namespace linalg -} // namespace mlir - -#endif // MLIR_DIALECT_LINALG_COMPREHENSIVEBUFFERIZE_VECTORINTERFACEIMPL_H diff --git a/mlir/include/mlir/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.h b/mlir/include/mlir/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.h new file mode 100644 --- /dev/null +++ b/mlir/include/mlir/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.h @@ -0,0 +1,21 @@ +//===- BufferizableOpInterfaceImpl.h - Impl. of BufferizableOpInterface ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef MLIR_DIALECT_VECTOR_BUFFERIZABLEOPINTERFACEIMPL_H +#define MLIR_DIALECT_VECTOR_BUFFERIZABLEOPINTERFACEIMPL_H + +namespace mlir { + +class DialectRegistry; + +namespace vector { +void registerBufferizableOpInterfaceExternalModels(DialectRegistry ®istry); +} // namespace vector +} // namespace mlir + +#endif // MLIR_DIALECT_VECTOR_BUFFERIZABLEOPINTERFACEIMPL_H diff --git a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/CMakeLists.txt b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/CMakeLists.txt @@ -44,15 +44,6 @@ MLIRStandard ) -add_mlir_dialect_library(MLIRVectorBufferizableOpInterfaceImpl - VectorInterfaceImpl.cpp - - LINK_LIBS PUBLIC - MLIRBufferization - MLIRIR - MLIRVector -) - add_mlir_dialect_library(MLIRModuleBufferization ModuleBufferization.cpp diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt --- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt @@ -60,7 +60,6 @@ MLIRTransforms MLIRTransformUtils MLIRVector - MLIRVectorBufferizableOpInterfaceImpl MLIRVectorTransforms MLIRVectorUtils MLIRX86VectorTransforms diff --git a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp @@ -17,9 +17,9 @@ #include "mlir/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.h" #include "mlir/Dialect/Linalg/ComprehensiveBufferize/SCFInterfaceImpl.h" #include "mlir/Dialect/Linalg/ComprehensiveBufferize/StdInterfaceImpl.h" -#include "mlir/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.h" #include "mlir/Dialect/Linalg/Passes.h" #include "mlir/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.h" +#include "mlir/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassManager.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" @@ -58,7 +58,7 @@ std_ext::registerModuleBufferizationExternalModels(registry); std_ext::registerBufferizableOpInterfaceExternalModels(registry); tensor::registerBufferizableOpInterfaceExternalModels(registry); - vector_ext::registerBufferizableOpInterfaceExternalModels(registry); + vector::registerBufferizableOpInterfaceExternalModels(registry); } }; } // namespace diff --git a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.cpp b/mlir/lib/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.cpp rename from mlir/lib/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.cpp rename to mlir/lib/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.cpp --- a/mlir/lib/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.cpp +++ b/mlir/lib/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.cpp @@ -1,4 +1,4 @@ -//===- VectorInterfaceImpl.cpp - Vector Impl. of BufferizableOpInterface --===// +//===- BufferizableOpInterfaceImpl.cpp - Impl. of BufferizableOpInterface -===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,18 +6,20 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.h" +#include "mlir/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.h" + #include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" #include "mlir/IR/Dialect.h" #include "mlir/IR/Operation.h" +using namespace mlir; using namespace mlir::bufferization; +using namespace mlir::vector; namespace mlir { -namespace linalg { -namespace comprehensive_bufferize { -namespace vector_ext { +namespace vector { +namespace { /// Bufferization of vector.transfer_read. Replaced with a new /// vector.transfer_read that operates on a memref. @@ -113,15 +115,12 @@ } }; -} // namespace vector_ext -} // namespace comprehensive_bufferize -} // namespace linalg +} // namespace +} // namespace vector } // namespace mlir -void mlir::linalg::comprehensive_bufferize::vector_ext:: - registerBufferizableOpInterfaceExternalModels(DialectRegistry ®istry) { - registry.addOpInterface(); - registry.addOpInterface(); +void mlir::vector::registerBufferizableOpInterfaceExternalModels( + DialectRegistry ®istry) { + registry.addOpInterface(); + registry.addOpInterface(); } diff --git a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt --- a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt +++ b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt @@ -1,4 +1,5 @@ add_mlir_dialect_library(MLIRVectorTransforms + BufferizableOpInterfaceImpl.cpp VectorDropLeadUnitDim.cpp VectorInsertExtractStridedSliceRewritePatterns.cpp VectorMultiDimReductionTransforms.cpp @@ -16,6 +17,7 @@ MLIRAffineAnalysis MLIRAffineUtils MLIRArithmetic + MLIRBufferization MLIRDialectUtils MLIRIR MLIRLinalg diff --git a/mlir/test/lib/Dialect/Linalg/CMakeLists.txt b/mlir/test/lib/Dialect/Linalg/CMakeLists.txt --- a/mlir/test/lib/Dialect/Linalg/CMakeLists.txt +++ b/mlir/test/lib/Dialect/Linalg/CMakeLists.txt @@ -33,6 +33,6 @@ MLIRTensorTransforms MLIRTransformUtils MLIRVector - MLIRVectorBufferizableOpInterfaceImpl MLIRVectorToSCF + MLIRVectorTransforms ) diff --git a/mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp b/mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp --- a/mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestComprehensiveBufferize.cpp @@ -20,12 +20,12 @@ #include "mlir/Dialect/Linalg/ComprehensiveBufferize/LinalgInterfaceImpl.h" #include "mlir/Dialect/Linalg/ComprehensiveBufferize/SCFInterfaceImpl.h" #include "mlir/Dialect/Linalg/ComprehensiveBufferize/StdInterfaceImpl.h" -#include "mlir/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/Passes.h" #include "mlir/Dialect/StandardOps/IR/Ops.h" #include "mlir/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" +#include "mlir/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Pass/PassManager.h" #include "mlir/Transforms/Passes.h" @@ -64,7 +64,7 @@ scf_ext::registerBufferizableOpInterfaceExternalModels(registry); std_ext::registerBufferizableOpInterfaceExternalModels(registry); tensor::registerBufferizableOpInterfaceExternalModels(registry); - vector_ext::registerBufferizableOpInterfaceExternalModels(registry); + vector::registerBufferizableOpInterfaceExternalModels(registry); } void runOnOperation() override; diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -2813,6 +2813,7 @@ ":AffineAnalysis", ":Analysis", ":ArithmeticDialect", + ":BufferizationDialect", ":DialectUtils", ":IR", ":LinalgOps", @@ -6727,24 +6728,6 @@ ], ) -cc_library( - name = "VectorBufferizableOpInterfaceImpl", - srcs = [ - "lib/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.cpp", - ], - hdrs = [ - "include/mlir/Dialect/Linalg/ComprehensiveBufferize/VectorInterfaceImpl.h", - ], - includes = ["include"], - deps = [ - ":BufferizationDialect", - ":IR", - ":Support", - ":VectorOps", - "//llvm:Support", - ], -) - td_library( name = "LinalgDocTdFiles", srcs = ["include/mlir/Dialect/Linalg/IR/LinalgDoc.td"], @@ -6974,7 +6957,6 @@ ":TensorTransforms", ":TensorUtils", ":TransformUtils", - ":VectorBufferizableOpInterfaceImpl", ":VectorOps", ":VectorToSCF", ":VectorTransforms", diff --git a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel @@ -409,9 +409,9 @@ "//mlir:TensorDialect", "//mlir:TensorTransforms", "//mlir:TransformUtils", - "//mlir:VectorBufferizableOpInterfaceImpl", "//mlir:VectorOps", "//mlir:VectorToSCF", + "//mlir:VectorTransforms", ], )