diff options
Diffstat (limited to 'utils/bazel')
44 files changed, 1009 insertions, 314 deletions
diff --git a/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel b/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel index 97c25bc..167447d 100644 --- a/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") load(":targets.bzl", "bolt_targets") package( diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel index cd76d1f..f779be1 100644 --- a/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel @@ -160,6 +160,7 @@ clang_tidy_library( ":readability", ":utils", "//clang:tooling", + "//clang:transformer", ], ) diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel index 2ec99aa..4151e55 100644 --- a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel @@ -2,6 +2,8 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_library") + package( default_visibility = ["//visibility:public"], features = ["layering_check"], diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel index e34fbe5..6f1f5b8 100644 --- a/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception load("@bazel_skylib//rules:expand_template.bzl", "expand_template") -load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") load("//llvm:lit_test.bzl", "lit_test", "package_path") package( diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel index c169529..62bac74 100644 --- a/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception load("@bazel_skylib//rules:expand_template.bzl", "expand_template") -load("@rules_cc//cc:defs.bzl", "cc_test") +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") package( default_visibility = ["//visibility:public"], diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel index 3598944..64f86c4 100644 --- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel @@ -2,6 +2,7 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") load("@rules_python//python:defs.bzl", "py_binary") load( "//:vars.bzl", @@ -1892,6 +1893,29 @@ cc_library( ) cc_library( + name = "directory_watcher", + srcs = glob([ + "lib/DirectoryWatcher/*.cpp", + "lib/DirectoryWatcher/*.h", + ]) + select({ + "@platforms//os:windows": glob(["lib/DirectoryWatcher/windows/*.cpp"]), + "@platforms//os:macos": glob(["lib/DirectoryWatcher/mac/*.cpp"]), + "@platforms//os:linux": glob(["lib/DirectoryWatcher/linux/*.cpp"]), + "//conditions:default": glob(["lib/DirectoryWatcher/default/*.cpp"]), + }), + hdrs = glob([ + "include/clang/DirectoryWatcher/*.h", + ]), + includes = [ + "include", + "lib/DirectoryWatcher", + ], + deps = [ + "//llvm:Support", + ], +) + +cc_library( name = "install_api", srcs = glob([ "lib/InstallAPI/*.cpp", diff --git a/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel index a72fa30..cd66c1f 100644 --- a/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel @@ -2,9 +2,9 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -package( - default_visibility = ["//visibility:public"], -) +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + +package(default_visibility = ["//visibility:public"]) licenses(["notice"]) @@ -96,6 +96,37 @@ cc_test( ], ) +cc_library( + name = "dataflow_testing_support", + testonly = 1, + srcs = ["Analysis/FlowSensitive/TestingSupport.cpp"], + hdrs = ["Analysis/FlowSensitive/TestingSupport.h"], + deps = [ + "//clang:analysis", + "//clang:ast", + "//clang:ast_matchers", + "//clang:basic", + "//clang:lex", + "//clang:serialization", + "//clang:tooling", + "//llvm:Support", + "//llvm:TestingAnnotations", + "//third-party/unittest:gtest", + ], +) + +cc_library( + name = "dataflow_solver_test", + testonly = 1, + hdrs = ["Analysis/FlowSensitive/SolverTest.h"], + deps = [ + ":dataflow_testing_support", + "//clang:analysis", + "//third-party/unittest:gmock", + "//third-party/unittest:gtest", + ], +) + cc_test( name = "analysis_tests", size = "small", @@ -205,7 +236,6 @@ cc_test( [ "Format/*.cpp", "Format/*.h", - "Tooling/*.h", ], allow_empty = False, ), @@ -213,10 +243,10 @@ cc_test( features = ["-layering_check"], # #include "../../lib/Format/TokenAnalyzer.h" shard_count = 20, deps = [ + ":tooling_tests_hdrs", "//clang:basic", "//clang:format", "//clang:frontend", - "//clang:rewrite", "//clang:tooling_core", "//llvm:Support", "//third-party/unittest:gmock", @@ -280,28 +310,6 @@ cc_test( ], ) -# A library to carefully expose the tooling headers using the include prefix -# expected by the `rename_tests`. -cc_library( - name = "rename_tests_tooling_hdrs", - testonly = 1, - hdrs = glob( - ["Tooling/*.h"], - allow_empty = False, - ), - include_prefix = "unittests", - deps = [ - "//clang:ast", - "//clang:basic", - "//clang:frontend", - "//clang:rewrite", - "//clang:tooling", - "//clang:tooling_core", - "//llvm:Support", - "//third-party/unittest:gtest", - ], -) - cc_test( name = "rewrite_tests", size = "small", @@ -349,12 +357,12 @@ cc_library( allow_empty = False, ), deps = [ + "//clang:analysis", "//clang:ast_matchers", "//clang:crosstu", "//clang:frontend", "//clang:static_analyzer_core", "//clang:static_analyzer_frontend", - "//clang:testing", "//clang:tooling", "//third-party/unittest:gtest", ], @@ -389,18 +397,35 @@ cc_test( ], ) +cc_library( + name = "tooling_tests_hdrs", + testonly = 1, + hdrs = glob( + ["Tooling/*.h"], + allow_empty = False, + ), + deps = [ + "//clang:ast", + "//clang:basic", + "//clang:frontend", + "//clang:rewrite", + "//clang:tooling", + "//clang:tooling_core", + "//llvm:Support", + "//third-party/unittest:gtest", + ], +) + cc_test( name = "tooling_tests", size = "medium", srcs = glob( - [ - "Tooling/*.cpp", - "Tooling/*.h", - ], + ["Tooling/*.cpp"], allow_empty = False, ), shard_count = 20, deps = [ + ":tooling_tests_hdrs", "//clang:ast", "//clang:ast_matchers", "//clang:basic", @@ -528,3 +553,193 @@ cc_test( "//third-party/unittest:gtest_main", ], ) + +cc_test( + name = "crosstu_tests", + size = "small", + srcs = glob( + ["CrossTU/*.cpp"], + allow_empty = False, + ), + deps = [ + "//clang:ast", + "//clang:crosstu", + "//clang:frontend", + "//clang:tooling", + "//llvm:Support", + "//third-party/unittest:gtest", + "//third-party/unittest:gtest_main", + ], +) + +cc_test( + name = "driver_tests", + size = "small", + srcs = glob( + [ + "Driver/*.cpp", + "Driver/*.h", + ], + allow_empty = False, + exclude = [ + "Driver/GCCVersionTest.cpp", # Includes private headers + ], + ), + deps = [ + "//clang:basic", + "//clang:driver", + "//clang:frontend", + "//llvm:FrontendDebug", + "//llvm:MC", + "//llvm:Support", + "//llvm:TargetParser", + "//third-party/unittest:gmock", + "//third-party/unittest:gtest", + "//third-party/unittest:gtest_main", + ], +) + +cc_test( + name = "parse_tests", + size = "small", + srcs = glob( + ["Parse/*.cpp"], + allow_empty = False, + ), + deps = [ + "//clang:ast", + "//clang:basic", + "//clang:lex", + "//clang:parse", + "//third-party/unittest:gtest", + "//third-party/unittest:gtest_main", + ], +) + +cc_test( + name = "directory_watcher_tests", + size = "small", + srcs = glob( + ["DirectoryWatcher/*.cpp"], + allow_empty = False, + ), + deps = [ + "//clang:directory_watcher", + "//llvm:Support", + "//llvm:TestingSupport", + "//third-party/unittest:gtest", + "//third-party/unittest:gtest_main", + ], +) + +cc_test( + name = "index_tests", + size = "small", + srcs = glob( + ["Index/*.cpp"], + allow_empty = False, + ), + deps = [ + "//clang:ast", + "//clang:basic", + "//clang:frontend", + "//clang:index", + "//clang:lex", + "//clang:tooling", + "//llvm:Support", + "//third-party/unittest:gmock", + "//third-party/unittest:gtest", + "//third-party/unittest:gtest_main", + ], +) + +cc_test( + name = "install_api_tests", + size = "small", + srcs = glob( + ["InstallAPI/*.cpp"], + allow_empty = False, + ), + deps = [ + "//clang:install_api", + "//llvm:Support", + "//llvm:TestingSupport", + "//third-party/unittest:gtest", + "//third-party/unittest:gtest_main", + ], +) + +cc_test( + name = "interpreter_tests", + size = "small", + srcs = glob( + [ + "Interpreter/*.cpp", + "Interpreter/*.h", + ], + allow_empty = False, + ), + args = [ + # TODO: some tests fail with: "JIT session error: Symbols not found: + # [ _ZnwmPv26__clang_Interpreter_NewTag, __clang_Interpreter_SetValueWithAlloc ] + "--gtest_filter=-InterpreterTest.*", + ], + deps = [ + "//clang:ast", + "//clang:basic", + "//clang:codegen", + "//clang:frontend", + "//clang:interpreter", + "//clang:lex", + "//clang:parse", + "//clang:sema", + "//llvm:LineEditor", + "//llvm:MC", + "//llvm:OrcJIT", + "//llvm:OrcShared", + "//llvm:Support", + "//llvm:TargetParser", + "//llvm:TestingSupport", + "//llvm:ir_headers", + "//third-party/unittest:gmock", + "//third-party/unittest:gtest", + "//third-party/unittest:gtest_main", + ], +) + +cc_test( + name = "serialization_tests", + size = "small", + srcs = glob( + ["Serialization/*.cpp"], + allow_empty = False, + ), + deps = [ + "//clang:ast_matchers", + "//clang:basic", + "//clang:frontend", + "//clang:lex", + "//clang:parse", + "//clang:serialization", + "//clang:tooling", + "//llvm:Support", + "//third-party/unittest:gtest", + "//third-party/unittest:gtest_main", + ], +) + +cc_test( + name = "support_tests", + size = "small", + srcs = glob( + ["Support/*.cpp"], + allow_empty = False, + ), + deps = [ + "//clang:frontend", + "//clang:lex", + "//llvm:Support", + "//third-party/unittest:gtest", + "//third-party/unittest:gtest_main", + ], +) diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel index bcf947a..f34d56d 100644 --- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel @@ -2,6 +2,8 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_library") + package( default_visibility = ["//visibility:public"], features = ["layering_check"], diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/lib/orc/tests/unit/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/lib/orc/tests/unit/BUILD.bazel index 520bf2a..e3233a1 100644 --- a/utils/bazel/llvm-project-overlay/compiler-rt/lib/orc/tests/unit/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/compiler-rt/lib/orc/tests/unit/BUILD.bazel @@ -2,6 +2,8 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_test") + package( default_visibility = ["//visibility:public"], features = ["layering_check"], diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel index eb6afed..a1d5afd 100644 --- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel @@ -19,6 +19,7 @@ load(":platforms.bzl", "PLATFORM_CPU_ARM64", "PLATFORM_CPU_X86_64") package( default_visibility = ["//visibility:public"], features = [ + "parse_headers", "-use_header_modules", "-layering_check", ], @@ -158,6 +159,7 @@ libc_support_library( hdrs = ["include/llvm-libc-types/float128.h"], target_compatible_with = select({ "@platforms//os:linux": [], + "@platforms//os:windows": [], "//conditions:default": ["@platforms//:incompatible"], }), deps = [":llvm_libc_macros_float_macros"], @@ -550,7 +552,6 @@ libc_support_library( deps = [ ":__support_macros_config", ":__support_macros_optimization", - ":__support_macros_sanitizer", ], ) @@ -2038,19 +2039,6 @@ libc_support_library( ) libc_support_library( - name = "atan_utils", - hdrs = ["src/math/generic/atan_utils.h"], - deps = [ - ":__support_fputil_double_double", - ":__support_fputil_dyadic_float", - ":__support_fputil_multiply_add", - ":__support_fputil_polyeval", - ":__support_integer_literals", - ":__support_macros_optimization", - ], -) - -libc_support_library( name = "log_range_reduction", hdrs = ["src/math/generic/log_range_reduction.h"], deps = [ @@ -2185,6 +2173,21 @@ libc_support_library( ) libc_support_library( + name = "__support_math_acospif16", + hdrs = ["src/__support/math/acospif16.h"], + deps = [ + ":__support_fputil_cast", + ":__support_fputil_fenv_impl", + ":__support_fputil_fp_bits", + ":__support_fputil_multiply_add", + ":__support_fputil_polyeval", + ":__support_fputil_sqrt", + ":__support_macros_optimization", + ":__support_macros_properties_types", + ], +) + +libc_support_library( name = "__support_math_asin_utils", hdrs = ["src/__support/math/asin_utils.h"], deps = [ @@ -2199,6 +2202,147 @@ libc_support_library( ) libc_support_library( + name = "__support_math_asin", + hdrs = ["src/__support/math/asin.h"], + deps = [ + ":__support_math_asin_utils", + ":__support_fputil_double_double", + ":__support_fputil_dyadic_float", + ":__support_fputil_fenv_impl", + ":__support_fputil_fp_bits", + ":__support_fputil_multiply_add", + ":__support_fputil_polyeval", + ":__support_fputil_sqrt", + ":__support_macros_optimization", + ":__support_macros_properties_cpu_features", + ], +) + +libc_support_library( + name = "__support_math_asinhf", + hdrs = ["src/__support/math/asinhf.h"], + deps = [ + ":__support_math_acoshf_utils", + ":__support_fputil_fp_bits", + ":__support_fputil_polyeval", + ":__support_fputil_multiply_add", + ":__support_fputil_sqrt", + ":__support_macros_config", + ":__support_macros_optimization", + ], +) + +libc_support_library( + name = "__support_math_asinhf16", + hdrs = ["src/__support/math/asinhf16.h"], + deps = [ + ":__support_math_acoshf_utils", + ":__support_fputil_fenv_impl", + ":__support_fputil_fp_bits", + ":__support_fputil_polyeval", + ":__support_fputil_cast", + ":__support_fputil_except_value_utils", + ":__support_fputil_multiply_add", + ":__support_fputil_rounding_mode", + ":__support_fputil_sqrt", + ":__support_macros_config", + ":__support_macros_optimization", + ], +) + +libc_support_library( + name = "__support_math_atan_utils", + hdrs = ["src/__support/math/atan_utils.h"], + deps = [ + ":__support_fputil_double_double", + ":__support_fputil_dyadic_float", + ":__support_fputil_multiply_add", + ":__support_fputil_polyeval", + ":__support_integer_literals", + ":__support_macros_optimization", + ], +) + +libc_support_library( + name = "__support_math_atan", + hdrs = ["src/__support/math/atan.h"], + deps = [ + ":__support_fputil_double_double", + ":__support_fputil_nearest_integer", + ":__support_macros_optimization", + ":__support_math_atan_utils", + ], +) + +libc_support_library( + name = "__support_math_atan2", + hdrs = ["src/__support/math/atan2.h"], + deps = [ + ":__support_fputil_double_double", + ":__support_fputil_nearest_integer", + ":__support_math_atan_utils", + ], +) + +libc_support_library( + name = "__support_math_atanf", + hdrs = ["src/__support/math/atanf.h"], + deps = [ + ":__support_fputil_except_value_utils", + ":__support_fputil_multiply_add", + ":__support_fputil_nearest_integer", + ":__support_fputil_polyeval", + ":__support_fputil_rounding_mode", + ":__support_macros_optimization", + ":__support_math_inv_trigf_utils", + ], +) + +libc_support_library( + name = "__support_math_atanf16", + hdrs = ["src/__support/math/atanf16.h"], + deps = [ + ":__support_fputil_cast", + ":__support_fputil_except_value_utils", + ":__support_fputil_fenv_impl", + ":__support_fputil_fp_bits", + ":__support_fputil_polyeval", + ":__support_fputil_multiply_add", + ":__support_fputil_sqrt", + ":__support_macros_optimization", + ], +) + +libc_support_library( + name = "__support_math_asinf", + hdrs = ["src/__support/math/asinf.h"], + deps = [ + ":__support_math_inv_trigf_utils", + ":__support_fputil_fenv_impl", + ":__support_fputil_fp_bits", + ":__support_fputil_except_value_utils", + ":__support_fputil_multiply_add", + ":__support_fputil_sqrt", + ":__support_macros_config", + ":__support_macros_optimization", + ":__support_macros_properties_cpu_features", + ], +) + +libc_support_library( + name = "__support_math_asinf16", + hdrs = ["src/__support/math/asinf16.h"], + deps = [ + ":__support_fputil_fenv_impl", + ":__support_fputil_fp_bits", + ":__support_fputil_polyeval", + ":__support_fputil_multiply_add", + ":__support_fputil_sqrt", + ":__support_macros_optimization", + ], +) + +libc_support_library( name = "__support_math_erff", hdrs = ["src/__support/math/erff.h"], deps = [ @@ -2736,67 +2880,66 @@ libc_math_function( ) libc_math_function( + name = "acospif16", + additional_deps = [ + ":__support_math_acospif16", + ":errno", + ], +) + +libc_math_function( + name = "asin", + additional_deps = [ + ":__support_math_asin", + ], +) + +libc_math_function( name = "asinf", additional_deps = [ - ":__support_fputil_fma", - ":__support_fputil_multiply_add", - ":__support_fputil_nearest_integer", - ":__support_fputil_polyeval", - ":__support_fputil_sqrt", - ":__support_macros_optimization", - ":__support_macros_properties_cpu_features", - ":__support_math_inv_trigf_utils", + ":__support_math_asinf", ], ) libc_math_function( name = "asinf16", additional_deps = [ - ":__support_fputil_cast", - ":__support_fputil_fma", - ":__support_fputil_multiply_add", - ":__support_fputil_nearest_integer", - ":__support_fputil_polyeval", - ":__support_fputil_sqrt", - ":__support_macros_optimization", - ":__support_math_inv_trigf_utils", + ":__support_math_asinf16", ], ) libc_math_function( name = "asinhf", additional_deps = [ - ":__support_fputil_fma", - ":__support_fputil_multiply_add", - ":__support_fputil_nearest_integer", - ":__support_fputil_polyeval", - ":__support_fputil_sqrt", - ":__support_macros_optimization", - ":common_constants", - ":explogxf", + ":__support_math_asinhf", + ], +) + +libc_math_function( + name = "asinhf16", + additional_deps = [ + ":__support_math_asinhf16", ], ) libc_math_function( name = "atanf", additional_deps = [ - ":__support_fputil_fma", - ":__support_fputil_multiply_add", - ":__support_fputil_nearest_integer", - ":__support_fputil_polyeval", - ":__support_fputil_rounding_mode", - ":__support_macros_optimization", - ":__support_math_inv_trigf_utils", + ":__support_math_atanf" + ], +) + +libc_math_function( + name = "atanf16", + additional_deps = [ + ":__support_math_atanf16" ], ) libc_math_function( name = "atan", additional_deps = [ - ":__support_fputil_double_double", - ":__support_fputil_nearest_integer", - ":__support_macros_optimization", - ":atan_utils", + ":__support_math_atan" ], ) @@ -2812,9 +2955,7 @@ libc_math_function( libc_math_function( name = "atan2", additional_deps = [ - ":__support_fputil_double_double", - ":__support_fputil_nearest_integer", - ":atan_utils", + ":__support_math_atan2", ], ) @@ -6182,7 +6323,9 @@ libc_function( deps = [ ":__support_common", ":__support_macros_config", + ":__support_macros_null_check", ":types_wchar_t", + ":wchar_utils", ], ) @@ -6309,6 +6452,7 @@ libc_function( ":__support_common", ":__support_macros_null_check", ":types_wchar_t", + ":wchar_utils", ], ) diff --git a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl index e123e4d..0f296536 100644 --- a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl +++ b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl @@ -6,6 +6,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_skylib//lib:selects.bzl", "selects") +load("@rules_cc//cc:defs.bzl", "cc_library") load(":libc_configure_options.bzl", "LIBC_CONFIGURE_OPTIONS") load(":libc_namespace.bzl", "LIBC_NAMESPACE") load(":platforms.bzl", "PLATFORM_CPU_X86_64") @@ -52,7 +53,7 @@ def _libc_library(name, **kwargs): for attr in ["copts", "local_defines"]: if attr in kwargs: fail("disallowed attribute: '{}' in rule: '{}'".format(attr, name)) - native.cc_library( + cc_library( name = name, copts = libc_common_copts(), local_defines = LIBC_CONFIGURE_OPTIONS, @@ -188,7 +189,7 @@ def libc_release_library( name = name + "_textual_hdrs", libs = libc_functions, ) - native.cc_library( + cc_library( name = name + "_textual_hdr_library", textual_hdrs = [":" + name + "_textual_hdrs"], ) @@ -197,8 +198,7 @@ def libc_release_library( "LLVM_LIBC_FUNCTION_ATTR_" + name + "='LLVM_LIBC_EMPTY, [[gnu::weak]]'" for name in weak_symbols ] - - native.cc_library( + cc_library( name = name, srcs = [":" + name + "_srcs"], copts = libc_common_copts() + libc_release_copts(), @@ -229,12 +229,11 @@ def libc_header_library(name, hdrs, deps = [], **kwargs): name = name + "_textual_hdrs", libs = deps, ) - native.cc_library( + cc_library( name = name + "_textual_hdr_library", textual_hdrs = [":" + name + "_textual_hdrs"], ) - - native.cc_library( + cc_library( name = name, hdrs = hdrs, # We put _hdr_deps in srcs, as they are not a part of this cc_library diff --git a/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl b/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl index 96d7fa8..b49e7c3 100644 --- a/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl +++ b/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl @@ -46,4 +46,7 @@ LIBC_CONFIGURE_OPTIONS = [ # Documentation in libc/src/__support/libc_assert.h # "LIBC_COPT_USE_C_ASSERT", + + # Documentation in libc/docs/configure.rst + "LIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM", ] diff --git a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl index 8cb7821..e35913d 100644 --- a/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl +++ b/utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl @@ -12,6 +12,7 @@ They come in two flavors: When performing tests we make sure to always use the internal version. """ +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") load("//libc:libc_build_rules.bzl", "libc_common_copts") load("//libc:libc_configure_options.bzl", "LIBC_CONFIGURE_OPTIONS") @@ -58,8 +59,7 @@ def libc_test( if full_build: copts = copts + _FULL_BUILD_COPTS - - native.cc_test( + cc_test( name = name, local_defines = local_defines + LIBC_CONFIGURE_OPTIONS, deps = deps, @@ -77,7 +77,7 @@ def libc_test_library(name, copts = [], local_defines = [], **kwargs): local_defines: See cc_library.local_defines. **kwargs: Other attributes relevant to cc_library (e.g. "deps"). """ - native.cc_library( + cc_library( name = name, testonly = True, copts = copts + libc_common_copts(), diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel index b6d6b8f..dbe069f 100644 --- a/utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel @@ -83,7 +83,6 @@ libc_test( ], ) - libc_test( name = "wcslcat_test", srcs = ["wcslcat_test.cpp"], diff --git a/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel index 0db6ce1..79a2096 100644 --- a/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel @@ -4,6 +4,7 @@ # A wrapper library over MPC for use with LLVM libc math unittests. +load("@rules_cc//cc:defs.bzl", "cc_library") load("//libc/test:libc_test_rules.bzl", "libc_test_library") package(default_visibility = ["//visibility:public"]) diff --git a/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel index 64f7837..ff93eb5 100644 --- a/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel @@ -4,6 +4,7 @@ # A wrapper library over MPFR for use with LLVM libc math unittests. +load("@rules_cc//cc:defs.bzl", "cc_library") load("//libc/test:libc_test_rules.bzl", "libc_test_library") package(default_visibility = ["//visibility:public"]) diff --git a/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel b/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel index f8448fb..c9fdc819 100644 --- a/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libunwind/BUILD.bazel @@ -2,6 +2,8 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_library") + package( default_visibility = ["//visibility:public"], ) diff --git a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel index 76957a9..162c4f9 100644 --- a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel @@ -2,6 +2,7 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_library") load( "//:vars.bzl", "LLVM_VERSION", diff --git a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel index 202f224..7aa7be6 100644 --- a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel @@ -6,6 +6,7 @@ load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load("@bazel_skylib//rules:expand_template.bzl", "expand_template") load("@build_bazel_apple_support//rules:apple_genrule.bzl", "apple_genrule") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") load("@rules_python//python:defs.bzl", "py_binary") load("//:vars.bzl", "LLVM_VERSION_MAJOR", "LLVM_VERSION_MINOR", "LLVM_VERSION_PATCH", "LLVM_VERSION_SUFFIX", "PACKAGE_VERSION") load("//lldb/source/Plugins:plugin_config.bzl", "DEFAULT_PLUGINS", "DEFAULT_SCRIPT_PLUGINS", "OBJCPP_COPTS") diff --git a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel index caf609f..e96fc03 100644 --- a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel @@ -2,6 +2,7 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("@rules_cc//cc:defs.bzl", "cc_library") load("//mlir:tblgen.bzl", "gentbl_cc_library") load(":plugin_config.bzl", "DEFAULT_PLUGINS", "DEFAULT_SCRIPT_PLUGINS", "OBJCPP_COPTS") @@ -151,6 +152,7 @@ cc_library( "//clang:lex", "//clang:sema", "//lldb:CoreHeaders", + "//lldb:ExpressionHeaders", "//lldb:Host", "//lldb:SymbolHeaders", "//lldb:TargetHeaders", @@ -334,6 +336,7 @@ cc_library( "//lldb:SymbolHeaders", "//lldb:TargetHeaders", "//lldb:Utility", + "//lldb:UtilityPrivateHeaders", "//llvm:BinaryFormat", "//llvm:DebugInfoDWARF", "//llvm:Demangle", diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel index c2f6c62..5930b85 100644 --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -4,6 +4,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "string_flag") load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") load("@rules_python//python:defs.bzl", "py_binary") load("//mlir:tblgen.bzl", "gentbl_cc_library", "gentbl_filegroup", "td_library") load(":binary_alias.bzl", "binary_alias") @@ -1280,6 +1281,7 @@ cc_library( ":AnalysisFpExc", ":BinaryFormat", ":Core", + ":FrontendHLSL", ":Object", ":ProfileData", ":Support", diff --git a/utils/bazel/llvm-project-overlay/llvm/driver.bzl b/utils/bazel/llvm-project-overlay/llvm/driver.bzl index 66e8af7..39093db 100644 --- a/utils/bazel/llvm-project-overlay/llvm/driver.bzl +++ b/utils/bazel/llvm-project-overlay/llvm/driver.bzl @@ -6,6 +6,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo") load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("@rules_cc//cc:defs.bzl", "cc_binary") # Mapping from every tool to the cc_library that implements the tool's entrypoint. _TOOLS = { @@ -175,7 +176,7 @@ def llvm_driver_cc_binary( template = "//llvm:cmake/modules/llvm-driver-template.cpp.in", ) deps = deps or [] - native.cc_binary( + cc_binary( name = name, srcs = [name + "-driver.cpp"], deps = deps + ["//llvm:Support"], diff --git a/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel index 142b398..c5fe783 100644 --- a/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel @@ -2,6 +2,7 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") load("//mlir:tblgen.bzl", "gentbl_cc_library") package( @@ -132,6 +133,7 @@ cc_test( "//llvm:AsmParser", "//llvm:CodeGen", "//llvm:Core", + "//llvm:FrontendHLSL", "//llvm:Instrumentation", "//llvm:Passes", "//llvm:Support", diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel index 9ec7c51..f00c310 100644 --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -7,6 +7,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") load( ":build_defs.bzl", "cc_headers_only", @@ -1003,6 +1004,9 @@ mlir_c_api_cc_library( ":BuiltinToLLVMIRTranslation", ":IR", ":LLVMToLLVMIRTranslation", + ":RegisterAllDialects", + ":RegisterAllExtensions", + ":RegisterAllPasses", ], ) @@ -1657,6 +1661,7 @@ cc_library( ":AMDGPUPassIncGen", ":AMDGPUUtils", ":AffineDialect", + ":AffineUtils", ":ArithDialect", ":ArithUtils", ":ControlFlowDialect", @@ -3056,14 +3061,14 @@ cc_library( ) ##---------------------------------------------------------------------------## -# Mesh Dialect +# Shard Dialect ##---------------------------------------------------------------------------## td_library( - name = "MeshTdFiles", + name = "ShardTdFiles", srcs = [ - "include/mlir/Dialect/Mesh/IR/MeshBase.td", - "include/mlir/Dialect/Mesh/IR/MeshOps.td", + "include/mlir/Dialect/Shard/IR/ShardBase.td", + "include/mlir/Dialect/Shard/IR/ShardOps.td", ], includes = ["include"], deps = [ @@ -3075,92 +3080,92 @@ td_library( ) gentbl_cc_library( - name = "MeshIncGen", + name = "ShardIncGen", tbl_outs = { - "include/mlir/Dialect/Mesh/IR/MeshOps.h.inc": [ + "include/mlir/Dialect/Shard/IR/ShardOps.h.inc": [ "-gen-op-decls", - "-dialect=mesh", + "-dialect=shard", ], - "include/mlir/Dialect/Mesh/IR/MeshOps.cpp.inc": [ + "include/mlir/Dialect/Shard/IR/ShardOps.cpp.inc": [ "-gen-op-defs", - "-dialect=mesh", + "-dialect=shard", ], - "include/mlir/Dialect/Mesh/IR/MeshDialect.h.inc": [ + "include/mlir/Dialect/Shard/IR/ShardDialect.h.inc": [ "-gen-dialect-decls", - "-dialect=mesh", + "-dialect=shard", ], - "include/mlir/Dialect/Mesh/IR/MeshDialect.cpp.inc": [ + "include/mlir/Dialect/Shard/IR/ShardDialect.cpp.inc": [ "-gen-dialect-defs", - "-dialect=mesh", + "-dialect=shard", ], - "include/mlir/Dialect/Mesh/IR/MeshEnums.h.inc": [ + "include/mlir/Dialect/Shard/IR/ShardEnums.h.inc": [ "-gen-enum-decls", - "-dialect=mesh", + "-dialect=shard", ], - "include/mlir/Dialect/Mesh/IR/MeshEnums.cpp.inc": [ + "include/mlir/Dialect/Shard/IR/ShardEnums.cpp.inc": [ "-gen-enum-defs", - "-dialect=mesh", + "-dialect=shard", ], - "include/mlir/Dialect/Mesh/IR/MeshAttributes.h.inc": [ + "include/mlir/Dialect/Shard/IR/ShardAttributes.h.inc": [ "-gen-attrdef-decls", - "-dialect=mesh", + "-dialect=shard", ], - "include/mlir/Dialect/Mesh/IR/MeshAttributes.cpp.inc": [ + "include/mlir/Dialect/Shard/IR/ShardAttributes.cpp.inc": [ "-gen-attrdef-defs", - "-dialect=mesh", + "-dialect=shard", ], - "include/mlir/Dialect/Mesh/IR/MeshTypes.h.inc": [ + "include/mlir/Dialect/Shard/IR/ShardTypes.h.inc": [ "-gen-typedef-decls", - "-typedefs-dialect=mesh", + "-typedefs-dialect=shard", ], - "include/mlir/Dialect/Mesh/IR/MeshTypes.cpp.inc": [ + "include/mlir/Dialect/Shard/IR/ShardTypes.cpp.inc": [ "-gen-typedef-defs", - "-typedefs-dialect=mesh", + "-typedefs-dialect=shard", ], }, tblgen = ":mlir-tblgen", - td_file = "include/mlir/Dialect/Mesh/IR/MeshOps.td", + td_file = "include/mlir/Dialect/Shard/IR/ShardOps.td", deps = [ - ":MeshTdFiles", ":ShapeOpsTdFiles", + ":ShardTdFiles", ], ) gentbl_cc_library( - name = "MeshShardingInterfaceIncGen", + name = "ShardingInterfaceIncGen", tbl_outs = { - "include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.h.inc": ["-gen-op-interface-decls"], - "include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.cpp.inc": ["-gen-op-interface-defs"], + "include/mlir/Dialect/Shard/Interfaces/ShardingInterface.h.inc": ["-gen-op-interface-decls"], + "include/mlir/Dialect/Shard/Interfaces/ShardingInterface.cpp.inc": ["-gen-op-interface-defs"], }, tblgen = ":mlir-tblgen", - td_file = "include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.td", + td_file = "include/mlir/Dialect/Shard/Interfaces/ShardingInterface.td", deps = [":OpBaseTdFiles"], ) cc_library( - name = "MeshShardingInterface", - srcs = ["lib/Dialect/Mesh/Interfaces/ShardingInterface.cpp"], + name = "ShardingInterface", + srcs = ["lib/Dialect/Shard/Interfaces/ShardingInterface.cpp"], hdrs = [ - "include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.h", - "include/mlir/Dialect/Mesh/Interfaces/ShardingInterfaceImpl.h", + "include/mlir/Dialect/Shard/Interfaces/ShardingInterface.h", + "include/mlir/Dialect/Shard/Interfaces/ShardingInterfaceImpl.h", ], includes = ["include"], deps = [ ":DialectUtils", ":IR", - ":MeshDialect", - ":MeshShardingInterfaceIncGen", + ":ShardDialect", + ":ShardingInterfaceIncGen", ":Support", "//llvm:Support", ], ) cc_library( - name = "MeshDialect", - srcs = ["lib/Dialect/Mesh/IR/MeshOps.cpp"], + name = "ShardDialect", + srcs = ["lib/Dialect/Shard/IR/ShardOps.cpp"], hdrs = [ - "include/mlir/Dialect/Mesh/IR/MeshDialect.h", - "include/mlir/Dialect/Mesh/IR/MeshOps.h", + "include/mlir/Dialect/Shard/IR/ShardDialect.h", + "include/mlir/Dialect/Shard/IR/ShardOps.h", ], includes = ["include"], deps = [ @@ -3171,7 +3176,7 @@ cc_library( ":IR", ":InferTypeOpInterface", ":InliningUtils", - ":MeshIncGen", + ":ShardIncGen", ":SideEffectInterfaces", ":Support", ":ViewLikeInterface", @@ -3180,23 +3185,23 @@ cc_library( ) gentbl_cc_library( - name = "MeshTransformsPassIncGen", - tbl_outs = {"include/mlir/Dialect/Mesh/Transforms/Passes.h.inc": [ + name = "ShardTransformsPassIncGen", + tbl_outs = {"include/mlir/Dialect/Shard/Transforms/Passes.h.inc": [ "-gen-pass-decls", - "-name=Mesh", + "-name=Shard", ]}, tblgen = ":mlir-tblgen", - td_file = "include/mlir/Dialect/Mesh/Transforms/Passes.td", + td_file = "include/mlir/Dialect/Shard/Transforms/Passes.td", deps = [":PassBaseTdFiles"], ) cc_library( - name = "MeshTransforms", + name = "ShardTransforms", srcs = glob([ - "lib/Dialect/Mesh/Transforms/*.cpp", - "lib/Dialect/Mesh/Transforms/*.h", + "lib/Dialect/Shard/Transforms/*.cpp", + "lib/Dialect/Shard/Transforms/*.h", ]), - hdrs = glob(["include/mlir/Dialect/Mesh/Transforms/*.h"]), + hdrs = glob(["include/mlir/Dialect/Shard/Transforms/*.h"]), includes = ["include"], deps = [ ":AffineDialect", @@ -3209,10 +3214,10 @@ cc_library( ":FuncDialect", ":FunctionInterfaces", ":IR", - ":MeshDialect", - ":MeshShardingInterface", - ":MeshTransformsPassIncGen", ":Pass", + ":ShardDialect", + ":ShardTransformsPassIncGen", + ":ShardingInterface", ":Support", ":TensorDialect", ":Transforms", @@ -3221,11 +3226,11 @@ cc_library( ) cc_library( - name = "MeshToMPIConversion", + name = "ShardToMPIConversion", srcs = glob([ - "lib/Conversion/MeshToMPI/*.cpp", + "lib/Conversion/ShardToMPI/*.cpp", ]), - hdrs = glob(["include/mlir/Conversion/MeshToMPI/*.h"]), + hdrs = glob(["include/mlir/Conversion/ShardToMPI/*.h"]), includes = ["include"], deps = [ ":AffineDialect", @@ -3240,10 +3245,10 @@ cc_library( ":LinalgDialect", ":MPIDialect", ":MemRefDialect", - ":MeshDialect", - ":MeshTransforms", ":Pass", ":SCFDialect", + ":ShardDialect", + ":ShardTransforms", ":Support", ":TensorDialect", ":TransformUtils", @@ -3988,7 +3993,6 @@ cc_library( ":MemRefToEmitC", ":MemRefToLLVM", ":MemRefToSPIRV", - ":MeshToMPIConversion", ":NVGPUToNVVM", ":NVVMToLLVM", ":OpenACCToSCF", @@ -4002,6 +4006,7 @@ cc_library( ":SCFToSPIRV", ":SPIRVToLLVM", ":ShapeToStandard", + ":ShardToMPIConversion", ":TensorToLinalg", ":TensorToSPIRV", ":TosaToArith", @@ -4522,7 +4527,7 @@ cc_library( ":FuncDialect", ":IR", ":InliningUtils", - ":MeshShardingInterface", + ":ShardingInterface", ], ) @@ -4593,57 +4598,6 @@ cc_library( cc_library( name = "AllExtensions", hdrs = ["include/mlir/InitAllExtensions.h"], - deps = [ - ":AMXTransforms", - ":AffineTransformOps", - ":ArithToEmitC", - ":ArithToLLVM", - ":ArmNeonTransformOps", - ":ArmSVEVectorTransformOps", - ":BufferizationTransformOps", - ":BuiltinToLLVMIRTranslation", - ":ComplexToLLVM", - ":ControlFlowToLLVM", - ":DLTITransformOps", - ":FuncExtensions", - ":FuncToEmitC", - ":FuncToLLVM", - ":FuncTransformOps", - ":GPUToGPURuntimeTransforms", - ":GPUToLLVMIRTranslation", - ":GPUToNVVMTransforms", - ":GPUTransformOps", - ":IndexToLLVM", - ":LLVMToLLVMIRTranslation", - ":LinalgTransformOps", - ":MPIToLLVM", - ":MathToLLVM", - ":MemRefToEmitC", - ":MemRefToLLVM", - ":MemRefTransformOps", - ":MeshDialect", - ":NVGPUTransformOps", - ":NVVMTarget", - ":NVVMToLLVM", - ":OpenMPToLLVM", - ":ROCDLTarget", - ":ROCDLToLLVMIRTranslation", - ":SCFToEmitC", - ":SCFTransformOps", - ":SparseTensorTransformOps", - ":TensorExtensions", - ":TensorTransformOps", - ":TransformDebugExtension", - ":TransformIRDLExtension", - ":TransformLoopExtension", - ":TransformPDLExtension", - ":TransformTuneExtension", - ":UBToLLVM", - ":VCIXToLLVMIRTranslation", - ":VectorToLLVM", - ":VectorTransformOps", - ":XeVMToLLVM", - ], ) # TODO(zinenko): remove this after updating users. @@ -5118,10 +5072,7 @@ cc_library( ":SideEffectInterfaces", ":Support", ":ViewLikeInterface", - "//llvm:AsmParser", "//llvm:BinaryFormat", - "//llvm:BitReader", - "//llvm:BitWriter", "//llvm:Core", "//llvm:Support", ], @@ -7194,7 +7145,7 @@ cc_library( includes = ["include"], deps = [ ":IR", - ":MeshShardingInterface", + ":ShardingInterface", ":TensorDialect", "//llvm:Support", ], @@ -8718,6 +8669,23 @@ cc_library( ) cc_library( + name = "XeVMToLLVMIRTranslation", + srcs = glob(["lib/Target/LLVMIR/Dialect/XeVM/*.cpp"]), + hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/XeVM/*.h"]), + includes = ["include"], + deps = [ + ":DialectUtils", + ":IR", + ":LLVMDialect", + ":Support", + ":ToLLVMIRTranslation", + ":XeVMDialect", + "//llvm:Core", + "//llvm:Support", + ], +) + +cc_library( name = "AllToLLVMIRTranslations", hdrs = ["include/mlir/Target/LLVMIR/Dialect/All.h"], includes = ["include"], @@ -8736,6 +8704,7 @@ cc_library( ":ROCDLToLLVMIRTranslation", ":SPIRVToLLVMIRTranslation", ":VCIXToLLVMIRTranslation", + ":XeVMToLLVMIRTranslation", ], ) @@ -8936,130 +8905,69 @@ cc_library( "include/mlir/InitAllDialects.h", "include/mlir/InitAllPasses.h", ], +) + +cc_library( + name = "RegisterAllDialects", + srcs = ["lib/RegisterAllDialects.cpp"], deps = [ ":AMDGPUDialect", - ":AMDGPUToROCDL", - ":AMDGPUTransforms", ":AMXDialect", - ":AMXTransforms", ":AffineDialect", - ":AffinePassIncGen", - ":AffineToStandard", - ":AffineTransformOps", - ":AffineTransforms", + ":AllPassesAndDialects", ":ArithDialect", - ":ArithToAMDGPU", - ":ArithToLLVM", - ":ArithToSPIRV", ":ArithTransforms", ":ArithValueBoundsOpInterfaceImpl", ":ArmNeonDialect", ":ArmSMEDialect", ":ArmSMETransforms", ":ArmSVEDialect", - ":ArmSVETransforms", ":AsyncDialect", - ":AsyncPassIncGen", - ":AsyncToLLVM", - ":AsyncTransforms", ":BufferizationDialect", - ":BufferizationPipelines", - ":BufferizationTransformOps", ":BufferizationTransforms", ":CastInterfaces", ":ComplexDialect", - ":ComplexToLLVM", - ":ComplexToLibm", - ":ComplexToSPIRV", ":ControlFlowDialect", ":ControlFlowTransforms", - ":ConversionPasses", - ":ConvertToEmitC", - ":ConvertToLLVM", ":DLTIDialect", ":EmitCDialect", - ":EmitCTransforms", ":FuncDialect", - ":FuncToLLVM", - ":FuncToSPIRV", - ":FuncTransformOps", - ":FuncTransforms", - ":FuncTransformsPassIncGen", ":GPUDialect", - ":GPUPassIncGen", - ":GPUPipelines", - ":GPUToGPURuntimeTransforms", - ":GPUToNVVMTransforms", - ":GPUToROCDLTransforms", - ":GPUToSPIRV", - ":GPUTransformOps", ":GPUTransforms", ":IR", ":IRDLDialect", ":IndexDialect", ":LLVMDialect", ":LLVMIRTransforms", - ":LLVMPassIncGen", ":LinalgDialect", - ":LinalgPassIncGen", - ":LinalgToStandard", - ":LinalgTransformOps", ":LinalgTransforms", ":MLProgramDialect", ":MLProgramTransforms", ":MPIDialect", ":MathDialect", - ":MathToFuncs", - ":MathToLLVM", - ":MathToLibm", - ":MathToSPIRV", - ":MathTransforms", ":MemRefDialect", - ":MemRefToLLVM", - ":MemRefToSPIRV", - ":MemRefTransformOps", ":MemRefTransforms", - ":MeshDialect", - ":MeshTransforms", ":NVGPUDialect", - ":NVGPUPassIncGen", - ":NVGPUToNVVM", - ":NVGPUTransformOps", - ":NVGPUTransforms", ":NVVMDialect", ":NVVMTarget", ":OpenACCDialect", - ":OpenACCTransforms", ":OpenMPDialect", - ":OpenMPToLLVM", ":PDLDialect", ":PDLInterpDialect", - ":PDLToPDLInterp", ":PtrDialect", ":QuantOps", - ":QuantTransforms", ":ROCDLDialect", ":ROCDLTarget", - ":ReconcileUnrealizedCasts", ":SCFDialect", - ":SCFPassIncGen", - ":SCFToControlFlow", - ":SCFToGPU", ":SCFTransformOps", ":SCFTransforms", ":SMTDialect", ":SPIRVDialect", - ":SPIRVPassIncGen", ":SPIRVTarget", - ":SPIRVToLLVM", - ":SPIRVTransforms", ":ShapeDialect", - ":ShapeToStandard", ":ShapeTransforms", - ":ShapeTransformsPassIncGen", + ":ShardDialect", ":SparseTensorDialect", - ":SparseTensorPipelines", - ":SparseTensorTransformOps", ":SparseTensorTransforms", ":TensorDialect", ":TensorInferTypeOpInterfaceImpl", @@ -9067,29 +8975,112 @@ cc_library( ":TensorTransformOps", ":TensorTransforms", ":TosaDialect", - ":TosaToLinalg", - ":TransformDebugExtension", ":TransformDialect", ":TransformDialectTransforms", - ":TransformLoopExtension", ":TransformPDLExtension", - ":Transforms", - ":TransformsPassIncGen", ":UBDialect", ":VectorDialect", - ":VectorToLLVM", - ":VectorToSCF", - ":VectorToSPIRV", - ":VectorTransformOps", ":VectorTransforms", ":X86VectorDialect", - ":X86VectorTransforms", ":XeGPUDialect", - ":XeGPUTransforms", ":XeVMDialect", ], ) +cc_library( + name = "RegisterAllPasses", + srcs = ["lib/RegisterAllPasses.cpp"], + deps = [ + ":AMDGPUTransforms", + ":AffineTransforms", + ":AllPassesAndDialects", + ":ArithTransforms", + ":ArmSMETransforms", + ":ArmSVETransforms", + ":AsyncTransforms", + ":BufferizationPipelines", + ":BufferizationTransforms", + ":ConversionPasses", + ":EmitCTransforms", + ":FuncTransforms", + ":GPUPipelines", + ":GPUTransforms", + ":LLVMIRTransforms", + ":LinalgTransforms", + ":MLProgramTransforms", + ":MathTransforms", + ":MemRefTransforms", + ":NVGPUTransforms", + ":OpenACCTransforms", + ":QuantTransforms", + ":SCFTransforms", + ":SPIRVTransforms", + ":ShapeTransforms", + ":ShardTransforms", + ":SparseTensorPipelines", + ":SparseTensorTransforms", + ":TensorTransforms", + ":TosaDialect", + ":TransformDialectTransforms", + ":Transforms", + ":VectorTransforms", + ":XeGPUTransforms", + ], +) + +cc_library( + name = "RegisterAllExtensions", + srcs = ["lib/RegisterAllExtensions.cpp"], + deps = [ + ":AMXTransforms", + ":AffineTransformOps", + ":AllExtensions", + ":ArithToEmitC", + ":ArithToLLVM", + ":ArmNeonTransformOps", + ":ArmSVEVectorTransformOps", + ":BufferizationTransformOps", + ":BuiltinToLLVMIRTranslation", + ":ComplexToLLVM", + ":ControlFlowToLLVM", + ":DLTITransformOps", + ":FuncExtensions", + ":FuncToEmitC", + ":FuncToLLVM", + ":FuncTransformOps", + ":GPUToGPURuntimeTransforms", + ":GPUToLLVMIRTranslation", + ":GPUToNVVMTransforms", + ":GPUTransformOps", + ":IndexToLLVM", + ":LLVMToLLVMIRTranslation", + ":LinalgTransformOps", + ":MPIToLLVM", + ":MathToLLVM", + ":MemRefToEmitC", + ":MemRefToLLVM", + ":MemRefTransformOps", + ":NVGPUTransformOps", + ":NVVMToLLVM", + ":OpenMPToLLVM", + ":ROCDLToLLVMIRTranslation", + ":SCFToEmitC", + ":SCFTransformOps", + ":SparseTensorTransformOps", + ":TensorExtensions", + ":TensorTransformOps", + ":TransformDebugExtension", + ":TransformIRDLExtension", + ":TransformLoopExtension", + ":TransformPDLExtension", + ":TransformTuneExtension", + ":UBToLLVM", + ":VectorToLLVM", + ":VectorTransformOps", + ":XeVMToLLVM", + ], +) + cc_binary( name = "mlir-lsp-server", srcs = ["tools/mlir-lsp-server/mlir-lsp-server.cpp"], @@ -9101,6 +9092,8 @@ cc_binary( ":IR", ":MlirLspServerLib", ":MlirLspServerSupportLib", + ":RegisterAllDialects", + ":RegisterAllExtensions", "//mlir/test:TestAffine", "//mlir/test:TestAnalysis", "//mlir/test:TestArith", @@ -9120,7 +9113,6 @@ cc_binary( "//mlir/test:TestMath", "//mlir/test:TestMathToVCIX", "//mlir/test:TestMemRef", - "//mlir/test:TestMesh", "//mlir/test:TestNVGPU", "//mlir/test:TestPDLL", "//mlir/test:TestPass", @@ -9129,6 +9121,7 @@ cc_binary( "//mlir/test:TestSCF", "//mlir/test:TestSPIRV", "//mlir/test:TestShapeDialect", + "//mlir/test:TestShard", "//mlir/test:TestTensor", "//mlir/test:TestTestDynDialect", "//mlir/test:TestTilingInterface", @@ -9155,6 +9148,9 @@ cc_binary( ":OpenMPDialect", ":Pass", ":QuantOps", + ":RegisterAllDialects", + ":RegisterAllExtensions", + ":RegisterAllPasses", ":SCFToGPU", ":Support", ":Transforms", @@ -9182,7 +9178,6 @@ cc_binary( "//mlir/test:TestMathToVCIX", "//mlir/test:TestMemRef", "//mlir/test:TestMemRefToLLVMWithTransforms", - "//mlir/test:TestMesh", "//mlir/test:TestNVGPU", "//mlir/test:TestPDLL", "//mlir/test:TestPass", @@ -9191,6 +9186,7 @@ cc_binary( "//mlir/test:TestSCF", "//mlir/test:TestSPIRV", "//mlir/test:TestShapeDialect", + "//mlir/test:TestShard", "//mlir/test:TestTensor", "//mlir/test:TestTestDynDialect", "//mlir/test:TestTilingInterface", @@ -9218,6 +9214,7 @@ cc_binary( ":ParseUtilities", ":Parser", ":Pass", + ":RegisterAllDialects", ":Support", ":TransformUtils", ":Transforms", @@ -10548,9 +10545,9 @@ cc_library( ":LinalgStructuredOpsIncGen", ":MathDialect", ":MemRefDialect", - ":MeshShardingInterface", ":Parser", ":SCFDialect", + ":ShardingInterface", ":SideEffectInterfaces", ":SparseTensorDialect", ":SubsetOpInterface", @@ -10699,14 +10696,14 @@ cc_library( ":MathDialect", ":MemRefDialect", ":MemRefTransforms", - ":MeshDialect", - ":MeshShardingInterface", - ":MeshTransforms", ":Pass", ":RuntimeVerifiableOpInterface", ":SCFDialect", ":SCFTransforms", ":SCFUtils", + ":ShardDialect", + ":ShardTransforms", + ":ShardingInterface", ":SparseTensorDialect", ":SubsetOpInterface", ":Support", @@ -10988,6 +10985,7 @@ cc_library( ":VectorTransforms", ":X86VectorDialect", ":X86VectorTransforms", + "//llvm:Core", "//llvm:Support", ], ) @@ -11198,10 +11196,10 @@ cc_library( ":InferTypeOpInterface", ":InliningUtils", ":LoopLikeInterface", - ":MeshDialect", - ":MeshShardingInterface", ":Pass", ":QuantOps", + ":ShardDialect", + ":ShardingInterface", ":SideEffectInterfaces", ":Support", ":TensorDialect", @@ -12141,8 +12139,8 @@ cc_library( ":FuncTransforms", ":IR", ":MemRefDialect", - ":MeshShardingInterface", ":Pass", + ":ShardingInterface", ":SideEffectInterfaces", ":TensorDialect", ":TransformUtils", @@ -13229,6 +13227,8 @@ cc_binary( ":AllPassesAndDialects", ":IR", ":MlirReduceLib", + ":RegisterAllDialects", + ":RegisterAllPasses", "//mlir/test:TestDialect", ], ) @@ -13287,6 +13287,7 @@ cc_binary( ":IR", ":MlirQueryLib", ":MlirQueryUtils", + ":RegisterAllDialects", "//mlir/test:TestDialect", ], ) diff --git a/utils/bazel/llvm-project-overlay/mlir/build_defs.bzl b/utils/bazel/llvm-project-overlay/mlir/build_defs.bzl index 53767fd0..b3fb4fc 100644 --- a/utils/bazel/llvm-project-overlay/mlir/build_defs.bzl +++ b/utils/bazel/llvm-project-overlay/mlir/build_defs.bzl @@ -4,6 +4,8 @@ """Rules and macros for MLIR""" +load("@rules_cc//cc:defs.bzl", "cc_library") + def if_cuda_available(if_true, if_false = []): return select({ # CUDA auto-detection is not yet supported. @@ -49,20 +51,20 @@ def mlir_c_api_cc_library( """ capi_header_deps = ["%sHeaders" % d for d in capi_deps] capi_object_deps = ["%sObjects" % d for d in capi_deps] - native.cc_library( + cc_library( name = name, srcs = srcs, hdrs = hdrs, deps = deps + capi_deps + header_deps, **kwargs ) - native.cc_library( + cc_library( name = name + "Headers", hdrs = hdrs, deps = header_deps + capi_header_deps, **kwargs ) - native.cc_library( + cc_library( name = name + "Objects", srcs = srcs, hdrs = hdrs, diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch1/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch1/BUILD.bazel index 2d4e1b5d..e097847 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch1/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch1/BUILD.bazel @@ -1,5 +1,8 @@ # Description: # MLIR Tutorial + +load("@rules_cc//cc:defs.bzl", "cc_binary") + licenses(["notice"]) package(default_visibility = ["//visibility:public"]) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel index 0fdda77..98be262 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel @@ -1,6 +1,7 @@ # Description: # MLIR Tutorial +load("@rules_cc//cc:defs.bzl", "cc_binary") load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") licenses(["notice"]) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel index 62e1d68..853db9d 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel @@ -1,6 +1,7 @@ # Description: # MLIR Tutorial +load("@rules_cc//cc:defs.bzl", "cc_binary") load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") licenses(["notice"]) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel index 3ac6ddc..0d71c4f4 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel @@ -1,6 +1,7 @@ # Description: # MLIR Tutorial +load("@rules_cc//cc:defs.bzl", "cc_binary") load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") licenses(["notice"]) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel index 34b7487..2624375 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel @@ -1,6 +1,7 @@ # Description: # MLIR Tutorial +load("@rules_cc//cc:defs.bzl", "cc_binary") load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") licenses(["notice"]) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel index ea1ef88..6427c2a 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel @@ -1,6 +1,7 @@ # Description: # MLIR Tutorial +load("@rules_cc//cc:defs.bzl", "cc_binary") load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") licenses(["notice"]) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel index 6e67715..07ebbb1 100644 --- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel @@ -1,6 +1,7 @@ # Description: # MLIR Tutorial +load("@rules_cc//cc:defs.bzl", "cc_binary") load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") licenses(["notice"]) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/transform-opt/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/transform-opt/BUILD.bazel new file mode 100644 index 0000000..22670bd --- /dev/null +++ b/utils/bazel/llvm-project-overlay/mlir/examples/transform-opt/BUILD.bazel @@ -0,0 +1,22 @@ +# MLIR transform dialect standalone example. + +package(default_visibility = ["//visibility:public"]) + +cc_binary( + name = "mlir-transform-opt", + srcs = ["mlir-transform-opt.cpp"], + deps = [ + "//llvm:Support", + "//mlir:AllExtensions", + "//mlir:AllPassesAndDialects", + "//mlir:IR", + "//mlir:MlirOptLib", + "//mlir:Parser", + "//mlir:RegisterAllDialects", + "//mlir:RegisterAllExtensions", + "//mlir:RegisterAllPasses", + "//mlir:Support", + "//mlir:TransformDialect", + "//mlir:TransformDialectTransforms", + ], +) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/transform/Ch2/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/transform/Ch2/BUILD.bazel new file mode 100644 index 0000000..a6f120c --- /dev/null +++ b/utils/bazel/llvm-project-overlay/mlir/examples/transform/Ch2/BUILD.bazel @@ -0,0 +1,74 @@ +# Description: +# MLIR Tutorial + +load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") + +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +td_library( + name = "TransformTdFiles", + srcs = [ + "include/MyExtension.td", + ], + includes = ["include"], + deps = [ + "//mlir:OpBaseTdFiles", + "//mlir:SideEffectInterfacesTdFiles", + "//mlir:TransformDialectTdFiles", + ], +) + +gentbl_cc_library( + name = "TransformIncGen", + tbl_outs = [ + ( + ["-gen-op-decls"], + "include/MyExtension.h.inc", + ), + ( + ["-gen-op-defs"], + "include/MyExtension.cpp.inc", + ), + ], + tblgen = "//mlir:mlir-tblgen", + td_file = "include/MyExtension.td", + deps = [":TransformTdFiles"], +) + +cc_library( + name = "MyExtension", + srcs = glob(["lib/*.cpp"]), + hdrs = glob(["include/*.h"]), + includes = ["include"], + deps = [ + ":TransformIncGen", + "//llvm:Support", + "//mlir:FuncDialect", + "//mlir:IR", + "//mlir:SCFDialect", + "//mlir:SideEffectInterfaces", + "//mlir:Support", + "//mlir:TransformDialect", + "//mlir:TransformDialectInterfaces", + ], +) + +cc_binary( + name = "transform-opt-ch2", + srcs = glob(["transform-opt/*.cpp"]), + local_defines = ["MLIR_INCLUDE_TESTS"], + deps = [ + ":MyExtension", + "//mlir:AllExtensions", + "//mlir:AllPassesAndDialects", + "//mlir:IR", + "//mlir:MlirOptLib", + "//mlir:RegisterAllDialects", + "//mlir:RegisterAllExtensions", + "//mlir:TransformDialectTransforms", + "//mlir:Transforms", + "//mlir/test:TestTransformDialect", + ], +) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/transform/Ch3/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/transform/Ch3/BUILD.bazel new file mode 100644 index 0000000..cba4339 --- /dev/null +++ b/utils/bazel/llvm-project-overlay/mlir/examples/transform/Ch3/BUILD.bazel @@ -0,0 +1,93 @@ +# Description: +# MLIR Tutorial + +load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") + +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +td_library( + name = "TransformTdFiles", + srcs = [ + "include/MyExtension.td", + "include/MyExtensionTypes.td", + ], + includes = ["include"], + deps = [ + "//mlir:OpBaseTdFiles", + "//mlir:SideEffectInterfacesTdFiles", + "//mlir:TransformDialectTdFiles", + ], +) + +gentbl_cc_library( + name = "TransformIncGen", + tbl_outs = [ + ( + ["-gen-op-decls"], + "include/MyExtension.h.inc", + ), + ( + ["-gen-op-defs"], + "include/MyExtension.cpp.inc", + ), + ], + tblgen = "//mlir:mlir-tblgen", + td_file = "include/MyExtension.td", + deps = [":TransformTdFiles"], +) + +gentbl_cc_library( + name = "TransformTypesIncGen", + tbl_outs = [ + ( + ["-gen-typedef-decls"], + "include/MyExtensionTypes.h.inc", + ), + ( + ["-gen-typedef-defs"], + "include/MyExtensionTypes.cpp.inc", + ), + ], + tblgen = "//mlir:mlir-tblgen", + td_file = "include/MyExtensionTypes.td", + deps = [":TransformTdFiles"], +) + +cc_library( + name = "MyExtension", + srcs = glob(["lib/*.cpp"]), + hdrs = glob(["include/*.h"]), + includes = ["include"], + deps = [ + ":TransformIncGen", + ":TransformTypesIncGen", + "//llvm:Support", + "//mlir:CallOpInterfaces", + "//mlir:FuncDialect", + "//mlir:IR", + "//mlir:SCFDialect", + "//mlir:Support", + "//mlir:TransformDialect", + "//mlir:TransformDialectInterfaces", + ], +) + +cc_binary( + name = "transform-opt-ch3", + srcs = glob(["transform-opt/*.cpp"]), + local_defines = ["MLIR_INCLUDE_TESTS"], + deps = [ + ":MyExtension", + "//mlir:AllExtensions", + "//mlir:AllPassesAndDialects", + "//mlir:IR", + "//mlir:MlirOptLib", + "//mlir:RegisterAllDialects", + "//mlir:RegisterAllExtensions", + "//mlir:TransformDialectTransforms", + "//mlir:Transforms", + "//mlir/test:TestTransformDialect", + ], +) diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/transform/Ch4/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/transform/Ch4/BUILD.bazel new file mode 100644 index 0000000..81c0161 --- /dev/null +++ b/utils/bazel/llvm-project-overlay/mlir/examples/transform/Ch4/BUILD.bazel @@ -0,0 +1,73 @@ +# Description: +# MLIR Tutorial + +load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library") + +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +td_library( + name = "TransformTdFiles", + srcs = [ + "include/MyExtension.td", + ], + includes = ["include"], + deps = [ + "//mlir:OpBaseTdFiles", + "//mlir:SideEffectInterfacesTdFiles", + "//mlir:TransformDialectTdFiles", + ], +) + +gentbl_cc_library( + name = "TransformIncGen", + tbl_outs = [ + ( + ["-gen-op-decls"], + "include/MyExtension.h.inc", + ), + ( + ["-gen-op-defs"], + "include/MyExtension.cpp.inc", + ), + ], + tblgen = "//mlir:mlir-tblgen", + td_file = "include/MyExtension.td", + deps = [":TransformTdFiles"], +) + +cc_library( + name = "MyExtension", + srcs = glob(["lib/*.cpp"]), + hdrs = glob(["include/*.h"]), + includes = ["include"], + deps = [ + ":TransformIncGen", + "//llvm:Support", + "//mlir:FuncDialect", + "//mlir:IR", + "//mlir:SCFDialect", + "//mlir:Support", + "//mlir:TransformDialect", + "//mlir:TransformDialectInterfaces", + ], +) + +cc_binary( + name = "transform-opt-ch4", + srcs = glob(["transform-opt/*.cpp"]), + local_defines = ["MLIR_INCLUDE_TESTS"], + deps = [ + ":MyExtension", + "//mlir:AllExtensions", + "//mlir:AllPassesAndDialects", + "//mlir:IR", + "//mlir:MlirOptLib", + "//mlir:RegisterAllDialects", + "//mlir:RegisterAllExtensions", + "//mlir:TransformDialectTransforms", + "//mlir:Transforms", + "//mlir/test:TestTransformDialect", + ], +) diff --git a/utils/bazel/llvm-project-overlay/mlir/linalggen.bzl b/utils/bazel/llvm-project-overlay/mlir/linalggen.bzl index d893471..7e21ac4 100644 --- a/utils/bazel/llvm-project-overlay/mlir/linalggen.bzl +++ b/utils/bazel/llvm-project-overlay/mlir/linalggen.bzl @@ -4,6 +4,8 @@ """BUILD extensions for MLIR linalg generation.""" +load("@rules_cc//cc:defs.bzl", "cc_library") + def genlinalg(name, linalggen, src, linalg_outs): """genlinalg() generates code from a tc spec file. @@ -35,7 +37,7 @@ def genlinalg(name, linalggen, src, linalg_outs): ) hdrs = [f for (opts, f) in linalg_outs] - native.cc_library( + cc_library( name = name, hdrs = hdrs, textual_hdrs = hdrs, diff --git a/utils/bazel/llvm-project-overlay/mlir/tblgen.bzl b/utils/bazel/llvm-project-overlay/mlir/tblgen.bzl index 89b1773..2213d220 100644 --- a/utils/bazel/llvm-project-overlay/mlir/tblgen.bzl +++ b/utils/bazel/llvm-project-overlay/mlir/tblgen.bzl @@ -4,6 +4,7 @@ """BUILD extensions for MLIR table generation.""" load("@bazel_skylib//lib:paths.bzl", "paths") +load("@rules_cc//cc:defs.bzl", "cc_library") TdInfo = provider( "Holds TableGen files and the dependencies and include paths necessary to" + @@ -424,7 +425,7 @@ def gentbl_cc_library( skip_opts = ["-gen-op-doc"], **kwargs ) - native.cc_library( + cc_library( name = name, # strip_include_prefix does not apply to textual_hdrs. # https://github.com/bazelbuild/bazel/issues/12424 diff --git a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel index 95e3ee4..72398ce 100644 --- a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +load("@rules_cc//cc:defs.bzl", "cc_library") load("//llvm:lit_test.bzl", "package_path") load("//mlir:tblgen.bzl", "gentbl_cc_library", "gentbl_sharded_ops", "td_library") @@ -37,6 +38,7 @@ expand_template( # All disabled, but required to substituted because they are not in quotes. "@LLVM_BUILD_EXAMPLES@": "0", "@LLVM_HAS_NVPTX_TARGET@": "0", + "@LLVM_INCLUDE_SPIRV_TOOLS_TESTS@": "0", "@MLIR_ENABLE_CUDA_RUNNER@": "0", "@MLIR_ENABLE_ROCM_CONVERSIONS@": "0", "@MLIR_ENABLE_ROCM_RUNNER@": "0", @@ -903,8 +905,8 @@ cc_library( ) cc_library( - name = "TestMesh", - srcs = glob(["lib/Dialect/Mesh/**/*.cpp"]), + name = "TestShard", + srcs = glob(["lib/Dialect/Shard/**/*.cpp"]), includes = ["lib/Dialect/Test"], deps = [ ":TestDialect", @@ -912,8 +914,8 @@ cc_library( "//mlir:DialectUtils", "//mlir:FuncDialect", "//mlir:IR", - "//mlir:MeshDialect", - "//mlir:MeshTransforms", + "//mlir:ShardDialect", + "//mlir:ShardTransforms", "//mlir:Pass", "//mlir:SPIRVDialect", "//mlir:Support", diff --git a/utils/bazel/llvm-project-overlay/mlir/test/mlir-tblgen/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/mlir-tblgen/BUILD.bazel index 1dd418c..5ebdc33 100644 --- a/utils/bazel/llvm-project-overlay/mlir/test/mlir-tblgen/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/test/mlir-tblgen/BUILD.bazel @@ -32,6 +32,7 @@ package(default_visibility = ["//visibility:public"]) "//mlir:include/mlir/IR/BuiltinDialectBytecode.td", "//mlir:include/mlir/IR/BytecodeBase.td", "//mlir:include/mlir/IR/OpBase.td", + "//mlir:include/mlir/Interfaces/CallInterfaces.td", "//mlir:include/mlir/Interfaces/InferTypeOpInterface.td", "//mlir:include/mlir/Interfaces/SideEffectInterfaces.td", "//mlir:include/mlir/Pass/PassBase.td", diff --git a/utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel index 02dc408..2cf7df7 100644 --- a/utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel @@ -2,6 +2,7 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_test") load("//mlir:tblgen.bzl", "gentbl_cc_library") package( @@ -419,6 +420,7 @@ cc_test( "//mlir:Parser", "//mlir:Pass", "//mlir:ReconcileUnrealizedCasts", + "//mlir:RegisterAllDialects", "//mlir:ToLLVMIRTranslation", "//mlir:VectorToLLVM", "//mlir:VectorToSCF", diff --git a/utils/bazel/llvm-project-overlay/third-party/siphash/BUILD.bazel b/utils/bazel/llvm-project-overlay/third-party/siphash/BUILD.bazel index d5b9631..fcea618 100644 --- a/utils/bazel/llvm-project-overlay/third-party/siphash/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/third-party/siphash/BUILD.bazel @@ -2,12 +2,14 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) cc_library( - name = "siphash", - hdrs = ["include/siphash/SipHash.h"], - strip_include_prefix = "include", -)
\ No newline at end of file + name = "siphash", + hdrs = ["include/siphash/SipHash.h"], + strip_include_prefix = "include", +) diff --git a/utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel b/utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel index 0b5c084..ff179a7 100644 --- a/utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel @@ -2,6 +2,8 @@ # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +load("@rules_cc//cc:defs.bzl", "cc_library") + package(default_visibility = ["//visibility:public"]) licenses(["notice"]) diff --git a/utils/bazel/llvm_configs/llvm-config.h.cmake b/utils/bazel/llvm_configs/llvm-config.h.cmake index a683229..39136bc 100644 --- a/utils/bazel/llvm_configs/llvm-config.h.cmake +++ b/utils/bazel/llvm_configs/llvm-config.h.cmake @@ -101,6 +101,9 @@ /* Define if LLVM is using tflite */ #cmakedefine LLVM_HAVE_TFLITE +/* Define if we want to check profile consistency in lit tests */ +#cmakedefine LLVM_ENABLE_PROFCHECK + /* Define to 1 if you have the <sysexits.h> header file. */ #cmakedefine HAVE_SYSEXITS_H ${HAVE_SYSEXITS_H} |