From a1c3914ea9421aa6bfad8b9ccf1961e6cd4443ba Mon Sep 17 00:00:00 2001 From: Jeremy Kun Date: Wed, 13 Nov 2024 07:08:00 -0800 Subject: [PATCH] Add mlir-query bazel rules --- .../llvm-project-overlay/mlir/BUILD.bazel | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel index 2543ed8113f37..8507cde619654 100644 --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -14028,6 +14028,64 @@ cc_binary( ], ) +cc_library( + name = "MlirQueryUtils", + srcs = glob( + [ + "lib/Query/Matcher/*.cpp", + "lib/Query/Matcher/*.h", + "lib/Query/*.cpp", + "lib/Query/*.h", + ], + ), + hdrs = glob( + [ + "include/mlir/Query/Matcher/*.h", + "include/mlir/Query/*.h", + ], + ), + includes = ["include"], + deps = [ + ":IR", + ":Reducer", + ":Rewrite", + ":FuncDialect", + "//llvm:LineEditor", + "//llvm:Support", + ], +) + +cc_library( + name = "MlirQueryLib", + srcs = ["lib/Tools/mlir-query/MlirQueryMain.cpp"], + hdrs = ["include/mlir/Tools/mlir-query/MlirQueryMain.h"], + includes = ["include"], + deps = [ + ":IR", + ":MlirQueryUtils", + ":Parser", + ":Support", + "//llvm:LineEditor", + "//llvm:Support", + ], +) + +cc_binary( + name = "mlir-query", + srcs = ["tools/mlir-query/mlir-query.cpp"], + includes = ["include"], + local_defines = ["MLIR_INCLUDE_TESTS"], + stamp = 0, + deps = [ + ":AllPassesAndDialects", + ":MlirQueryLib", + ":MlirQueryUtils", + ":IR", + "//llvm:Support", + "//mlir/test:TestDialect", + ], +) + cc_library( name = "PDLLODS", srcs = glob(