Merge pull request #3400 from GMNGeoffrey:main-to-google

PiperOrigin-RevId: 336087048
diff --git a/.bazelignore b/.bazelignore
index 99f076b..743cde4 100644
--- a/.bazelignore
+++ b/.bazelignore
@@ -20,6 +20,7 @@
 # Ignore third_party directories which contain BUILD files so that recursive
 # from root works.
 third_party
+build_tools/bazel/third_party_import/llvm-project/overlay
 
 # TODO: enable this when Java bindings are wired up.
 bindings/java
diff --git a/.github/workflows/update_llvm_dependent_submodules.yml b/.github/workflows/update_tf.yml
similarity index 72%
rename from .github/workflows/update_llvm_dependent_submodules.yml
rename to .github/workflows/update_tf.yml
index 981a3a9..75f6bbd 100644
--- a/.github/workflows/update_llvm_dependent_submodules.yml
+++ b/.github/workflows/update_tf.yml
@@ -12,15 +12,15 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Creates a PR to update all LLVM-dependent submodules to the current LLVM
-# commit in the repo.
+# Creates a PR to update the TF submodule to HEAD & copy the latest
+# version of the LLVM Bazel BUILD files from TF.
 
-name: Synchronize LLVM Dependents
+name: Update TensorFlow
 
 on:
   schedule:
     # Every 6 hours at 0, 6, 12, 18 UTC (4, 10, 16, 22 PST)
-    - cron: "0 */6 * * *"
+    - cron: '0 */6 * * *'
 
 jobs:
   update_tf:
@@ -38,26 +38,24 @@
         run: ./scripts/git/update_to_llvm_syncpoint.py
       - name: Calculating SHAs
         run: |
-          echo "::set-env name=LLVM_SHA::$(git submodule status third_party/llvm-project | awk '{print $1}' | cut -c -12)"
           echo "::set-env name=TF_SHA::$(git submodule status third_party/tensorflow | awk '{print $1}' | cut -c -12)"
-          echo "::set-env name=LLVM_BAZEL_SHA::$(git submodule status third_party/llvm-bazel | awk '{print $1}' | cut -c -12)"
+          echo "::set-env name=LLVM_SHA::$(git submodule status third_party/llvm-project | awk '{print $1}' | cut -c -12)"
       - name: Creating Pull Request
         uses: peter-evans/create-pull-request@v2
         with:
           # Personal token is required to trigger additional automation (e.g. presubmits).
           token: ${{ secrets.GITHUB_WRITE_ACCESS_TOKEN }}
-          commit-message: "Synchronize submodules with LLVM at llvm/llvm-project@${{ env.LLVM_SHA }}"
-          title: "Synchronize submodules with LLVM at llvm/llvm-project@${{ env.LLVM_SHA }}"
+          commit-message: "Integrate TF at tensorflow/tensorflow@${{ env.TF_SHA }}"
+          title: "Integrate TF at tensorflow/tensorflow@${{ env.TF_SHA }}"
           body: |
-            Updates LLVM dependencies to match
-            [${{ env.LLVM_SHA }}](https://github.com/llvm/llvm-project/commit/${{ env.LLVM_SHA }}).
-            - llvm-bazel to
-              [${{ env.LLVM_BAZEL_SHA }}](https://github.com/google/llvm-bazel/commit/${{ env.LLVM_BAZEL_SHA }})
-            - TensorFlow to
+            Updates TF to
             [${{ env.TF_SHA }}](https://github.com/tensorflow/tensorflow/commit/${{ env.TF_SHA }})
+            matching
+            [${{ env.LLVM_SHA }}](https://github.com/llvm/llvm-project/commit/${{ env.LLVM_SHA }})
+            and copies over the LLVM BUILD files.
 
             `./scripts/git/update_to_llvm_syncpoint.py`
 
-            Automated submodule bump from .github/workflows/update_llvm_dependent_submodules.yml
+            Automated submodule bump from .github/workflows/update_tf.yml
           committer: "Submodule Update Action <iree-github-actions-bot@google.com>"
           branch: "auto_submodule_update"
diff --git a/.gitmodules b/.gitmodules
index a51b4c9..85b7b8f 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -59,6 +59,3 @@
 [submodule "third_party/cpuinfo"]
 	path = third_party/cpuinfo
 	url = https://github.com/pytorch/cpuinfo.git
-[submodule "third_party/llvm-bazel"]
-	path = third_party/llvm-bazel
-	url = https://github.com/google/llvm-bazel.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb5a04b..701ba0d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -291,8 +291,8 @@
 #-------------------------------------------------------------------------------
 
 # Disable LLVM's warnings.
-set(LLVM_ENABLE_ASSERTIONS OFF CACHE STRING "don't use global flags /facepalm")
-set(LLVM_ENABLE_WARNINGS OFF CACHE STRING "don't use global flags /facepalm")
+set(LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "don't use global flags /facepalm")
+set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "don't use global flags /facepalm")
 
 # Adds bundled projects that must be included after the LLVM directory has
 # been added and within the scope of its settings (i.e. build type override,
@@ -304,17 +304,17 @@
 endfunction()
 
 function(add_iree_mlir_src_dep llvm_monorepo_path)
+  # Stash cmake build type in case LLVM messes with it.
+  set(_CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
+
   # experimental model builder uses vulkan runner.
   if(${IREE_BUILD_EXPERIMENTAL})
     set(MLIR_VULKAN_RUNNER_ENABLED ON)
   endif()
 
-  # Disable LLVM's warnings
-  set(LLVM_ENABLE_WARNINGS OFF)
-
   add_subdirectory("${llvm_monorepo_path}/llvm" "third_party/llvm-project/llvm" EXCLUDE_FROM_ALL)
 
-  # Reset CMAKE_BUILD_TYPE to its previous setting
+  # Reset CMAKE_BUILD_TYPE to its previous setting.
   set(CMAKE_BUILD_TYPE "${_CMAKE_BUILD_TYPE}" CACHE STRING "Build type (default ${DEFAULT_CMAKE_BUILD_TYPE})" FORCE)
 endfunction()
 
diff --git a/SUBMODULE_VERSIONS b/SUBMODULE_VERSIONS
index d69c28d..2c48101 100644
--- a/SUBMODULE_VERSIONS
+++ b/SUBMODULE_VERSIONS
@@ -5,7 +5,6 @@
 a5d9d0f7d368054fd1691aedf1db4116efcc233e third_party/flatbuffers
 4fb0ff7069bd88ee85902f4d0bb62794e5f6d021 third_party/flatcc
 f2fb48c3b3d79a75a88a99fba6576b25d42ec528 third_party/googletest
-f0d426064ff1ed45438424d5c53f753c6d4c809b third_party/llvm-bazel
 9908ee5670596db4fdc2bd7ea7c3071c0e02a784 third_party/llvm-project
 17b12a4481daa150e2d1ea3ada086b551b856707 third_party/marl
 d2cdb70e038370b5e28f353fe98ccd70af1cbc25 third_party/mlir-emitc
diff --git a/WORKSPACE b/WORKSPACE
index a6db513..c907ffb 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -107,34 +107,13 @@
 
 ###############################################################################
 # llvm-project
-
-maybe(
-    local_repository,
-    name = "llvm_bazel",
-    path = "third_party/llvm-bazel/llvm-bazel",
-)
-
-load("@llvm_bazel//:zlib.bzl", "llvm_zlib_disable")
-
-maybe(
-    llvm_zlib_disable,
-    name = "llvm_zlib",
-)
-
-load("@llvm_bazel//:terminfo.bzl", "llvm_terminfo_disable")
-
-maybe(
-    llvm_terminfo_disable,
-    name = "llvm_terminfo",
-)
-
-load("@llvm_bazel//:configure.bzl", "llvm_configure")
+load("@iree_core//build_tools/bazel/third_party_import/llvm-project:configure.bzl", "llvm_configure")
 
 maybe(
     llvm_configure,
     name = "llvm-project",
-    src_path = "third_party/llvm-project",
-    src_workspace = "@iree_core//:WORKSPACE",
+    path = "third_party/llvm-project",
+    workspace = "@iree_core//:WORKSPACE",
 )
 ###############################################################################
 
diff --git a/build_tools/bazel/iree.bazelrc b/build_tools/bazel/iree.bazelrc
index ee0a1cb..46922a4 100644
--- a/build_tools/bazel/iree.bazelrc
+++ b/build_tools/bazel/iree.bazelrc
@@ -298,4 +298,10 @@
 # Another TensorFlow flag from their config script.
 build:windows --define with_default_optimizations=true
 
+# TensorFlow builds depend on these flags so we will as well
+# MSVC (Windows): Standards-conformant preprocessor mode
+# See https://docs.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview
+build:windows --copt=/experimental:preprocessor
+build:windows --host_copt=/experimental:preprocessor
+
 ###############################################################################
diff --git a/build_tools/bazel/third_party_import/llvm-project/BUILD.bazel b/build_tools/bazel/third_party_import/llvm-project/BUILD.bazel
new file mode 100644
index 0000000..9a78dc1
--- /dev/null
+++ b/build_tools/bazel/third_party_import/llvm-project/BUILD.bazel
@@ -0,0 +1,15 @@
+# Copyright 2019 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Intentionally empty.
diff --git a/build_tools/bazel/third_party_import/llvm-project/configure.bzl b/build_tools/bazel/third_party_import/llvm-project/configure.bzl
new file mode 100644
index 0000000..6779ebd
--- /dev/null
+++ b/build_tools/bazel/third_party_import/llvm-project/configure.bzl
@@ -0,0 +1,99 @@
+# Copyright 2019 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Configures an LLVM overlay project."""
+
+_OVERLAY_PARENT_PATHS = [
+    "llvm",
+    "mlir",
+    "mlir/test",
+]
+
+def _is_absolute(path):
+    """Returns `True` if `path` is an absolute path.
+    Args:
+      path: A path (which is a string).
+    Returns:
+      `True` if `path` is an absolute path.
+    """
+    return path.startswith("/") or (len(path) > 2 and path[1] == ":")
+
+def _join_path(a, b):
+    return str(a) + "/" + str(b)
+
+def _symlink_src_dir(repository_ctx, from_path, to_path):
+    children = repository_ctx.path(from_path).readdir()
+    for from_child_path in children:
+        if to_path:
+            to_child_path = _join_path(to_path, from_child_path.basename)
+        else:  # Root
+            to_child_path = from_child_path.basename
+
+        # Skip paths that are already in the overlay list.
+        # They will have this function called on them to populate.
+        if to_child_path in _OVERLAY_PARENT_PATHS:
+            continue
+        repository_ctx.symlink(from_child_path, to_child_path)
+
+def _llvm_configure_impl(repository_ctx):
+    # Compute path that sources are symlinked from.
+    src_workspace_path = repository_ctx.path(
+        repository_ctx.attr.workspace,
+    ).dirname
+    src_path = repository_ctx.attr.path
+    if not _is_absolute(src_path):
+        src_path = _join_path(src_workspace_path, src_path)
+
+    # Compute path (relative to here) where overlay files
+    # are symlinked from.
+    this_workspace_path = repository_ctx.path(
+        repository_ctx.attr.workspace,
+    ).dirname
+    overlay_path = _join_path(
+        this_workspace_path,
+        "build_tools/bazel/third_party_import/llvm-project/overlay",
+    )
+
+    # Each parent path of an overlay file must have its children manually
+    # symlinked. This is because the directory itself must be in the cahche
+    # (so that we can modify it without modifying the underlying source
+    # path). An alternative to this would be to perform a deep symlink of
+    # the entire tree (which would be wasteful).
+    for overlay_parent_path in _OVERLAY_PARENT_PATHS:
+        src_child_path = _join_path(src_path, overlay_parent_path)
+        overlay_child_path = _join_path(overlay_path, overlay_parent_path)
+
+        # Symlink from external src path
+        _symlink_src_dir(repository_ctx, src_child_path, overlay_parent_path)
+
+        # Symlink from the overlay path.
+        _symlink_src_dir(repository_ctx, overlay_child_path, overlay_parent_path)
+
+    # Then symlink any top-level entries not previously handled.
+    # Doing it here means that if we got it wrong, it will fail with a
+    # "File Exists" error vs doing the wrong thing.
+    _symlink_src_dir(repository_ctx, src_path, "")
+
+    # Build files and overlays.
+    repository_ctx.file("BUILD")  # Root build is empty.
+
+llvm_configure = repository_rule(
+    implementation = _llvm_configure_impl,
+    local = True,
+    attrs = {
+        "_this_workspace": attr.label(default = Label("//:WORKSPACE")),
+        "workspace": attr.label(default = Label("//:WORKSPACE")),
+        "path": attr.string(mandatory = True),
+    },
+)
diff --git a/build_tools/bazel/third_party_import/llvm-project/overlay/llvm/BUILD.bazel b/build_tools/bazel/third_party_import/llvm-project/overlay/llvm/BUILD.bazel
new file mode 100644
index 0000000..e0d64fe
--- /dev/null
+++ b/build_tools/bazel/third_party_import/llvm-project/overlay/llvm/BUILD.bazel
@@ -0,0 +1,4771 @@
+# Bazel BUILD file for LLVM.
+#
+# This BUILD file is auto-generated; do not edit!
+
+licenses(["notice"])
+
+exports_files(["LICENSE.TXT"])
+
+load(
+    "@org_tensorflow//third_party/llvm:llvm.bzl",
+    "cmake_var_string",
+    "expand_cmake_vars",
+    "gentbl",
+    "llvm_all_cmake_vars",
+    "llvm_copts",
+    "llvm_defines",
+    "llvm_linkopts",
+    "llvm_support_platform_specific_srcs_glob",
+)
+load(
+    "@org_tensorflow//third_party:common.bzl",
+    "template_rule",
+)
+
+package(default_visibility = ["//visibility:public"])
+
+llvm_host_triple = "x86_64-unknown-linux_gnu"
+
+llvm_targets = [
+    "AArch64",
+    "AMDGPU",
+    "ARM",
+    "NVPTX",
+    "PowerPC",
+    "SystemZ",
+    "X86",
+]
+
+llvm_target_asm_parsers = llvm_targets
+
+llvm_target_asm_printers = llvm_targets
+
+llvm_target_disassemblers = llvm_targets
+
+# Performs CMake variable substitutions on configuration header files.
+expand_cmake_vars(
+    name = "config_gen",
+    src = "include/llvm/Config/config.h.cmake",
+    cmake_vars = llvm_all_cmake_vars,
+    dst = "include/llvm/Config/config.h",
+)
+
+expand_cmake_vars(
+    name = "llvm_config_gen",
+    src = "include/llvm/Config/llvm-config.h.cmake",
+    cmake_vars = llvm_all_cmake_vars,
+    dst = "include/llvm/Config/llvm-config.h",
+)
+
+expand_cmake_vars(
+    name = "abi_breaking_gen",
+    src = "include/llvm/Config/abi-breaking.h.cmake",
+    cmake_vars = llvm_all_cmake_vars,
+    dst = "include/llvm/Config/abi-breaking.h",
+)
+
+# Performs macro expansions on .def.in files
+template_rule(
+    name = "targets_def_gen",
+    src = "include/llvm/Config/Targets.def.in",
+    out = "include/llvm/Config/Targets.def",
+    substitutions = {
+        "@LLVM_ENUM_TARGETS@": "\n".join(
+            ["LLVM_TARGET({})".format(t) for t in llvm_targets],
+        ),
+    },
+)
+
+template_rule(
+    name = "asm_parsers_def_gen",
+    src = "include/llvm/Config/AsmParsers.def.in",
+    out = "include/llvm/Config/AsmParsers.def",
+    substitutions = {
+        "@LLVM_ENUM_ASM_PARSERS@": "\n".join(
+            ["LLVM_ASM_PARSER({})".format(t) for t in llvm_target_asm_parsers],
+        ),
+    },
+)
+
+template_rule(
+    name = "asm_printers_def_gen",
+    src = "include/llvm/Config/AsmPrinters.def.in",
+    out = "include/llvm/Config/AsmPrinters.def",
+    substitutions = {
+        "@LLVM_ENUM_ASM_PRINTERS@": "\n".join(
+            ["LLVM_ASM_PRINTER({})".format(t) for t in llvm_target_asm_printers],
+        ),
+    },
+)
+
+template_rule(
+    name = "disassemblers_def_gen",
+    src = "include/llvm/Config/Disassemblers.def.in",
+    out = "include/llvm/Config/Disassemblers.def",
+    substitutions = {
+        "@LLVM_ENUM_DISASSEMBLERS@": "\n".join(
+            ["LLVM_DISASSEMBLER({})".format(t) for t in llvm_target_disassemblers],
+        ),
+    },
+)
+
+# A common library that all LLVM targets depend on.
+# TODO(b/113996071): We need to glob all potentially #included files and stage
+# them here because LLVM's build files are not strict headers clean, and remote
+# build execution requires all inputs to be depended upon.
+cc_library(
+    name = "config",
+    hdrs = glob([
+        "**/*.h",
+        "**/*.def",
+        "**/*.inc.cpp",
+    ]) + [
+        "include/llvm/Config/AsmParsers.def",
+        "include/llvm/Config/AsmPrinters.def",
+        "include/llvm/Config/Disassemblers.def",
+        "include/llvm/Config/Targets.def",
+        "include/llvm/Config/config.h",
+        "include/llvm/Config/llvm-config.h",
+        "include/llvm/Config/abi-breaking.h",
+    ],
+    defines = llvm_defines,
+    includes = ["include"],
+)
+
+# A creator of an empty file include/llvm/Support/VCSRevision.h.
+# This is usually populated by the upstream build infrastructure, but in this
+# case we leave it blank. See upstream revision r300160.
+genrule(
+    name = "vcs_revision_gen",
+    srcs = [],
+    outs = ["include/llvm/Support/VCSRevision.h"],
+    cmd = "echo '' > \"$@\"",
+)
+
+# Rules that apply the LLVM tblgen tool.
+gentbl(
+    name = "attributes_gen",
+    tbl_outs = [("-gen-attrs", "include/llvm/IR/Attributes.inc")],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Attributes.td",
+    td_srcs = ["include/llvm/IR/Attributes.td"],
+)
+
+gentbl(
+    name = "InstCombineTableGen",
+    tbl_outs = [(
+        "-gen-searchable-tables",
+        "lib/Target/AMDGPU/InstCombineTables.inc",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "lib/Target/AMDGPU/InstCombineTables.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]) + ["include/llvm/TableGen/SearchableTable.td"],
+)
+
+gentbl(
+    name = "intrinsic_enums_gen",
+    tbl_outs = [("-gen-intrinsic-enums", "include/llvm/IR/IntrinsicEnums.inc")],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "aarch64_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=aarch64",
+        "include/llvm/IR/IntrinsicsAArch64.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "amdgcn_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=amdgcn",
+        "include/llvm/IR/IntrinsicsAMDGPU.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "arm_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=arm",
+        "include/llvm/IR/IntrinsicsARM.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "bpf_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=bpf",
+        "include/llvm/IR/IntrinsicsBPF.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "hexagon_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=hexagon",
+        "include/llvm/IR/IntrinsicsHexagon.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "mips_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=mips",
+        "include/llvm/IR/IntrinsicsMips.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "nvvm_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=nvvm",
+        "include/llvm/IR/IntrinsicsNVPTX.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "ppc_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=ppc",
+        "include/llvm/IR/IntrinsicsPowerPC.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "r600_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=r600",
+        "include/llvm/IR/IntrinsicsR600.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "riscv_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=riscv",
+        "include/llvm/IR/IntrinsicsRISCV.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "s390_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=s390",
+        "include/llvm/IR/IntrinsicsS390.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "wasm_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=wasm",
+        "include/llvm/IR/IntrinsicsWebAssembly.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "x86_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=x86",
+        "include/llvm/IR/IntrinsicsX86.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "xcore_enums_gen",
+    tbl_outs = [(
+        "-gen-intrinsic-enums -intrinsic-prefix=xcore",
+        "include/llvm/IR/IntrinsicsXCore.h",
+    )],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+gentbl(
+    name = "intrinsics_impl_gen",
+    tbl_outs = [("-gen-intrinsic-impl", "include/llvm/IR/IntrinsicImpl.inc")],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/IR/Intrinsics.td",
+    td_srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+    ]),
+)
+
+cc_library(
+    name = "tblgen",
+    srcs = glob([
+        "utils/TableGen/*.cpp",
+        "utils/TableGen/*.h",
+        "utils/TableGen/GlobalISel/*.cpp",
+    ]),
+    hdrs = glob([
+        "utils/TableGen/GlobalISel/*.h",
+    ]),
+    deps = [
+        ":MC",
+        ":Support",
+        ":TableGen",
+        ":config",
+    ],
+)
+
+# Binary targets used by Tensorflow.
+cc_binary(
+    name = "llvm-tblgen",
+    srcs = glob([
+        "utils/TableGen/*.cpp",
+        "utils/TableGen/*.h",
+    ]),
+    copts = llvm_copts,
+    linkopts = llvm_linkopts,
+    stamp = 0,
+    deps = [
+        ":Support",
+        ":TableGen",
+        ":config",
+        ":tblgen",
+    ],
+)
+
+cc_library(
+    name = "FileCheckLib",
+    srcs = glob([
+        "lib/FileCheck/*.cpp",
+        "lib/FileCheck/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/FileCheck/*.h",
+    ]),
+    includes = ["include"],
+    deps = [":Support"],
+)
+
+cc_binary(
+    name = "FileCheck",
+    testonly = 1,
+    srcs = glob([
+        "utils/FileCheck/*.cpp",
+        "utils/FileCheck/*.h",
+    ]),
+    copts = llvm_copts,
+    linkopts = llvm_linkopts,
+    stamp = 0,
+    deps = [
+        ":FileCheckLib",
+        ":Support",
+    ],
+)
+
+llvm_target_list = [
+    {
+        "name": "AArch64",
+        "lower_name": "aarch64",
+        "short_name": "AArch64",
+        "dir_name": "AArch64",
+        "tbl_outs": [
+            ("-gen-register-bank", "lib/Target/AArch64/AArch64GenRegisterBank.inc"),
+            ("-gen-register-info", "lib/Target/AArch64/AArch64GenRegisterInfo.inc"),
+            ("-gen-instr-info", "lib/Target/AArch64/AArch64GenInstrInfo.inc"),
+            ("-gen-emitter", "lib/Target/AArch64/AArch64GenMCCodeEmitter.inc"),
+            ("-gen-pseudo-lowering", "lib/Target/AArch64/AArch64GenMCPseudoLowering.inc"),
+            ("-gen-asm-writer", "lib/Target/AArch64/AArch64GenAsmWriter.inc"),
+            ("-gen-asm-writer -asmwriternum=1", "lib/Target/AArch64/AArch64GenAsmWriter1.inc"),
+            ("-gen-asm-matcher", "lib/Target/AArch64/AArch64GenAsmMatcher.inc"),
+            ("-gen-dag-isel", "lib/Target/AArch64/AArch64GenDAGISel.inc"),
+            ("-gen-fast-isel", "lib/Target/AArch64/AArch64GenFastISel.inc"),
+            ("-gen-global-isel", "lib/Target/AArch64/AArch64GenGlobalISel.inc"),
+            ("-gen-global-isel-combiner -combiners=AArch64PreLegalizerCombinerHelper", "lib/Target/AArch64/AArch64GenPreLegalizeGICombiner.inc"),
+            ("-gen-global-isel-combiner -combiners=AArch64PostLegalizerCombinerHelper", "lib/Target/AArch64/AArch64GenPostLegalizeGICombiner.inc"),
+            ("-gen-callingconv", "lib/Target/AArch64/AArch64GenCallingConv.inc"),
+            ("-gen-subtarget", "lib/Target/AArch64/AArch64GenSubtargetInfo.inc"),
+            ("-gen-disassembler", "lib/Target/AArch64/AArch64GenDisassemblerTables.inc"),
+            ("-gen-searchable-tables", "lib/Target/AArch64/AArch64GenSystemOperands.inc"),
+        ],
+    },
+    {
+        "name": "AMDGPU",
+        "lower_name": "amdgpu",
+        "short_name": "AMDGPU",
+        "dir_name": "AMDGPU",
+        "tbl_outs": [
+            ("-gen-register-bank", "lib/Target/AMDGPU/AMDGPUGenRegisterBank.inc"),
+            ("-gen-register-info", "lib/Target/AMDGPU/AMDGPUGenRegisterInfo.inc"),
+            ("-gen-instr-info", "lib/Target/AMDGPU/AMDGPUGenInstrInfo.inc"),
+            ("-gen-emitter", "lib/Target/AMDGPU/AMDGPUGenMCCodeEmitter.inc"),
+            ("-gen-pseudo-lowering", "lib/Target/AMDGPU/AMDGPUGenMCPseudoLowering.inc"),
+            ("-gen-asm-writer", "lib/Target/AMDGPU/AMDGPUGenAsmWriter.inc"),
+            ("-gen-asm-matcher", "lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc"),
+            ("-gen-dag-isel", "lib/Target/AMDGPU/AMDGPUGenDAGISel.inc"),
+            ("-gen-callingconv", "lib/Target/AMDGPU/AMDGPUGenCallingConv.inc"),
+            ("-gen-subtarget", "lib/Target/AMDGPU/AMDGPUGenSubtargetInfo.inc"),
+            ("-gen-disassembler", "lib/Target/AMDGPU/AMDGPUGenDisassemblerTables.inc"),
+            ("-gen-searchable-tables", "lib/Target/AMDGPU/AMDGPUGenSearchableTables.inc"),
+        ],
+        "tbl_deps": [
+            ":amdgpu_isel_target_gen",
+        ],
+    },
+    {
+        "name": "ARM",
+        "lower_name": "arm",
+        "short_name": "ARM",
+        "dir_name": "ARM",
+        "tbl_outs": [
+            ("-gen-register-bank", "lib/Target/ARM/ARMGenRegisterBank.inc"),
+            ("-gen-register-info", "lib/Target/ARM/ARMGenRegisterInfo.inc"),
+            ("-gen-searchable-tables", "lib/Target/ARM/ARMGenSystemRegister.inc"),
+            ("-gen-instr-info", "lib/Target/ARM/ARMGenInstrInfo.inc"),
+            ("-gen-emitter", "lib/Target/ARM/ARMGenMCCodeEmitter.inc"),
+            ("-gen-pseudo-lowering", "lib/Target/ARM/ARMGenMCPseudoLowering.inc"),
+            ("-gen-asm-writer", "lib/Target/ARM/ARMGenAsmWriter.inc"),
+            ("-gen-asm-matcher", "lib/Target/ARM/ARMGenAsmMatcher.inc"),
+            ("-gen-dag-isel", "lib/Target/ARM/ARMGenDAGISel.inc"),
+            ("-gen-fast-isel", "lib/Target/ARM/ARMGenFastISel.inc"),
+            ("-gen-global-isel", "lib/Target/ARM/ARMGenGlobalISel.inc"),
+            ("-gen-callingconv", "lib/Target/ARM/ARMGenCallingConv.inc"),
+            ("-gen-subtarget", "lib/Target/ARM/ARMGenSubtargetInfo.inc"),
+            ("-gen-disassembler", "lib/Target/ARM/ARMGenDisassemblerTables.inc"),
+        ],
+    },
+    {
+        "name": "NVPTX",
+        "lower_name": "nvptx",
+        "short_name": "NVPTX",
+        "dir_name": "NVPTX",
+        "tbl_outs": [
+            ("-gen-register-info", "lib/Target/NVPTX/NVPTXGenRegisterInfo.inc"),
+            ("-gen-instr-info", "lib/Target/NVPTX/NVPTXGenInstrInfo.inc"),
+            ("-gen-asm-writer", "lib/Target/NVPTX/NVPTXGenAsmWriter.inc"),
+            ("-gen-dag-isel", "lib/Target/NVPTX/NVPTXGenDAGISel.inc"),
+            ("-gen-subtarget", "lib/Target/NVPTX/NVPTXGenSubtargetInfo.inc"),
+        ],
+    },
+    {
+        "name": "PowerPC",
+        "lower_name": "powerpc",
+        "short_name": "PPC",
+        "dir_name": "PowerPC",
+        "tbl_outs": [
+            ("-gen-asm-writer", "lib/Target/PowerPC/PPCGenAsmWriter.inc"),
+            ("-gen-asm-matcher", "lib/Target/PowerPC/PPCGenAsmMatcher.inc"),
+            ("-gen-emitter", "lib/Target/PowerPC/PPCGenMCCodeEmitter.inc"),
+            ("-gen-register-info", "lib/Target/PowerPC/PPCGenRegisterInfo.inc"),
+            ("-gen-instr-info", "lib/Target/PowerPC/PPCGenInstrInfo.inc"),
+            ("-gen-dag-isel", "lib/Target/PowerPC/PPCGenDAGISel.inc"),
+            ("-gen-fast-isel", "lib/Target/PowerPC/PPCGenFastISel.inc"),
+            ("-gen-callingconv", "lib/Target/PowerPC/PPCGenCallingConv.inc"),
+            ("-gen-subtarget", "lib/Target/PowerPC/PPCGenSubtargetInfo.inc"),
+            ("-gen-disassembler", "lib/Target/PowerPC/PPCGenDisassemblerTables.inc"),
+            ("-gen-register-bank", "lib/Target/PowerPC/PPCGenRegisterBank.inc"),
+            ("-gen-global-isel", "lib/Target/PowerPC/PPCGenGlobalISel.inc"),
+        ],
+    },
+    {
+        "name": "SystemZ",
+        "lower_name": "system_z",
+        "short_name": "SystemZ",
+        "dir_name": "SystemZ",
+        "tbl_outs": [
+            ("-gen-asm-writer", "lib/Target/SystemZ/SystemZGenAsmWriter.inc"),
+            ("-gen-asm-matcher", "lib/Target/SystemZ/SystemZGenAsmMatcher.inc"),
+            ("-gen-emitter", "lib/Target/SystemZ/SystemZGenMCCodeEmitter.inc"),
+            ("-gen-register-info", "lib/Target/SystemZ/SystemZGenRegisterInfo.inc"),
+            ("-gen-instr-info", "lib/Target/SystemZ/SystemZGenInstrInfo.inc"),
+            ("-gen-dag-isel", "lib/Target/SystemZ/SystemZGenDAGISel.inc"),
+            ("-gen-callingconv", "lib/Target/SystemZ/SystemZGenCallingConv.inc"),
+            ("-gen-subtarget", "lib/Target/SystemZ/SystemZGenSubtargetInfo.inc"),
+            ("-gen-disassembler", "lib/Target/SystemZ/SystemZGenDisassemblerTables.inc"),
+        ],
+    },
+    {
+        "name": "X86",
+        "lower_name": "x86",
+        "short_name": "X86",
+        "dir_name": "X86",
+        "tbl_outs": [
+            ("-gen-register-bank", "lib/Target/X86/X86GenRegisterBank.inc"),
+            ("-gen-register-info", "lib/Target/X86/X86GenRegisterInfo.inc"),
+            ("-gen-disassembler", "lib/Target/X86/X86GenDisassemblerTables.inc"),
+            ("-gen-instr-info", "lib/Target/X86/X86GenInstrInfo.inc"),
+            ("-gen-asm-writer", "lib/Target/X86/X86GenAsmWriter.inc"),
+            ("-gen-asm-writer -asmwriternum=1", "lib/Target/X86/X86GenAsmWriter1.inc"),
+            ("-gen-asm-matcher", "lib/Target/X86/X86GenAsmMatcher.inc"),
+            ("-gen-dag-isel", "lib/Target/X86/X86GenDAGISel.inc"),
+            ("-gen-fast-isel", "lib/Target/X86/X86GenFastISel.inc"),
+            ("-gen-global-isel", "lib/Target/X86/X86GenGlobalISel.inc"),
+            ("-gen-callingconv", "lib/Target/X86/X86GenCallingConv.inc"),
+            ("-gen-subtarget", "lib/Target/X86/X86GenSubtargetInfo.inc"),
+            ("-gen-x86-EVEX2VEX-tables", "lib/Target/X86/X86GenEVEX2VEXTables.inc"),
+            ("-gen-exegesis", "lib/Target/X86/X86GenExegesis.inc"),
+        ],
+    },
+]
+
+filegroup(
+    name = "common_target_td_sources",
+    srcs = glob([
+        "include/llvm/CodeGen/*.td",
+        "include/llvm/Frontend/Directive/*.td",
+        "include/llvm/IR/Intrinsics*.td",
+        "include/llvm/TableGen/*.td",
+        "include/llvm/Target/*.td",
+        "include/llvm/Target/GlobalISel/*.td",
+    ]),
+)
+
+gentbl(
+    name = "amdgpu_isel_target_gen",
+    tbl_outs = [
+        ("-gen-global-isel", "lib/Target/AMDGPU/AMDGPUGenGlobalISel.inc"),
+        ("-gen-global-isel-combiner -combiners=AMDGPUPreLegalizerCombinerHelper", "lib/Target/AMDGPU/AMDGPUGenPreLegalizeGICombiner.inc"),
+        ("-gen-global-isel-combiner -combiners=AMDGPUPostLegalizerCombinerHelper", "lib/Target/AMDGPU/AMDGPUGenPostLegalizeGICombiner.inc"),
+        ("-gen-global-isel-combiner -combiners=AMDGPURegBankCombinerHelper", "lib/Target/AMDGPU/AMDGPUGenRegBankGICombiner.inc"),
+    ],
+    tblgen = ":llvm-tblgen",
+    td_file = "lib/Target/AMDGPU/AMDGPUGISel.td",
+    td_srcs = [
+        ":common_target_td_sources",
+    ] + glob([
+        "lib/Target/AMDGPU/*.td",
+    ]),
+)
+
+gentbl(
+    name = "r600_target_gen",
+    tbl_outs = [
+        ("-gen-asm-writer", "lib/Target/AMDGPU/R600GenAsmWriter.inc"),
+        ("-gen-callingconv", "lib/Target/AMDGPU/R600GenCallingConv.inc"),
+        ("-gen-dag-isel", "lib/Target/AMDGPU/R600GenDAGISel.inc"),
+        ("-gen-dfa-packetizer", "lib/Target/AMDGPU/R600GenDFAPacketizer.inc"),
+        ("-gen-instr-info", "lib/Target/AMDGPU/R600GenInstrInfo.inc"),
+        ("-gen-emitter", "lib/Target/AMDGPU/R600GenMCCodeEmitter.inc"),
+        ("-gen-register-info", "lib/Target/AMDGPU/R600GenRegisterInfo.inc"),
+        ("-gen-subtarget", "lib/Target/AMDGPU/R600GenSubtargetInfo.inc"),
+    ],
+    tblgen = ":llvm-tblgen",
+    td_file = "lib/Target/AMDGPU/R600.td",
+    td_srcs = [
+        ":common_target_td_sources",
+    ] + glob([
+        "lib/Target/AMDGPU/*.td",
+    ]),
+)
+
+[gentbl(
+    name = target["name"] + "CommonTableGen",
+    tbl_outs = target["tbl_outs"],
+    tblgen = ":llvm-tblgen",
+    td_file = "lib/Target/" + target["dir_name"] + "/" + target["short_name"] + ".td",
+    td_srcs = [
+        ":common_target_td_sources",
+    ] + glob([
+        "lib/Target/" + target["dir_name"] + "/*.td",
+        "lib/Target/" + target["name"] + "/GISel/*.td",
+    ]),
+    deps = target.get("tbl_deps", []),
+) for target in llvm_target_list]
+
+# This target is used to provide *.def files to x86_code_gen.
+# Files with '.def' extension are not allowed in 'srcs' of 'cc_library' rule.
+cc_library(
+    name = "x86_defs",
+    hdrs = glob([
+        "lib/Target/X86/*.def",
+    ]),
+    visibility = ["//visibility:private"],
+)
+
+# This filegroup provides the docker build script in LLVM repo
+filegroup(
+    name = "docker",
+    srcs = glob([
+        "utils/docker/build_docker_image.sh",
+    ]),
+    visibility = ["//visibility:public"],
+)
+
+py_binary(
+    name = "lit",
+    srcs = ["utils/lit/lit.py"] + glob(["utils/lit/lit/**/*.py"]),
+)
+
+cc_binary(
+    name = "count",
+    srcs = ["utils/count/count.c"],
+)
+
+cc_binary(
+    name = "not",
+    srcs = ["utils/not/not.cpp"],
+    copts = llvm_copts,
+    linkopts = llvm_linkopts,
+    deps = [
+        ":Support",
+    ],
+)
+
+cc_library(
+    name = "AllTargetsCodeGens",
+    deps = [
+        target["name"] + "CodeGen"
+        for target in llvm_target_list
+    ],
+)
+
+exports_files([
+    "include/llvm/Frontend/OpenMP/OMP.td",
+])
+
+filegroup(
+    name = "omp_td_files",
+    srcs = glob([
+        "include/llvm/Frontend/OpenMP/*.td",
+        "include/llvm/Frontend/Directive/*.td",
+    ]),
+)
+
+gentbl(
+    name = "omp_gen",
+    tbl_outs = [("--gen-directive-decl", "include/llvm/Frontend/OpenMP/OMP.h.inc")],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/Frontend/OpenMP/OMP.td",
+    td_srcs = [
+        ":omp_td_files",
+    ],
+)
+
+gentbl(
+    name = "omp_gen_impl",
+    tbl_outs = [("--gen-directive-impl", "include/llvm/Frontend/OpenMP/OMP.cpp")],
+    tblgen = ":llvm-tblgen",
+    td_file = "include/llvm/Frontend/OpenMP/OMP.td",
+    td_srcs = [
+        ":omp_td_files",
+    ],
+)
+
+# TODO(b/159809163): autogenerate this after enabling release-mode ML
+# InlineAdvisor
+cc_library(
+    name = "Analysis",
+    srcs = glob(
+        [
+            "lib/Analysis/*.c",
+            "lib/Analysis/*.cpp",
+            "lib/Analysis/*.inc",
+            "include/llvm/Transforms/Utils/Local.h",
+            "include/llvm/Transforms/Scalar.h",
+            "lib/Analysis/*.h",
+        ],
+        exclude = [
+            "lib/Analysis/DevelopmentModeInlineAdvisor.cpp",
+            "lib/Analysis/MLInlineAdvisor.cpp",
+            "lib/Analysis/ReleaseModeModelRunner.cpp",
+            "lib/Analysis/TFUtils.cpp",
+        ],
+    ),
+    hdrs = glob([
+        "include/llvm/Analysis/*.h",
+        "include/llvm/Analysis/*.def",
+        "include/llvm/Analysis/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":Core",
+        ":Object",
+        ":ProfileData",
+        ":Support",
+        ":config",
+    ],
+)
+
+########################## Begin generated content ##########################
+cc_library(
+    name = "AArch64AsmParser",
+    srcs = glob([
+        "lib/Target/AArch64/AsmParser/*.c",
+        "lib/Target/AArch64/AsmParser/*.cpp",
+        "lib/Target/AArch64/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AArch64/AsmParser/*.h",
+        "include/llvm/Target/AArch64/AsmParser/*.def",
+        "include/llvm/Target/AArch64/AsmParser/*.inc",
+        "lib/Target/AArch64/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AArch64"],
+    deps = [
+        ":AArch64Desc",
+        ":AArch64Info",
+        ":AArch64Utils",
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AArch64CodeGen",
+    srcs = glob([
+        "lib/Target/AArch64/*.c",
+        "lib/Target/AArch64/*.cpp",
+        "lib/Target/AArch64/*.inc",
+        "lib/Target/AArch64/GISel/*.cpp",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AArch64/*.h",
+        "include/llvm/Target/AArch64/*.def",
+        "include/llvm/Target/AArch64/*.inc",
+        "lib/Target/AArch64/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AArch64"],
+    deps = [
+        ":AArch64Desc",
+        ":AArch64Info",
+        ":AArch64Utils",
+        ":Analysis",
+        ":AsmPrinter",
+        ":CFGuard",
+        ":CodeGen",
+        ":Core",
+        ":GlobalISel",
+        ":MC",
+        ":Scalar",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AArch64Desc",
+    srcs = glob([
+        "lib/Target/AArch64/MCTargetDesc/*.c",
+        "lib/Target/AArch64/MCTargetDesc/*.cpp",
+        "lib/Target/AArch64/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AArch64/MCTargetDesc/*.h",
+        "include/llvm/Target/AArch64/MCTargetDesc/*.def",
+        "include/llvm/Target/AArch64/MCTargetDesc/*.inc",
+        "lib/Target/AArch64/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AArch64"],
+    deps = [
+        ":AArch64CommonTableGen",
+        ":AArch64Info",
+        ":AArch64Utils",
+        ":BinaryFormat",
+        ":MC",
+        ":Support",
+        ":attributes_gen",
+        ":config",
+        ":intrinsic_enums_gen",
+        ":intrinsics_impl_gen",
+    ],
+)
+
+cc_library(
+    name = "AArch64Disassembler",
+    srcs = glob([
+        "lib/Target/AArch64/Disassembler/*.c",
+        "lib/Target/AArch64/Disassembler/*.cpp",
+        "lib/Target/AArch64/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AArch64/Disassembler/*.h",
+        "include/llvm/Target/AArch64/Disassembler/*.def",
+        "include/llvm/Target/AArch64/Disassembler/*.inc",
+        "lib/Target/AArch64/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AArch64"],
+    deps = [
+        ":AArch64Desc",
+        ":AArch64Info",
+        ":AArch64Utils",
+        ":MC",
+        ":MCDisassembler",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AArch64Info",
+    srcs = glob([
+        "lib/Target/AArch64/TargetInfo/*.c",
+        "lib/Target/AArch64/TargetInfo/*.cpp",
+        "lib/Target/AArch64/TargetInfo/*.inc",
+        "lib/Target/AArch64/MCTargetDesc/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AArch64/TargetInfo/*.h",
+        "include/llvm/Target/AArch64/TargetInfo/*.def",
+        "include/llvm/Target/AArch64/TargetInfo/*.inc",
+        "lib/Target/AArch64/*.def",
+        "lib/Target/AArch64/AArch64*.h",
+        "lib/Target/AArch64/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AArch64"],
+    deps = [
+        ":CodeGen",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AArch64Utils",
+    srcs = glob([
+        "lib/Target/AArch64/Utils/*.c",
+        "lib/Target/AArch64/Utils/*.cpp",
+        "lib/Target/AArch64/Utils/*.inc",
+        "lib/Target/AArch64/MCTargetDesc/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AArch64/Utils/*.h",
+        "include/llvm/Target/AArch64/Utils/*.def",
+        "include/llvm/Target/AArch64/Utils/*.inc",
+        "lib/Target/AArch64/Utils/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AArch64"],
+    deps = [
+        ":AArch64CommonTableGen",
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AMDGPUAsmParser",
+    srcs = glob([
+        "lib/Target/AMDGPU/AsmParser/*.c",
+        "lib/Target/AMDGPU/AsmParser/*.cpp",
+        "lib/Target/AMDGPU/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AMDGPU/AsmParser/*.h",
+        "include/llvm/Target/AMDGPU/AsmParser/*.def",
+        "include/llvm/Target/AMDGPU/AsmParser/*.inc",
+        "lib/Target/AMDGPU/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AMDGPU"],
+    deps = [
+        ":AMDGPUDesc",
+        ":AMDGPUInfo",
+        ":AMDGPUUtils",
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AMDGPUCodeGen",
+    srcs = glob([
+        "lib/Target/AMDGPU/*.c",
+        "lib/Target/AMDGPU/*.cpp",
+        "lib/Target/AMDGPU/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AMDGPU/*.h",
+        "include/llvm/Target/AMDGPU/*.def",
+        "include/llvm/Target/AMDGPU/*.inc",
+        "lib/Target/AMDGPU/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AMDGPU"],
+    deps = [
+        ":AMDGPUDesc",
+        ":AMDGPUInfo",
+        ":AMDGPUUtils",
+        ":Analysis",
+        ":AsmPrinter",
+        ":BinaryFormat",
+        ":CodeGen",
+        ":Core",
+        ":GlobalISel",
+        ":IPO",
+        ":MC",
+        ":MIRParser",
+        ":Scalar",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":Vectorize",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AMDGPUDesc",
+    srcs = glob([
+        "lib/Target/AMDGPU/MCTargetDesc/*.c",
+        "lib/Target/AMDGPU/MCTargetDesc/*.cpp",
+        "lib/Target/AMDGPU/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AMDGPU/MCTargetDesc/*.h",
+        "include/llvm/Target/AMDGPU/MCTargetDesc/*.def",
+        "include/llvm/Target/AMDGPU/MCTargetDesc/*.inc",
+        "lib/Target/AMDGPU/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AMDGPU"],
+    deps = [
+        ":AMDGPUInfo",
+        ":AMDGPUUtils",
+        ":BinaryFormat",
+        ":Core",
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AMDGPUDisassembler",
+    srcs = glob([
+        "lib/Target/AMDGPU/Disassembler/*.c",
+        "lib/Target/AMDGPU/Disassembler/*.cpp",
+        "lib/Target/AMDGPU/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AMDGPU/Disassembler/*.h",
+        "include/llvm/Target/AMDGPU/Disassembler/*.def",
+        "include/llvm/Target/AMDGPU/Disassembler/*.inc",
+        "lib/Target/AMDGPU/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AMDGPU"],
+    deps = [
+        ":AMDGPUDesc",
+        ":AMDGPUInfo",
+        ":AMDGPUUtils",
+        ":MC",
+        ":MCDisassembler",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AMDGPUInfo",
+    srcs = glob([
+        "lib/Target/AMDGPU/TargetInfo/*.c",
+        "lib/Target/AMDGPU/TargetInfo/*.cpp",
+        "lib/Target/AMDGPU/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AMDGPU/TargetInfo/*.h",
+        "include/llvm/Target/AMDGPU/TargetInfo/*.def",
+        "include/llvm/Target/AMDGPU/TargetInfo/*.inc",
+        "lib/Target/AMDGPU/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AMDGPU"],
+    deps = [
+        ":AMDGPUCommonTableGen",
+        ":Core",
+        ":Support",
+        ":config",
+        ":r600_target_gen",
+    ],
+)
+
+cc_library(
+    name = "AMDGPUUtils",
+    srcs = glob([
+        "lib/Target/AMDGPU/Utils/*.c",
+        "lib/Target/AMDGPU/Utils/*.cpp",
+        "lib/Target/AMDGPU/Utils/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AMDGPU/Utils/*.h",
+        "include/llvm/Target/AMDGPU/Utils/*.def",
+        "include/llvm/Target/AMDGPU/Utils/*.inc",
+        "lib/Target/AMDGPU/Utils/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AMDGPU"],
+    deps = [
+        ":AMDGPUCommonTableGen",
+        ":BinaryFormat",
+        ":Core",
+        ":MC",
+        ":Support",
+        ":config",
+        ":r600_target_gen",
+    ],
+)
+
+cc_library(
+    name = "ARCCodeGen",
+    srcs = glob([
+        "lib/Target/ARC/*.c",
+        "lib/Target/ARC/*.cpp",
+        "lib/Target/ARC/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARC/*.h",
+        "include/llvm/Target/ARC/*.def",
+        "include/llvm/Target/ARC/*.inc",
+        "lib/Target/ARC/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARC"],
+    deps = [
+        ":ARCDesc",
+        ":ARCInfo",
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ARCDesc",
+    srcs = glob([
+        "lib/Target/ARC/MCTargetDesc/*.c",
+        "lib/Target/ARC/MCTargetDesc/*.cpp",
+        "lib/Target/ARC/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARC/MCTargetDesc/*.h",
+        "include/llvm/Target/ARC/MCTargetDesc/*.def",
+        "include/llvm/Target/ARC/MCTargetDesc/*.inc",
+        "lib/Target/ARC/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARC"],
+    deps = [
+        ":ARCInfo",
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ARCDisassembler",
+    srcs = glob([
+        "lib/Target/ARC/Disassembler/*.c",
+        "lib/Target/ARC/Disassembler/*.cpp",
+        "lib/Target/ARC/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARC/Disassembler/*.h",
+        "include/llvm/Target/ARC/Disassembler/*.def",
+        "include/llvm/Target/ARC/Disassembler/*.inc",
+        "lib/Target/ARC/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARC"],
+    deps = [
+        ":ARCInfo",
+        ":MCDisassembler",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ARCInfo",
+    srcs = glob([
+        "lib/Target/ARC/TargetInfo/*.c",
+        "lib/Target/ARC/TargetInfo/*.cpp",
+        "lib/Target/ARC/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARC/TargetInfo/*.h",
+        "include/llvm/Target/ARC/TargetInfo/*.def",
+        "include/llvm/Target/ARC/TargetInfo/*.inc",
+        "lib/Target/ARC/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARC"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ARMAsmParser",
+    srcs = glob([
+        "lib/Target/ARM/AsmParser/*.c",
+        "lib/Target/ARM/AsmParser/*.cpp",
+        "lib/Target/ARM/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARM/AsmParser/*.h",
+        "include/llvm/Target/ARM/AsmParser/*.def",
+        "include/llvm/Target/ARM/AsmParser/*.inc",
+        "lib/Target/ARM/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARM"],
+    deps = [
+        ":ARMDesc",
+        ":ARMInfo",
+        ":ARMUtils",
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ARMCodeGen",
+    srcs = glob([
+        "lib/Target/ARM/*.c",
+        "lib/Target/ARM/*.cpp",
+        "lib/Target/ARM/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARM/*.h",
+        "include/llvm/Target/ARM/*.def",
+        "include/llvm/Target/ARM/*.inc",
+        "lib/Target/ARM/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARM"],
+    deps = [
+        ":ARMDesc",
+        ":ARMInfo",
+        ":ARMUtils",
+        ":Analysis",
+        ":AsmPrinter",
+        ":CFGuard",
+        ":CodeGen",
+        ":Core",
+        ":GlobalISel",
+        ":MC",
+        ":Scalar",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ARMDesc",
+    srcs = glob([
+        "lib/Target/ARM/MCTargetDesc/*.c",
+        "lib/Target/ARM/MCTargetDesc/*.cpp",
+        "lib/Target/ARM/MCTargetDesc/*.inc",
+        "lib/Target/ARM/*.h",
+        "include/llvm/CodeGen/GlobalISel/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARM/MCTargetDesc/*.h",
+        "include/llvm/Target/ARM/MCTargetDesc/*.def",
+        "include/llvm/Target/ARM/MCTargetDesc/*.inc",
+        "lib/Target/ARM/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARM"],
+    deps = [
+        ":ARMCommonTableGen",
+        ":ARMInfo",
+        ":ARMUtils",
+        ":BinaryFormat",
+        ":MC",
+        ":MCDisassembler",
+        ":Support",
+        ":attributes_gen",
+        ":config",
+        ":intrinsic_enums_gen",
+        ":intrinsics_impl_gen",
+    ],
+)
+
+cc_library(
+    name = "ARMDisassembler",
+    srcs = glob([
+        "lib/Target/ARM/Disassembler/*.c",
+        "lib/Target/ARM/Disassembler/*.cpp",
+        "lib/Target/ARM/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARM/Disassembler/*.h",
+        "include/llvm/Target/ARM/Disassembler/*.def",
+        "include/llvm/Target/ARM/Disassembler/*.inc",
+        "lib/Target/ARM/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARM"],
+    deps = [
+        ":ARMDesc",
+        ":ARMInfo",
+        ":ARMUtils",
+        ":MCDisassembler",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ARMInfo",
+    srcs = glob([
+        "lib/Target/ARM/TargetInfo/*.c",
+        "lib/Target/ARM/TargetInfo/*.cpp",
+        "lib/Target/ARM/TargetInfo/*.inc",
+        "lib/Target/ARM/MCTargetDesc/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARM/TargetInfo/*.h",
+        "include/llvm/Target/ARM/TargetInfo/*.def",
+        "include/llvm/Target/ARM/TargetInfo/*.inc",
+        "lib/Target/ARM/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARM"],
+    deps = [
+        ":ARMCommonTableGen",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ARMUtils",
+    srcs = glob([
+        "lib/Target/ARM/Utils/*.c",
+        "lib/Target/ARM/Utils/*.cpp",
+        "lib/Target/ARM/Utils/*.inc",
+        "lib/Target/ARM/MCTargetDesc/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/ARM/Utils/*.h",
+        "include/llvm/Target/ARM/Utils/*.def",
+        "include/llvm/Target/ARM/Utils/*.inc",
+        "lib/Target/ARM/Utils/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/ARM"],
+    deps = [
+        ":ARMCommonTableGen",
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AVRAsmParser",
+    srcs = glob([
+        "lib/Target/AVR/AsmParser/*.c",
+        "lib/Target/AVR/AsmParser/*.cpp",
+        "lib/Target/AVR/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AVR/AsmParser/*.h",
+        "include/llvm/Target/AVR/AsmParser/*.def",
+        "include/llvm/Target/AVR/AsmParser/*.inc",
+        "lib/Target/AVR/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AVR"],
+    deps = [
+        ":AVRDesc",
+        ":AVRInfo",
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AVRCodeGen",
+    srcs = glob([
+        "lib/Target/AVR/*.c",
+        "lib/Target/AVR/*.cpp",
+        "lib/Target/AVR/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AVR/*.h",
+        "include/llvm/Target/AVR/*.def",
+        "include/llvm/Target/AVR/*.inc",
+        "lib/Target/AVR/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AVR"],
+    deps = [
+        ":AVRDesc",
+        ":AVRInfo",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AVRDesc",
+    srcs = glob([
+        "lib/Target/AVR/MCTargetDesc/*.c",
+        "lib/Target/AVR/MCTargetDesc/*.cpp",
+        "lib/Target/AVR/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AVR/MCTargetDesc/*.h",
+        "include/llvm/Target/AVR/MCTargetDesc/*.def",
+        "include/llvm/Target/AVR/MCTargetDesc/*.inc",
+        "lib/Target/AVR/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AVR"],
+    deps = [
+        ":AVRInfo",
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AVRDisassembler",
+    srcs = glob([
+        "lib/Target/AVR/Disassembler/*.c",
+        "lib/Target/AVR/Disassembler/*.cpp",
+        "lib/Target/AVR/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AVR/Disassembler/*.h",
+        "include/llvm/Target/AVR/Disassembler/*.def",
+        "include/llvm/Target/AVR/Disassembler/*.inc",
+        "lib/Target/AVR/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AVR"],
+    deps = [
+        ":AVRInfo",
+        ":MCDisassembler",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AVRInfo",
+    srcs = glob([
+        "lib/Target/AVR/TargetInfo/*.c",
+        "lib/Target/AVR/TargetInfo/*.cpp",
+        "lib/Target/AVR/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/AVR/TargetInfo/*.h",
+        "include/llvm/Target/AVR/TargetInfo/*.def",
+        "include/llvm/Target/AVR/TargetInfo/*.inc",
+        "lib/Target/AVR/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/AVR"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AggressiveInstCombine",
+    srcs = glob([
+        "lib/Transforms/AggressiveInstCombine/*.c",
+        "lib/Transforms/AggressiveInstCombine/*.cpp",
+        "lib/Transforms/AggressiveInstCombine/*.inc",
+        "lib/Transforms/AggressiveInstCombine/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/AggressiveInstCombine/*.h",
+        "include/llvm/Transforms/AggressiveInstCombine/*.def",
+        "include/llvm/Transforms/AggressiveInstCombine/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":Core",
+        ":Support",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AsmParser",
+    srcs = glob([
+        "lib/AsmParser/*.c",
+        "lib/AsmParser/*.cpp",
+        "lib/AsmParser/*.inc",
+        "lib/AsmParser/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/AsmParser/*.h",
+        "include/llvm/AsmParser/*.def",
+        "include/llvm/AsmParser/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":Core",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "AsmPrinter",
+    srcs = glob([
+        "lib/CodeGen/AsmPrinter/*.c",
+        "lib/CodeGen/AsmPrinter/*.cpp",
+        "lib/CodeGen/AsmPrinter/*.inc",
+        "lib/CodeGen/AsmPrinter/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/CodeGen/AsmPrinter/*.h",
+        "include/llvm/CodeGen/AsmPrinter/*.def",
+        "include/llvm/CodeGen/AsmPrinter/*.inc",
+        "lib/CodeGen/AsmPrinter/*.def",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":BinaryFormat",
+        ":CodeGen",
+        ":Core",
+        ":DebugInfoCodeView",
+        ":DebugInfoDWARF",
+        ":DebugInfoMSF",
+        ":MC",
+        ":MCParser",
+        ":Remarks",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "BPFAsmParser",
+    srcs = glob([
+        "lib/Target/BPF/AsmParser/*.c",
+        "lib/Target/BPF/AsmParser/*.cpp",
+        "lib/Target/BPF/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/BPF/AsmParser/*.h",
+        "include/llvm/Target/BPF/AsmParser/*.def",
+        "include/llvm/Target/BPF/AsmParser/*.inc",
+        "lib/Target/BPF/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/BPF"],
+    deps = [
+        ":BPFDesc",
+        ":BPFInfo",
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "BPFCodeGen",
+    srcs = glob([
+        "lib/Target/BPF/*.c",
+        "lib/Target/BPF/*.cpp",
+        "lib/Target/BPF/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/BPF/*.h",
+        "include/llvm/Target/BPF/*.def",
+        "include/llvm/Target/BPF/*.inc",
+        "lib/Target/BPF/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/BPF"],
+    deps = [
+        ":AsmPrinter",
+        ":BPFDesc",
+        ":BPFInfo",
+        ":CodeGen",
+        ":Core",
+        ":IPO",
+        ":MC",
+        ":Scalar",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "BPFDesc",
+    srcs = glob([
+        "lib/Target/BPF/MCTargetDesc/*.c",
+        "lib/Target/BPF/MCTargetDesc/*.cpp",
+        "lib/Target/BPF/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/BPF/MCTargetDesc/*.h",
+        "include/llvm/Target/BPF/MCTargetDesc/*.def",
+        "include/llvm/Target/BPF/MCTargetDesc/*.inc",
+        "lib/Target/BPF/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/BPF"],
+    deps = [
+        ":BPFInfo",
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "BPFDisassembler",
+    srcs = glob([
+        "lib/Target/BPF/Disassembler/*.c",
+        "lib/Target/BPF/Disassembler/*.cpp",
+        "lib/Target/BPF/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/BPF/Disassembler/*.h",
+        "include/llvm/Target/BPF/Disassembler/*.def",
+        "include/llvm/Target/BPF/Disassembler/*.inc",
+        "lib/Target/BPF/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/BPF"],
+    deps = [
+        ":BPFInfo",
+        ":MCDisassembler",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "BPFInfo",
+    srcs = glob([
+        "lib/Target/BPF/TargetInfo/*.c",
+        "lib/Target/BPF/TargetInfo/*.cpp",
+        "lib/Target/BPF/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/BPF/TargetInfo/*.h",
+        "include/llvm/Target/BPF/TargetInfo/*.def",
+        "include/llvm/Target/BPF/TargetInfo/*.inc",
+        "lib/Target/BPF/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/BPF"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "BinaryFormat",
+    srcs = glob([
+        "lib/BinaryFormat/*.c",
+        "lib/BinaryFormat/*.cpp",
+        "lib/BinaryFormat/*.inc",
+        "lib/BinaryFormat/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/BinaryFormat/*.h",
+        "include/llvm/BinaryFormat/*.def",
+        "include/llvm/BinaryFormat/*.inc",
+        "include/llvm/BinaryFormat/ELFRelocs/*.def",
+        "include/llvm/BinaryFormat/WasmRelocs/*.def",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "BitReader",
+    srcs = glob([
+        "lib/Bitcode/Reader/*.c",
+        "lib/Bitcode/Reader/*.cpp",
+        "lib/Bitcode/Reader/*.inc",
+        "lib/Bitcode/Reader/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Bitcode/Reader/*.h",
+        "include/llvm/Bitcode/Reader/*.def",
+        "include/llvm/Bitcode/Reader/*.inc",
+        "include/llvm/Bitcode/BitstreamReader.h",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BitstreamReader",
+        ":Core",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "BitWriter",
+    srcs = glob([
+        "lib/Bitcode/Writer/*.c",
+        "lib/Bitcode/Writer/*.cpp",
+        "lib/Bitcode/Writer/*.inc",
+        "lib/Bitcode/Writer/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Bitcode/Writer/*.h",
+        "include/llvm/Bitcode/Writer/*.def",
+        "include/llvm/Bitcode/Writer/*.inc",
+        "include/llvm/Bitcode/BitcodeWriter.h",
+        "include/llvm/Bitcode/BitcodeWriterPass.h",
+        "include/llvm/Bitcode/BitstreamWriter.h",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":Core",
+        ":MC",
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "BitstreamReader",
+    srcs = glob([
+        "lib/Bitstream/Reader/*.c",
+        "lib/Bitstream/Reader/*.cpp",
+        "lib/Bitstream/Reader/*.inc",
+        "lib/Bitstream/Reader/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Bitstream/Reader/*.h",
+        "include/llvm/Bitstream/Reader/*.def",
+        "include/llvm/Bitstream/Reader/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "CFGuard",
+    srcs = glob([
+        "lib/Transforms/CFGuard/*.c",
+        "lib/Transforms/CFGuard/*.cpp",
+        "lib/Transforms/CFGuard/*.inc",
+        "lib/Transforms/CFGuard/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/CFGuard/*.h",
+        "include/llvm/Transforms/CFGuard/*.def",
+        "include/llvm/Transforms/CFGuard/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "CodeGen",
+    srcs = glob([
+        "lib/CodeGen/*.c",
+        "lib/CodeGen/*.cpp",
+        "lib/CodeGen/*.inc",
+        "lib/CodeGen/LiveDebugValues/*.cpp",
+        "lib/CodeGen/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/CodeGen/*.h",
+        "include/llvm/CodeGen/*.def",
+        "include/llvm/CodeGen/*.inc",
+        "include/llvm/CodeGen/**/*.h",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":BitReader",
+        ":BitWriter",
+        ":Core",
+        ":Instrumentation",
+        ":MC",
+        ":ProfileData",
+        ":Scalar",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Core",
+    srcs = glob([
+        "lib/IR/*.c",
+        "lib/IR/*.cpp",
+        "lib/IR/*.inc",
+        "include/llvm/Analysis/*.h",
+        "include/llvm/Bitcode/BitcodeReader.h",
+        "include/llvm/Bitcode/BitCodes.h",
+        "include/llvm/Bitcode/LLVMBitCodes.h",
+        "include/llvm/CodeGen/MachineValueType.h",
+        "include/llvm/CodeGen/ValueTypes.h",
+        "lib/IR/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/IR/*.h",
+        "include/llvm/IR/*.def",
+        "include/llvm/IR/*.inc",
+        "include/llvm/*.h",
+        "include/llvm/Analysis/*.def",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":Remarks",
+        ":Support",
+        ":aarch64_enums_gen",
+        ":amdgcn_enums_gen",
+        ":arm_enums_gen",
+        ":attributes_gen",
+        ":bpf_enums_gen",
+        ":config",
+        ":hexagon_enums_gen",
+        ":intrinsic_enums_gen",
+        ":intrinsics_impl_gen",
+        ":mips_enums_gen",
+        ":nvvm_enums_gen",
+        ":ppc_enums_gen",
+        ":r600_enums_gen",
+        ":riscv_enums_gen",
+        ":s390_enums_gen",
+        ":wasm_enums_gen",
+        ":x86_enums_gen",
+        ":xcore_enums_gen",
+    ],
+)
+
+cc_library(
+    name = "Coroutines",
+    srcs = glob([
+        "lib/Transforms/Coroutines/*.c",
+        "lib/Transforms/Coroutines/*.cpp",
+        "lib/Transforms/Coroutines/*.inc",
+        "lib/Transforms/Coroutines/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/Coroutines/*.h",
+        "include/llvm/Transforms/Coroutines/*.def",
+        "include/llvm/Transforms/Coroutines/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":Core",
+        ":IPO",
+        ":Scalar",
+        ":Support",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Coverage",
+    srcs = glob([
+        "lib/ProfileData/Coverage/*.c",
+        "lib/ProfileData/Coverage/*.cpp",
+        "lib/ProfileData/Coverage/*.inc",
+        "lib/ProfileData/Coverage/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ProfileData/Coverage/*.h",
+        "include/llvm/ProfileData/Coverage/*.def",
+        "include/llvm/ProfileData/Coverage/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":Object",
+        ":ProfileData",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "DWARFLinker",
+    srcs = glob([
+        "lib/DWARFLinker/*.c",
+        "lib/DWARFLinker/*.cpp",
+        "lib/DWARFLinker/*.inc",
+        "lib/DWARFLinker/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/DWARFLinker/*.h",
+        "include/llvm/DWARFLinker/*.def",
+        "include/llvm/DWARFLinker/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":AsmPrinter",
+        ":CodeGen",
+        ":DebugInfoDWARF",
+        ":MC",
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "DebugInfoCodeView",
+    srcs = glob([
+        "lib/DebugInfo/CodeView/*.c",
+        "lib/DebugInfo/CodeView/*.cpp",
+        "lib/DebugInfo/CodeView/*.inc",
+        "lib/DebugInfo/CodeView/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/DebugInfo/CodeView/*.h",
+        "include/llvm/DebugInfo/CodeView/*.def",
+        "include/llvm/DebugInfo/CodeView/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":DebugInfoMSF",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "DebugInfoDWARF",
+    srcs = glob([
+        "lib/DebugInfo/DWARF/*.c",
+        "lib/DebugInfo/DWARF/*.cpp",
+        "lib/DebugInfo/DWARF/*.inc",
+        "lib/DebugInfo/DWARF/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/DebugInfo/DWARF/*.h",
+        "include/llvm/DebugInfo/DWARF/*.def",
+        "include/llvm/DebugInfo/DWARF/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":MC",
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "DebugInfoGSYM",
+    srcs = glob([
+        "lib/DebugInfo/GSYM/*.c",
+        "lib/DebugInfo/GSYM/*.cpp",
+        "lib/DebugInfo/GSYM/*.inc",
+        "lib/DebugInfo/GSYM/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/DebugInfo/GSYM/*.h",
+        "include/llvm/DebugInfo/GSYM/*.def",
+        "include/llvm/DebugInfo/GSYM/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":DebugInfoDWARF",
+        ":MC",
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "DebugInfoMSF",
+    srcs = glob([
+        "lib/DebugInfo/MSF/*.c",
+        "lib/DebugInfo/MSF/*.cpp",
+        "lib/DebugInfo/MSF/*.inc",
+        "lib/DebugInfo/MSF/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/DebugInfo/MSF/*.h",
+        "include/llvm/DebugInfo/MSF/*.def",
+        "include/llvm/DebugInfo/MSF/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "DebugInfoPDB",
+    srcs = glob([
+        "lib/DebugInfo/PDB/*.c",
+        "lib/DebugInfo/PDB/*.cpp",
+        "lib/DebugInfo/PDB/*.inc",
+        "lib/DebugInfo/PDB/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/DebugInfo/PDB/*.h",
+        "include/llvm/DebugInfo/PDB/*.def",
+        "include/llvm/DebugInfo/PDB/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":DebugInfoCodeView",
+        ":DebugInfoMSF",
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Demangle",
+    srcs = glob([
+        "lib/Demangle/*.c",
+        "lib/Demangle/*.cpp",
+        "lib/Demangle/*.inc",
+        "lib/Demangle/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Demangle/*.h",
+        "include/llvm/Demangle/*.def",
+        "include/llvm/Demangle/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [":config"],
+)
+
+cc_library(
+    name = "DlltoolDriver",
+    srcs = glob([
+        "lib/ToolDrivers/llvm-dlltool/*.c",
+        "lib/ToolDrivers/llvm-dlltool/*.cpp",
+        "lib/ToolDrivers/llvm-dlltool/*.inc",
+        "lib/ToolDrivers/llvm-dlltool/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ToolDrivers/llvm-dlltool/*.h",
+        "include/llvm/ToolDrivers/llvm-dlltool/*.def",
+        "include/llvm/ToolDrivers/llvm-dlltool/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Object",
+        ":Option",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ExecutionEngine",
+    srcs = glob([
+        "lib/ExecutionEngine/*.c",
+        "lib/ExecutionEngine/*.cpp",
+        "lib/ExecutionEngine/*.inc",
+        "lib/ExecutionEngine/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ExecutionEngine/*.h",
+        "include/llvm/ExecutionEngine/*.def",
+        "include/llvm/ExecutionEngine/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":MC",
+        ":Object",
+        ":RuntimeDyld",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Extensions",
+    srcs = glob([
+        "lib/Extensions/*.c",
+        "lib/Extensions/*.cpp",
+        "lib/Extensions/*.inc",
+        "lib/Extensions/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Extensions/*.h",
+        "include/llvm/Extensions/*.def",
+        "include/llvm/Extensions/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "FrontendOpenMP",
+    srcs = glob([
+        "lib/Frontend/OpenMP/*.c",
+        "lib/Frontend/OpenMP/*.cpp",
+        "lib/Frontend/OpenMP/*.inc",
+        "lib/Frontend/OpenMP/*.h",
+    ]) + ["include/llvm/Frontend/OpenMP/OMP.cpp"],
+    hdrs = glob([
+        "include/llvm/Frontend/OpenMP/*.h",
+        "include/llvm/Frontend/OpenMP/*.def",
+        "include/llvm/Frontend/OpenMP/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":Support",
+        ":TransformUtils",
+        ":config",
+        ":omp_gen",
+        ":omp_gen_impl",
+    ],
+)
+
+cc_library(
+    name = "FuzzMutate",
+    srcs = glob([
+        "lib/FuzzMutate/*.c",
+        "lib/FuzzMutate/*.cpp",
+        "lib/FuzzMutate/*.inc",
+        "lib/FuzzMutate/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/FuzzMutate/*.h",
+        "include/llvm/FuzzMutate/*.def",
+        "include/llvm/FuzzMutate/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":BitReader",
+        ":BitWriter",
+        ":Core",
+        ":Scalar",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "GlobalISel",
+    srcs = glob([
+        "lib/CodeGen/GlobalISel/*.c",
+        "lib/CodeGen/GlobalISel/*.cpp",
+        "lib/CodeGen/GlobalISel/*.inc",
+        "lib/CodeGen/GlobalISel/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/CodeGen/GlobalISel/*.h",
+        "include/llvm/CodeGen/GlobalISel/*.def",
+        "include/llvm/CodeGen/GlobalISel/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "HelloNew",
+    srcs = glob([
+        "lib/Transforms/HelloNew/*.c",
+        "lib/Transforms/HelloNew/*.cpp",
+        "lib/Transforms/HelloNew/*.inc",
+        "lib/Transforms/HelloNew/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/HelloNew/*.h",
+        "include/llvm/Transforms/HelloNew/*.def",
+        "include/llvm/Transforms/HelloNew/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "HexagonAsmParser",
+    srcs = glob([
+        "lib/Target/Hexagon/AsmParser/*.c",
+        "lib/Target/Hexagon/AsmParser/*.cpp",
+        "lib/Target/Hexagon/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Hexagon/AsmParser/*.h",
+        "include/llvm/Target/Hexagon/AsmParser/*.def",
+        "include/llvm/Target/Hexagon/AsmParser/*.inc",
+        "lib/Target/Hexagon/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Hexagon"],
+    deps = [
+        ":HexagonDesc",
+        ":HexagonInfo",
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "HexagonCodeGen",
+    srcs = glob([
+        "lib/Target/Hexagon/*.c",
+        "lib/Target/Hexagon/*.cpp",
+        "lib/Target/Hexagon/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Hexagon/*.h",
+        "include/llvm/Target/Hexagon/*.def",
+        "include/llvm/Target/Hexagon/*.inc",
+        "lib/Target/Hexagon/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Hexagon"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":HexagonAsmParser",
+        ":HexagonDesc",
+        ":HexagonInfo",
+        ":IPO",
+        ":MC",
+        ":Scalar",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "HexagonDesc",
+    srcs = glob([
+        "lib/Target/Hexagon/MCTargetDesc/*.c",
+        "lib/Target/Hexagon/MCTargetDesc/*.cpp",
+        "lib/Target/Hexagon/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Hexagon/MCTargetDesc/*.h",
+        "include/llvm/Target/Hexagon/MCTargetDesc/*.def",
+        "include/llvm/Target/Hexagon/MCTargetDesc/*.inc",
+        "lib/Target/Hexagon/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Hexagon"],
+    deps = [
+        ":HexagonInfo",
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "HexagonDisassembler",
+    srcs = glob([
+        "lib/Target/Hexagon/Disassembler/*.c",
+        "lib/Target/Hexagon/Disassembler/*.cpp",
+        "lib/Target/Hexagon/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Hexagon/Disassembler/*.h",
+        "include/llvm/Target/Hexagon/Disassembler/*.def",
+        "include/llvm/Target/Hexagon/Disassembler/*.inc",
+        "lib/Target/Hexagon/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Hexagon"],
+    deps = [
+        ":HexagonDesc",
+        ":HexagonInfo",
+        ":MC",
+        ":MCDisassembler",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "HexagonInfo",
+    srcs = glob([
+        "lib/Target/Hexagon/TargetInfo/*.c",
+        "lib/Target/Hexagon/TargetInfo/*.cpp",
+        "lib/Target/Hexagon/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Hexagon/TargetInfo/*.h",
+        "include/llvm/Target/Hexagon/TargetInfo/*.def",
+        "include/llvm/Target/Hexagon/TargetInfo/*.inc",
+        "lib/Target/Hexagon/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Hexagon"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "IPO",
+    srcs = glob([
+        "lib/Transforms/IPO/*.c",
+        "lib/Transforms/IPO/*.cpp",
+        "lib/Transforms/IPO/*.inc",
+        "include/llvm/Transforms/SampleProfile.h",
+        "include/llvm-c/Transforms/IPO.h",
+        "include/llvm-c/Transforms/PassManagerBuilder.h",
+        "lib/Transforms/IPO/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/IPO/*.h",
+        "include/llvm/Transforms/IPO/*.def",
+        "include/llvm/Transforms/IPO/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":AggressiveInstCombine",
+        ":Analysis",
+        ":BitReader",
+        ":BitWriter",
+        ":Core",
+        ":FrontendOpenMP",
+        ":IRReader",
+        ":InstCombine",
+        ":Instrumentation",
+        ":Linker",
+        ":Object",
+        ":ProfileData",
+        ":Scalar",
+        ":Support",
+        ":TransformUtils",
+        ":Vectorize",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "IRReader",
+    srcs = glob([
+        "lib/IRReader/*.c",
+        "lib/IRReader/*.cpp",
+        "lib/IRReader/*.inc",
+        "lib/IRReader/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/IRReader/*.h",
+        "include/llvm/IRReader/*.def",
+        "include/llvm/IRReader/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":AsmParser",
+        ":BitReader",
+        ":Core",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "InstCombine",
+    srcs = glob([
+        "lib/Transforms/InstCombine/*.c",
+        "lib/Transforms/InstCombine/*.cpp",
+        "lib/Transforms/InstCombine/*.inc",
+        "lib/Transforms/InstCombine/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/InstCombine/*.h",
+        "include/llvm/Transforms/InstCombine/*.def",
+        "include/llvm/Transforms/InstCombine/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":Core",
+        ":InstCombineTableGen",
+        ":Support",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Instrumentation",
+    srcs = glob([
+        "lib/Transforms/Instrumentation/*.c",
+        "lib/Transforms/Instrumentation/*.cpp",
+        "lib/Transforms/Instrumentation/*.inc",
+        "lib/Transforms/Instrumentation/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/Instrumentation/*.h",
+        "include/llvm/Transforms/Instrumentation/*.def",
+        "include/llvm/Transforms/Instrumentation/*.inc",
+        "include/llvm/Transforms/GCOVProfiler.h",
+        "include/llvm/Transforms/Instrumentation.h",
+        "include/llvm/Transforms/InstrProfiling.h",
+        "include/llvm/Transforms/PGOInstrumentation.h",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":Core",
+        ":MC",
+        ":ProfileData",
+        ":Support",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "InterfaceStub",
+    srcs = glob([
+        "lib/InterfaceStub/*.c",
+        "lib/InterfaceStub/*.cpp",
+        "lib/InterfaceStub/*.inc",
+        "lib/InterfaceStub/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/InterfaceStub/*.h",
+        "include/llvm/InterfaceStub/*.def",
+        "include/llvm/InterfaceStub/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Interpreter",
+    srcs = glob([
+        "lib/ExecutionEngine/Interpreter/*.c",
+        "lib/ExecutionEngine/Interpreter/*.cpp",
+        "lib/ExecutionEngine/Interpreter/*.inc",
+        "lib/ExecutionEngine/Interpreter/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ExecutionEngine/Interpreter/*.h",
+        "include/llvm/ExecutionEngine/Interpreter/*.def",
+        "include/llvm/ExecutionEngine/Interpreter/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":CodeGen",
+        ":Core",
+        ":ExecutionEngine",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "JITLink",
+    srcs = glob([
+        "lib/ExecutionEngine/JITLink/*.c",
+        "lib/ExecutionEngine/JITLink/*.cpp",
+        "lib/ExecutionEngine/JITLink/*.inc",
+        "lib/ExecutionEngine/JITLink/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ExecutionEngine/JITLink/*.h",
+        "include/llvm/ExecutionEngine/JITLink/*.def",
+        "include/llvm/ExecutionEngine/JITLink/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "LTO",
+    srcs = glob([
+        "lib/LTO/*.c",
+        "lib/LTO/*.cpp",
+        "lib/LTO/*.inc",
+        "lib/LTO/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/LTO/*.h",
+        "include/llvm/LTO/*.def",
+        "include/llvm/LTO/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":AggressiveInstCombine",
+        ":Analysis",
+        ":BinaryFormat",
+        ":BitReader",
+        ":BitWriter",
+        ":CodeGen",
+        ":Core",
+        ":Extensions",
+        ":IPO",
+        ":InstCombine",
+        ":Linker",
+        ":MC",
+        ":ObjCARC",
+        ":Object",
+        ":Passes",
+        ":Remarks",
+        ":Scalar",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "LanaiAsmParser",
+    srcs = glob([
+        "lib/Target/Lanai/AsmParser/*.c",
+        "lib/Target/Lanai/AsmParser/*.cpp",
+        "lib/Target/Lanai/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Lanai/AsmParser/*.h",
+        "include/llvm/Target/Lanai/AsmParser/*.def",
+        "include/llvm/Target/Lanai/AsmParser/*.inc",
+        "lib/Target/Lanai/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Lanai"],
+    deps = [
+        ":LanaiDesc",
+        ":LanaiInfo",
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "LanaiCodeGen",
+    srcs = glob([
+        "lib/Target/Lanai/*.c",
+        "lib/Target/Lanai/*.cpp",
+        "lib/Target/Lanai/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Lanai/*.h",
+        "include/llvm/Target/Lanai/*.def",
+        "include/llvm/Target/Lanai/*.inc",
+        "lib/Target/Lanai/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Lanai"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":LanaiAsmParser",
+        ":LanaiDesc",
+        ":LanaiInfo",
+        ":MC",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "LanaiDesc",
+    srcs = glob([
+        "lib/Target/Lanai/MCTargetDesc/*.c",
+        "lib/Target/Lanai/MCTargetDesc/*.cpp",
+        "lib/Target/Lanai/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Lanai/MCTargetDesc/*.h",
+        "include/llvm/Target/Lanai/MCTargetDesc/*.def",
+        "include/llvm/Target/Lanai/MCTargetDesc/*.inc",
+        "lib/Target/Lanai/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Lanai"],
+    deps = [
+        ":LanaiInfo",
+        ":MC",
+        ":MCDisassembler",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "LanaiDisassembler",
+    srcs = glob([
+        "lib/Target/Lanai/Disassembler/*.c",
+        "lib/Target/Lanai/Disassembler/*.cpp",
+        "lib/Target/Lanai/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Lanai/Disassembler/*.h",
+        "include/llvm/Target/Lanai/Disassembler/*.def",
+        "include/llvm/Target/Lanai/Disassembler/*.inc",
+        "lib/Target/Lanai/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Lanai"],
+    deps = [
+        ":LanaiDesc",
+        ":LanaiInfo",
+        ":MC",
+        ":MCDisassembler",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "LanaiInfo",
+    srcs = glob([
+        "lib/Target/Lanai/TargetInfo/*.c",
+        "lib/Target/Lanai/TargetInfo/*.cpp",
+        "lib/Target/Lanai/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Lanai/TargetInfo/*.h",
+        "include/llvm/Target/Lanai/TargetInfo/*.def",
+        "include/llvm/Target/Lanai/TargetInfo/*.inc",
+        "lib/Target/Lanai/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Lanai"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "LibDriver",
+    srcs = glob([
+        "lib/ToolDrivers/llvm-lib/*.c",
+        "lib/ToolDrivers/llvm-lib/*.cpp",
+        "lib/ToolDrivers/llvm-lib/*.inc",
+        "lib/ToolDrivers/llvm-lib/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ToolDrivers/llvm-lib/*.h",
+        "include/llvm/ToolDrivers/llvm-lib/*.def",
+        "include/llvm/ToolDrivers/llvm-lib/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":BitReader",
+        ":Object",
+        ":Option",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "LineEditor",
+    srcs = glob([
+        "lib/LineEditor/*.c",
+        "lib/LineEditor/*.cpp",
+        "lib/LineEditor/*.inc",
+        "lib/LineEditor/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/LineEditor/*.h",
+        "include/llvm/LineEditor/*.def",
+        "include/llvm/LineEditor/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Linker",
+    srcs = glob([
+        "lib/Linker/*.c",
+        "lib/Linker/*.cpp",
+        "lib/Linker/*.inc",
+        "lib/Linker/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Linker/*.h",
+        "include/llvm/Linker/*.def",
+        "include/llvm/Linker/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":Support",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MC",
+    srcs = glob([
+        "lib/MC/*.c",
+        "lib/MC/*.cpp",
+        "lib/MC/*.inc",
+        "lib/MC/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/MC/*.h",
+        "include/llvm/MC/*.def",
+        "include/llvm/MC/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":DebugInfoCodeView",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MCA",
+    srcs = glob([
+        "lib/MCA/*.c",
+        "lib/MCA/*.cpp",
+        "lib/MCA/*.inc",
+        "lib/MCA/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/MCA/*.h",
+        "include/llvm/MCA/*.def",
+        "include/llvm/MCA/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MCDisassembler",
+    srcs = glob([
+        "lib/MC/MCDisassembler/*.c",
+        "lib/MC/MCDisassembler/*.cpp",
+        "lib/MC/MCDisassembler/*.inc",
+        "lib/MC/MCDisassembler/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/MC/MCDisassembler/*.h",
+        "include/llvm/MC/MCDisassembler/*.def",
+        "include/llvm/MC/MCDisassembler/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MCJIT",
+    srcs = glob([
+        "lib/ExecutionEngine/MCJIT/*.c",
+        "lib/ExecutionEngine/MCJIT/*.cpp",
+        "lib/ExecutionEngine/MCJIT/*.inc",
+        "lib/ExecutionEngine/MCJIT/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ExecutionEngine/MCJIT/*.h",
+        "include/llvm/ExecutionEngine/MCJIT/*.def",
+        "include/llvm/ExecutionEngine/MCJIT/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":ExecutionEngine",
+        ":Object",
+        ":RuntimeDyld",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MCParser",
+    srcs = glob([
+        "lib/MC/MCParser/*.c",
+        "lib/MC/MCParser/*.cpp",
+        "lib/MC/MCParser/*.inc",
+        "lib/MC/MCParser/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/MC/MCParser/*.h",
+        "include/llvm/MC/MCParser/*.def",
+        "include/llvm/MC/MCParser/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MIRParser",
+    srcs = glob([
+        "lib/CodeGen/MIRParser/*.c",
+        "lib/CodeGen/MIRParser/*.cpp",
+        "lib/CodeGen/MIRParser/*.inc",
+        "lib/CodeGen/MIRParser/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/CodeGen/MIRParser/*.h",
+        "include/llvm/CodeGen/MIRParser/*.def",
+        "include/llvm/CodeGen/MIRParser/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":AsmParser",
+        ":BinaryFormat",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MSP430AsmParser",
+    srcs = glob([
+        "lib/Target/MSP430/AsmParser/*.c",
+        "lib/Target/MSP430/AsmParser/*.cpp",
+        "lib/Target/MSP430/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/MSP430/AsmParser/*.h",
+        "include/llvm/Target/MSP430/AsmParser/*.def",
+        "include/llvm/Target/MSP430/AsmParser/*.inc",
+        "lib/Target/MSP430/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/MSP430"],
+    deps = [
+        ":MC",
+        ":MCParser",
+        ":MSP430Desc",
+        ":MSP430Info",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MSP430CodeGen",
+    srcs = glob([
+        "lib/Target/MSP430/*.c",
+        "lib/Target/MSP430/*.cpp",
+        "lib/Target/MSP430/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/MSP430/*.h",
+        "include/llvm/Target/MSP430/*.def",
+        "include/llvm/Target/MSP430/*.inc",
+        "lib/Target/MSP430/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/MSP430"],
+    deps = [
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":MSP430Desc",
+        ":MSP430Info",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MSP430Desc",
+    srcs = glob([
+        "lib/Target/MSP430/MCTargetDesc/*.c",
+        "lib/Target/MSP430/MCTargetDesc/*.cpp",
+        "lib/Target/MSP430/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/MSP430/MCTargetDesc/*.h",
+        "include/llvm/Target/MSP430/MCTargetDesc/*.def",
+        "include/llvm/Target/MSP430/MCTargetDesc/*.inc",
+        "lib/Target/MSP430/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/MSP430"],
+    deps = [
+        ":MC",
+        ":MSP430Info",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MSP430Disassembler",
+    srcs = glob([
+        "lib/Target/MSP430/Disassembler/*.c",
+        "lib/Target/MSP430/Disassembler/*.cpp",
+        "lib/Target/MSP430/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/MSP430/Disassembler/*.h",
+        "include/llvm/Target/MSP430/Disassembler/*.def",
+        "include/llvm/Target/MSP430/Disassembler/*.inc",
+        "lib/Target/MSP430/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/MSP430"],
+    deps = [
+        ":MCDisassembler",
+        ":MSP430Info",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MSP430Info",
+    srcs = glob([
+        "lib/Target/MSP430/TargetInfo/*.c",
+        "lib/Target/MSP430/TargetInfo/*.cpp",
+        "lib/Target/MSP430/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/MSP430/TargetInfo/*.h",
+        "include/llvm/Target/MSP430/TargetInfo/*.def",
+        "include/llvm/Target/MSP430/TargetInfo/*.inc",
+        "lib/Target/MSP430/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/MSP430"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MipsAsmParser",
+    srcs = glob([
+        "lib/Target/Mips/AsmParser/*.c",
+        "lib/Target/Mips/AsmParser/*.cpp",
+        "lib/Target/Mips/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Mips/AsmParser/*.h",
+        "include/llvm/Target/Mips/AsmParser/*.def",
+        "include/llvm/Target/Mips/AsmParser/*.inc",
+        "lib/Target/Mips/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Mips"],
+    deps = [
+        ":MC",
+        ":MCParser",
+        ":MipsDesc",
+        ":MipsInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MipsCodeGen",
+    srcs = glob([
+        "lib/Target/Mips/*.c",
+        "lib/Target/Mips/*.cpp",
+        "lib/Target/Mips/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Mips/*.h",
+        "include/llvm/Target/Mips/*.def",
+        "include/llvm/Target/Mips/*.inc",
+        "lib/Target/Mips/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Mips"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":GlobalISel",
+        ":MC",
+        ":MipsDesc",
+        ":MipsInfo",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MipsDesc",
+    srcs = glob([
+        "lib/Target/Mips/MCTargetDesc/*.c",
+        "lib/Target/Mips/MCTargetDesc/*.cpp",
+        "lib/Target/Mips/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Mips/MCTargetDesc/*.h",
+        "include/llvm/Target/Mips/MCTargetDesc/*.def",
+        "include/llvm/Target/Mips/MCTargetDesc/*.inc",
+        "lib/Target/Mips/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Mips"],
+    deps = [
+        ":MC",
+        ":MipsInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MipsDisassembler",
+    srcs = glob([
+        "lib/Target/Mips/Disassembler/*.c",
+        "lib/Target/Mips/Disassembler/*.cpp",
+        "lib/Target/Mips/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Mips/Disassembler/*.h",
+        "include/llvm/Target/Mips/Disassembler/*.def",
+        "include/llvm/Target/Mips/Disassembler/*.inc",
+        "lib/Target/Mips/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Mips"],
+    deps = [
+        ":MCDisassembler",
+        ":MipsInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "MipsInfo",
+    srcs = glob([
+        "lib/Target/Mips/TargetInfo/*.c",
+        "lib/Target/Mips/TargetInfo/*.cpp",
+        "lib/Target/Mips/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Mips/TargetInfo/*.h",
+        "include/llvm/Target/Mips/TargetInfo/*.def",
+        "include/llvm/Target/Mips/TargetInfo/*.inc",
+        "lib/Target/Mips/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Mips"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "NVPTXCodeGen",
+    srcs = glob([
+        "lib/Target/NVPTX/*.c",
+        "lib/Target/NVPTX/*.cpp",
+        "lib/Target/NVPTX/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/NVPTX/*.h",
+        "include/llvm/Target/NVPTX/*.def",
+        "include/llvm/Target/NVPTX/*.inc",
+        "lib/Target/NVPTX/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/NVPTX"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":IPO",
+        ":MC",
+        ":NVPTXDesc",
+        ":NVPTXInfo",
+        ":Scalar",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":Vectorize",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "NVPTXDesc",
+    srcs = glob([
+        "lib/Target/NVPTX/MCTargetDesc/*.c",
+        "lib/Target/NVPTX/MCTargetDesc/*.cpp",
+        "lib/Target/NVPTX/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/NVPTX/MCTargetDesc/*.h",
+        "include/llvm/Target/NVPTX/MCTargetDesc/*.def",
+        "include/llvm/Target/NVPTX/MCTargetDesc/*.inc",
+        "lib/Target/NVPTX/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/NVPTX"],
+    deps = [
+        ":MC",
+        ":NVPTXCommonTableGen",
+        ":NVPTXInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "NVPTXInfo",
+    srcs = glob([
+        "lib/Target/NVPTX/TargetInfo/*.c",
+        "lib/Target/NVPTX/TargetInfo/*.cpp",
+        "lib/Target/NVPTX/TargetInfo/*.inc",
+        "lib/Target/NVPTX/MCTargetDesc/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/NVPTX/TargetInfo/*.h",
+        "include/llvm/Target/NVPTX/TargetInfo/*.def",
+        "include/llvm/Target/NVPTX/TargetInfo/*.inc",
+        "lib/Target/NVPTX/NVPTX.h",
+        "lib/Target/NVPTX/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/NVPTX"],
+    deps = [
+        ":Core",
+        ":NVPTXCommonTableGen",
+        ":Support",
+        ":Target",
+        ":attributes_gen",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ObjCARC",
+    srcs = glob([
+        "lib/Transforms/ObjCARC/*.c",
+        "lib/Transforms/ObjCARC/*.cpp",
+        "lib/Transforms/ObjCARC/*.inc",
+        "include/llvm/Transforms/ObjCARC.h",
+        "lib/Transforms/ObjCARC/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/ObjCARC/*.h",
+        "include/llvm/Transforms/ObjCARC/*.def",
+        "include/llvm/Transforms/ObjCARC/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":Core",
+        ":Support",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Object",
+    srcs = glob([
+        "lib/Object/*.c",
+        "lib/Object/*.cpp",
+        "lib/Object/*.inc",
+        "lib/Object/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Object/*.h",
+        "include/llvm/Object/*.def",
+        "include/llvm/Object/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":BitReader",
+        ":Core",
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":TextAPI",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ObjectYAML",
+    srcs = glob([
+        "lib/ObjectYAML/*.c",
+        "lib/ObjectYAML/*.cpp",
+        "lib/ObjectYAML/*.inc",
+        "lib/ObjectYAML/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ObjectYAML/*.h",
+        "include/llvm/ObjectYAML/*.def",
+        "include/llvm/ObjectYAML/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":DebugInfoCodeView",
+        ":MC",
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Option",
+    srcs = glob([
+        "lib/Option/*.c",
+        "lib/Option/*.cpp",
+        "lib/Option/*.inc",
+        "lib/Option/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Option/*.h",
+        "include/llvm/Option/*.def",
+        "include/llvm/Option/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "OrcError",
+    srcs = glob([
+        "lib/ExecutionEngine/OrcError/*.c",
+        "lib/ExecutionEngine/OrcError/*.cpp",
+        "lib/ExecutionEngine/OrcError/*.inc",
+        "lib/ExecutionEngine/OrcError/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ExecutionEngine/OrcError/*.h",
+        "include/llvm/ExecutionEngine/OrcError/*.def",
+        "include/llvm/ExecutionEngine/OrcError/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "OrcJIT",
+    srcs = glob([
+        "lib/ExecutionEngine/Orc/*.c",
+        "lib/ExecutionEngine/Orc/*.cpp",
+        "lib/ExecutionEngine/Orc/*.inc",
+        "lib/ExecutionEngine/Orc/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ExecutionEngine/Orc/*.h",
+        "include/llvm/ExecutionEngine/Orc/*.def",
+        "include/llvm/ExecutionEngine/Orc/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":ExecutionEngine",
+        ":JITLink",
+        ":MC",
+        ":Object",
+        ":OrcError",
+        ":Passes",
+        ":RuntimeDyld",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Passes",
+    srcs = glob([
+        "lib/Passes/*.c",
+        "lib/Passes/*.cpp",
+        "lib/Passes/*.inc",
+        "lib/Passes/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Passes/*.h",
+        "include/llvm/Passes/*.def",
+        "include/llvm/Passes/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":AggressiveInstCombine",
+        ":Analysis",
+        ":CodeGen",
+        ":Core",
+        ":Coroutines",
+        ":HelloNew",
+        ":IPO",
+        ":InstCombine",
+        ":Instrumentation",
+        ":ObjCARC",
+        ":Scalar",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":Vectorize",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "PowerPCAsmParser",
+    srcs = glob([
+        "lib/Target/PowerPC/AsmParser/*.c",
+        "lib/Target/PowerPC/AsmParser/*.cpp",
+        "lib/Target/PowerPC/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/PowerPC/AsmParser/*.h",
+        "include/llvm/Target/PowerPC/AsmParser/*.def",
+        "include/llvm/Target/PowerPC/AsmParser/*.inc",
+        "lib/Target/PowerPC/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/PowerPC"],
+    deps = [
+        ":MC",
+        ":MCParser",
+        ":PowerPCDesc",
+        ":PowerPCInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "PowerPCCodeGen",
+    srcs = glob([
+        "lib/Target/PowerPC/*.c",
+        "lib/Target/PowerPC/*.cpp",
+        "lib/Target/PowerPC/*.inc",
+        "lib/Target/PowerPC/GISel/*.cpp",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/PowerPC/*.h",
+        "include/llvm/Target/PowerPC/*.def",
+        "include/llvm/Target/PowerPC/*.inc",
+        "lib/Target/PowerPC/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/PowerPC"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":GlobalISel",
+        ":MC",
+        ":PowerPCDesc",
+        ":PowerPCInfo",
+        ":Scalar",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "PowerPCDesc",
+    srcs = glob([
+        "lib/Target/PowerPC/MCTargetDesc/*.c",
+        "lib/Target/PowerPC/MCTargetDesc/*.cpp",
+        "lib/Target/PowerPC/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/PowerPC/MCTargetDesc/*.h",
+        "include/llvm/Target/PowerPC/MCTargetDesc/*.def",
+        "include/llvm/Target/PowerPC/MCTargetDesc/*.inc",
+        "lib/Target/PowerPC/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/PowerPC"],
+    deps = [
+        ":BinaryFormat",
+        ":MC",
+        ":PowerPCCommonTableGen",
+        ":PowerPCInfo",
+        ":Support",
+        ":attributes_gen",
+        ":config",
+        ":intrinsic_enums_gen",
+        ":intrinsics_impl_gen",
+    ],
+)
+
+cc_library(
+    name = "PowerPCDisassembler",
+    srcs = glob([
+        "lib/Target/PowerPC/Disassembler/*.c",
+        "lib/Target/PowerPC/Disassembler/*.cpp",
+        "lib/Target/PowerPC/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/PowerPC/Disassembler/*.h",
+        "include/llvm/Target/PowerPC/Disassembler/*.def",
+        "include/llvm/Target/PowerPC/Disassembler/*.inc",
+        "lib/Target/PowerPC/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/PowerPC"],
+    deps = [
+        ":MCDisassembler",
+        ":PowerPCInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "PowerPCInfo",
+    srcs = glob([
+        "lib/Target/PowerPC/TargetInfo/*.c",
+        "lib/Target/PowerPC/TargetInfo/*.cpp",
+        "lib/Target/PowerPC/TargetInfo/*.inc",
+        "lib/Target/PowerPC/MCTargetDesc/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/PowerPC/TargetInfo/*.h",
+        "include/llvm/Target/PowerPC/TargetInfo/*.def",
+        "include/llvm/Target/PowerPC/TargetInfo/*.inc",
+        "lib/Target/PowerPC/PPC*.h",
+        "lib/Target/PowerPC/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/PowerPC"],
+    deps = [
+        ":Core",
+        ":PowerPCCommonTableGen",
+        ":Support",
+        ":Target",
+        ":attributes_gen",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "ProfileData",
+    srcs = glob([
+        "lib/ProfileData/*.c",
+        "lib/ProfileData/*.cpp",
+        "lib/ProfileData/*.inc",
+        "lib/ProfileData/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ProfileData/*.h",
+        "include/llvm/ProfileData/*.def",
+        "include/llvm/ProfileData/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":Demangle",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "RISCVAsmParser",
+    srcs = glob([
+        "lib/Target/RISCV/AsmParser/*.c",
+        "lib/Target/RISCV/AsmParser/*.cpp",
+        "lib/Target/RISCV/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/RISCV/AsmParser/*.h",
+        "include/llvm/Target/RISCV/AsmParser/*.def",
+        "include/llvm/Target/RISCV/AsmParser/*.inc",
+        "lib/Target/RISCV/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/RISCV"],
+    deps = [
+        ":MC",
+        ":MCParser",
+        ":RISCVDesc",
+        ":RISCVInfo",
+        ":RISCVUtils",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "RISCVCodeGen",
+    srcs = glob([
+        "lib/Target/RISCV/*.c",
+        "lib/Target/RISCV/*.cpp",
+        "lib/Target/RISCV/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/RISCV/*.h",
+        "include/llvm/Target/RISCV/*.def",
+        "include/llvm/Target/RISCV/*.inc",
+        "lib/Target/RISCV/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/RISCV"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":GlobalISel",
+        ":MC",
+        ":RISCVDesc",
+        ":RISCVInfo",
+        ":RISCVUtils",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "RISCVDesc",
+    srcs = glob([
+        "lib/Target/RISCV/MCTargetDesc/*.c",
+        "lib/Target/RISCV/MCTargetDesc/*.cpp",
+        "lib/Target/RISCV/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/RISCV/MCTargetDesc/*.h",
+        "include/llvm/Target/RISCV/MCTargetDesc/*.def",
+        "include/llvm/Target/RISCV/MCTargetDesc/*.inc",
+        "lib/Target/RISCV/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/RISCV"],
+    deps = [
+        ":MC",
+        ":RISCVInfo",
+        ":RISCVUtils",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "RISCVDisassembler",
+    srcs = glob([
+        "lib/Target/RISCV/Disassembler/*.c",
+        "lib/Target/RISCV/Disassembler/*.cpp",
+        "lib/Target/RISCV/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/RISCV/Disassembler/*.h",
+        "include/llvm/Target/RISCV/Disassembler/*.def",
+        "include/llvm/Target/RISCV/Disassembler/*.inc",
+        "lib/Target/RISCV/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/RISCV"],
+    deps = [
+        ":MCDisassembler",
+        ":RISCVInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "RISCVInfo",
+    srcs = glob([
+        "lib/Target/RISCV/TargetInfo/*.c",
+        "lib/Target/RISCV/TargetInfo/*.cpp",
+        "lib/Target/RISCV/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/RISCV/TargetInfo/*.h",
+        "include/llvm/Target/RISCV/TargetInfo/*.def",
+        "include/llvm/Target/RISCV/TargetInfo/*.inc",
+        "lib/Target/RISCV/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/RISCV"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "RISCVUtils",
+    srcs = glob([
+        "lib/Target/RISCV/Utils/*.c",
+        "lib/Target/RISCV/Utils/*.cpp",
+        "lib/Target/RISCV/Utils/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/RISCV/Utils/*.h",
+        "include/llvm/Target/RISCV/Utils/*.def",
+        "include/llvm/Target/RISCV/Utils/*.inc",
+        "lib/Target/RISCV/Utils/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/RISCV"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Remarks",
+    srcs = glob([
+        "lib/Remarks/*.c",
+        "lib/Remarks/*.cpp",
+        "lib/Remarks/*.inc",
+        "lib/Remarks/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Remarks/*.h",
+        "include/llvm/Remarks/*.def",
+        "include/llvm/Remarks/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":BitstreamReader",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "RuntimeDyld",
+    srcs = glob([
+        "lib/ExecutionEngine/RuntimeDyld/*.c",
+        "lib/ExecutionEngine/RuntimeDyld/*.cpp",
+        "lib/ExecutionEngine/RuntimeDyld/*.inc",
+        "include/llvm/ExecutionEngine/JITSymbol.h",
+        "include/llvm/ExecutionEngine/RTDyldMemoryManager.h",
+        "lib/ExecutionEngine/RuntimeDyld/*.h",
+        "lib/ExecutionEngine/RuntimeDyld/Targets/*.h",
+        "lib/ExecutionEngine/RuntimeDyld/Targets/*.cpp",
+        "lib/ExecutionEngine/RuntimeDyld/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/ExecutionEngine/RuntimeDyld/*.h",
+        "include/llvm/ExecutionEngine/RuntimeDyld/*.def",
+        "include/llvm/ExecutionEngine/RuntimeDyld/*.inc",
+        "include/llvm/DebugInfo/DIContext.h",
+        "include/llvm/ExecutionEngine/RTDyldMemoryManager.h",
+        "include/llvm/ExecutionEngine/RuntimeDyld*.h",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Core",
+        ":MC",
+        ":MCDisassembler",
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Scalar",
+    srcs = glob([
+        "lib/Transforms/Scalar/*.c",
+        "lib/Transforms/Scalar/*.cpp",
+        "lib/Transforms/Scalar/*.inc",
+        "include/llvm-c/Transforms/Scalar.h",
+        "include/llvm/Transforms/Scalar.h",
+        "include/llvm/Target/TargetMachine.h",
+        "lib/Transforms/Scalar/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/Scalar/*.h",
+        "include/llvm/Transforms/Scalar/*.def",
+        "include/llvm/Transforms/Scalar/*.inc",
+        "include/llvm/Transforms/IPO.h",
+        "include/llvm/Transforms/IPO/SCCP.h",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":AggressiveInstCombine",
+        ":Analysis",
+        ":Core",
+        ":InstCombine",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SelectionDAG",
+    srcs = glob([
+        "lib/CodeGen/SelectionDAG/*.c",
+        "lib/CodeGen/SelectionDAG/*.cpp",
+        "lib/CodeGen/SelectionDAG/*.inc",
+        "lib/CodeGen/SelectionDAG/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/CodeGen/SelectionDAG/*.h",
+        "include/llvm/CodeGen/SelectionDAG/*.def",
+        "include/llvm/CodeGen/SelectionDAG/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SparcAsmParser",
+    srcs = glob([
+        "lib/Target/Sparc/AsmParser/*.c",
+        "lib/Target/Sparc/AsmParser/*.cpp",
+        "lib/Target/Sparc/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Sparc/AsmParser/*.h",
+        "include/llvm/Target/Sparc/AsmParser/*.def",
+        "include/llvm/Target/Sparc/AsmParser/*.inc",
+        "lib/Target/Sparc/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Sparc"],
+    deps = [
+        ":MC",
+        ":MCParser",
+        ":SparcDesc",
+        ":SparcInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SparcCodeGen",
+    srcs = glob([
+        "lib/Target/Sparc/*.c",
+        "lib/Target/Sparc/*.cpp",
+        "lib/Target/Sparc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Sparc/*.h",
+        "include/llvm/Target/Sparc/*.def",
+        "include/llvm/Target/Sparc/*.inc",
+        "lib/Target/Sparc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Sparc"],
+    deps = [
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":SelectionDAG",
+        ":SparcDesc",
+        ":SparcInfo",
+        ":Support",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SparcDesc",
+    srcs = glob([
+        "lib/Target/Sparc/MCTargetDesc/*.c",
+        "lib/Target/Sparc/MCTargetDesc/*.cpp",
+        "lib/Target/Sparc/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Sparc/MCTargetDesc/*.h",
+        "include/llvm/Target/Sparc/MCTargetDesc/*.def",
+        "include/llvm/Target/Sparc/MCTargetDesc/*.inc",
+        "lib/Target/Sparc/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Sparc"],
+    deps = [
+        ":MC",
+        ":SparcInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SparcDisassembler",
+    srcs = glob([
+        "lib/Target/Sparc/Disassembler/*.c",
+        "lib/Target/Sparc/Disassembler/*.cpp",
+        "lib/Target/Sparc/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Sparc/Disassembler/*.h",
+        "include/llvm/Target/Sparc/Disassembler/*.def",
+        "include/llvm/Target/Sparc/Disassembler/*.inc",
+        "lib/Target/Sparc/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Sparc"],
+    deps = [
+        ":MCDisassembler",
+        ":SparcInfo",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SparcInfo",
+    srcs = glob([
+        "lib/Target/Sparc/TargetInfo/*.c",
+        "lib/Target/Sparc/TargetInfo/*.cpp",
+        "lib/Target/Sparc/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/Sparc/TargetInfo/*.h",
+        "include/llvm/Target/Sparc/TargetInfo/*.def",
+        "include/llvm/Target/Sparc/TargetInfo/*.inc",
+        "lib/Target/Sparc/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/Sparc"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Support",
+    srcs = glob([
+        "lib/Support/*.c",
+        "lib/Support/*.cpp",
+        "lib/Support/*.inc",
+        "include/llvm-c/*.h",
+        "include/llvm/CodeGen/MachineValueType.h",
+        "include/llvm/BinaryFormat/COFF.h",
+        "include/llvm/BinaryFormat/MachO.h",
+        "lib/Support/*.h",
+    ]) + llvm_support_platform_specific_srcs_glob(),
+    hdrs = glob([
+        "include/llvm/Support/*.h",
+        "include/llvm/Support/*.def",
+        "include/llvm/Support/*.inc",
+        "include/llvm/ADT/*.h",
+        "include/llvm/Support/ELFRelocs/*.def",
+        "include/llvm/Support/WasmRelocs/*.def",
+    ]) + [
+        "include/llvm/BinaryFormat/MachO.def",
+        "include/llvm/Support/VCSRevision.h",
+    ],
+    copts = llvm_copts,
+    deps = [
+        ":Demangle",
+        ":config",
+        "@zlib",
+    ],
+)
+
+cc_library(
+    name = "Symbolize",
+    srcs = glob([
+        "lib/DebugInfo/Symbolize/*.c",
+        "lib/DebugInfo/Symbolize/*.cpp",
+        "lib/DebugInfo/Symbolize/*.inc",
+        "lib/DebugInfo/Symbolize/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/DebugInfo/Symbolize/*.h",
+        "include/llvm/DebugInfo/Symbolize/*.def",
+        "include/llvm/DebugInfo/Symbolize/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":DebugInfoDWARF",
+        ":DebugInfoPDB",
+        ":Demangle",
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SystemZAsmParser",
+    srcs = glob([
+        "lib/Target/SystemZ/AsmParser/*.c",
+        "lib/Target/SystemZ/AsmParser/*.cpp",
+        "lib/Target/SystemZ/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/SystemZ/AsmParser/*.h",
+        "include/llvm/Target/SystemZ/AsmParser/*.def",
+        "include/llvm/Target/SystemZ/AsmParser/*.inc",
+        "lib/Target/SystemZ/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/SystemZ"],
+    deps = [
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":SystemZDesc",
+        ":SystemZInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SystemZCodeGen",
+    srcs = glob([
+        "lib/Target/SystemZ/*.c",
+        "lib/Target/SystemZ/*.cpp",
+        "lib/Target/SystemZ/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/SystemZ/*.h",
+        "include/llvm/Target/SystemZ/*.def",
+        "include/llvm/Target/SystemZ/*.inc",
+        "lib/Target/SystemZ/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/SystemZ"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":Scalar",
+        ":SelectionDAG",
+        ":Support",
+        ":SystemZDesc",
+        ":SystemZInfo",
+        ":Target",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SystemZDesc",
+    srcs = glob([
+        "lib/Target/SystemZ/MCTargetDesc/*.c",
+        "lib/Target/SystemZ/MCTargetDesc/*.cpp",
+        "lib/Target/SystemZ/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/SystemZ/MCTargetDesc/*.h",
+        "include/llvm/Target/SystemZ/MCTargetDesc/*.def",
+        "include/llvm/Target/SystemZ/MCTargetDesc/*.inc",
+        "lib/Target/SystemZ/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/SystemZ"],
+    deps = [
+        ":MC",
+        ":Support",
+        ":SystemZCommonTableGen",
+        ":SystemZInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SystemZDisassembler",
+    srcs = glob([
+        "lib/Target/SystemZ/Disassembler/*.c",
+        "lib/Target/SystemZ/Disassembler/*.cpp",
+        "lib/Target/SystemZ/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/SystemZ/Disassembler/*.h",
+        "include/llvm/Target/SystemZ/Disassembler/*.def",
+        "include/llvm/Target/SystemZ/Disassembler/*.inc",
+        "lib/Target/SystemZ/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/SystemZ"],
+    deps = [
+        ":MC",
+        ":MCDisassembler",
+        ":Support",
+        ":SystemZDesc",
+        ":SystemZInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "SystemZInfo",
+    srcs = glob([
+        "lib/Target/SystemZ/TargetInfo/*.c",
+        "lib/Target/SystemZ/TargetInfo/*.cpp",
+        "lib/Target/SystemZ/TargetInfo/*.inc",
+        "lib/Target/SystemZ/MCTargetDesc/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/SystemZ/TargetInfo/*.h",
+        "include/llvm/Target/SystemZ/TargetInfo/*.def",
+        "include/llvm/Target/SystemZ/TargetInfo/*.inc",
+        "lib/Target/SystemZ/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/SystemZ"],
+    deps = [
+        ":Support",
+        ":SystemZCommonTableGen",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "TableGen",
+    srcs = glob([
+        "lib/TableGen/*.c",
+        "lib/TableGen/*.cpp",
+        "lib/TableGen/*.inc",
+        "include/llvm/CodeGen/*.h",
+        "lib/TableGen/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/TableGen/*.h",
+        "include/llvm/TableGen/*.def",
+        "include/llvm/TableGen/*.inc",
+        "include/llvm/Target/*.def",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Target",
+    srcs = glob([
+        "lib/Target/*.c",
+        "lib/Target/*.cpp",
+        "lib/Target/*.inc",
+        "include/llvm/CodeGen/*.h",
+        "include/llvm-c/Initialization.h",
+        "include/llvm-c/Target.h",
+        "lib/Target/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/*.h",
+        "include/llvm/Target/*.def",
+        "include/llvm/Target/*.inc",
+        "include/llvm/CodeGen/*.def",
+        "include/llvm/CodeGen/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":Core",
+        ":MC",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "TestingSupport",
+    srcs = glob([
+        "lib/Testing/Support/*.c",
+        "lib/Testing/Support/*.cpp",
+        "lib/Testing/Support/*.inc",
+        "lib/Testing/Support/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Testing/Support/*.h",
+        "include/llvm/Testing/Support/*.def",
+        "include/llvm/Testing/Support/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "TextAPI",
+    srcs = glob([
+        "lib/TextAPI/*.c",
+        "lib/TextAPI/*.cpp",
+        "lib/TextAPI/*.inc",
+        "lib/TextAPI/ELF/*.cpp",
+        "lib/TextAPI/MachO/*.cpp",
+        "lib/TextAPI/MachO/*.h",
+        "lib/TextAPI/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/TextAPI/*.h",
+        "include/llvm/TextAPI/*.def",
+        "include/llvm/TextAPI/*.inc",
+    ]) + [
+        "include/llvm/TextAPI/MachO/Architecture.def",
+        "include/llvm/TextAPI/MachO/PackedVersion.h",
+        "include/llvm/TextAPI/MachO/InterfaceFile.h",
+        "include/llvm/TextAPI/MachO/Symbol.h",
+        "include/llvm/TextAPI/MachO/ArchitectureSet.h",
+        "include/llvm/TextAPI/MachO/TextAPIWriter.h",
+        "include/llvm/TextAPI/MachO/TextAPIReader.h",
+        "include/llvm/TextAPI/MachO/Architecture.h",
+    ],
+    copts = llvm_copts,
+    deps = [
+        ":BinaryFormat",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "TransformUtils",
+    srcs = glob([
+        "lib/Transforms/Utils/*.c",
+        "lib/Transforms/Utils/*.cpp",
+        "lib/Transforms/Utils/*.inc",
+        "include/llvm/Transforms/IPO.h",
+        "include/llvm/Transforms/Scalar.h",
+        "lib/Transforms/Utils/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/Utils/*.h",
+        "include/llvm/Transforms/Utils/*.def",
+        "include/llvm/Transforms/Utils/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":Core",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "VEAsmParser",
+    srcs = glob([
+        "lib/Target/VE/AsmParser/*.c",
+        "lib/Target/VE/AsmParser/*.cpp",
+        "lib/Target/VE/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/VE/AsmParser/*.h",
+        "include/llvm/Target/VE/AsmParser/*.def",
+        "include/llvm/Target/VE/AsmParser/*.inc",
+        "lib/Target/VE/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/VE"],
+    deps = [
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":VEDesc",
+        ":VEInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "VECodeGen",
+    srcs = glob([
+        "lib/Target/VE/*.c",
+        "lib/Target/VE/*.cpp",
+        "lib/Target/VE/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/VE/*.h",
+        "include/llvm/Target/VE/*.def",
+        "include/llvm/Target/VE/*.inc",
+        "lib/Target/VE/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/VE"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":VEDesc",
+        ":VEInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "VEDesc",
+    srcs = glob([
+        "lib/Target/VE/MCTargetDesc/*.c",
+        "lib/Target/VE/MCTargetDesc/*.cpp",
+        "lib/Target/VE/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/VE/MCTargetDesc/*.h",
+        "include/llvm/Target/VE/MCTargetDesc/*.def",
+        "include/llvm/Target/VE/MCTargetDesc/*.inc",
+        "lib/Target/VE/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/VE"],
+    deps = [
+        ":MC",
+        ":Support",
+        ":VEInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "VEDisassembler",
+    srcs = glob([
+        "lib/Target/VE/Disassembler/*.c",
+        "lib/Target/VE/Disassembler/*.cpp",
+        "lib/Target/VE/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/VE/Disassembler/*.h",
+        "include/llvm/Target/VE/Disassembler/*.def",
+        "include/llvm/Target/VE/Disassembler/*.inc",
+        "lib/Target/VE/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/VE"],
+    deps = [
+        ":MCDisassembler",
+        ":Support",
+        ":VEInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "VEInfo",
+    srcs = glob([
+        "lib/Target/VE/TargetInfo/*.c",
+        "lib/Target/VE/TargetInfo/*.cpp",
+        "lib/Target/VE/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/VE/TargetInfo/*.h",
+        "include/llvm/Target/VE/TargetInfo/*.def",
+        "include/llvm/Target/VE/TargetInfo/*.inc",
+        "lib/Target/VE/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/VE"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "Vectorize",
+    srcs = glob([
+        "lib/Transforms/Vectorize/*.c",
+        "lib/Transforms/Vectorize/*.cpp",
+        "lib/Transforms/Vectorize/*.inc",
+        "include/llvm-c/Transforms/Vectorize.h",
+        "lib/Transforms/Vectorize/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Transforms/Vectorize/*.h",
+        "include/llvm/Transforms/Vectorize/*.def",
+        "include/llvm/Transforms/Vectorize/*.inc",
+        "include/llvm/Transforms/Vectorize.h",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Analysis",
+        ":Core",
+        ":Scalar",
+        ":Support",
+        ":TransformUtils",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "WebAssemblyAsmParser",
+    srcs = glob([
+        "lib/Target/WebAssembly/AsmParser/*.c",
+        "lib/Target/WebAssembly/AsmParser/*.cpp",
+        "lib/Target/WebAssembly/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/WebAssembly/AsmParser/*.h",
+        "include/llvm/Target/WebAssembly/AsmParser/*.def",
+        "include/llvm/Target/WebAssembly/AsmParser/*.inc",
+        "lib/Target/WebAssembly/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/WebAssembly"],
+    deps = [
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":WebAssemblyInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "WebAssemblyCodeGen",
+    srcs = glob([
+        "lib/Target/WebAssembly/*.c",
+        "lib/Target/WebAssembly/*.cpp",
+        "lib/Target/WebAssembly/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/WebAssembly/*.h",
+        "include/llvm/Target/WebAssembly/*.def",
+        "include/llvm/Target/WebAssembly/*.inc",
+        "lib/Target/WebAssembly/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/WebAssembly"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":BinaryFormat",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":Scalar",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":WebAssemblyDesc",
+        ":WebAssemblyInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "WebAssemblyDesc",
+    srcs = glob([
+        "lib/Target/WebAssembly/MCTargetDesc/*.c",
+        "lib/Target/WebAssembly/MCTargetDesc/*.cpp",
+        "lib/Target/WebAssembly/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/WebAssembly/MCTargetDesc/*.h",
+        "include/llvm/Target/WebAssembly/MCTargetDesc/*.def",
+        "include/llvm/Target/WebAssembly/MCTargetDesc/*.inc",
+        "lib/Target/WebAssembly/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/WebAssembly"],
+    deps = [
+        ":MC",
+        ":Support",
+        ":WebAssemblyInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "WebAssemblyDisassembler",
+    srcs = glob([
+        "lib/Target/WebAssembly/Disassembler/*.c",
+        "lib/Target/WebAssembly/Disassembler/*.cpp",
+        "lib/Target/WebAssembly/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/WebAssembly/Disassembler/*.h",
+        "include/llvm/Target/WebAssembly/Disassembler/*.def",
+        "include/llvm/Target/WebAssembly/Disassembler/*.inc",
+        "lib/Target/WebAssembly/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/WebAssembly"],
+    deps = [
+        ":MC",
+        ":MCDisassembler",
+        ":Support",
+        ":WebAssemblyDesc",
+        ":WebAssemblyInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "WebAssemblyInfo",
+    srcs = glob([
+        "lib/Target/WebAssembly/TargetInfo/*.c",
+        "lib/Target/WebAssembly/TargetInfo/*.cpp",
+        "lib/Target/WebAssembly/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/WebAssembly/TargetInfo/*.h",
+        "include/llvm/Target/WebAssembly/TargetInfo/*.def",
+        "include/llvm/Target/WebAssembly/TargetInfo/*.inc",
+        "lib/Target/WebAssembly/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/WebAssembly"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "WindowsManifest",
+    srcs = glob([
+        "lib/WindowsManifest/*.c",
+        "lib/WindowsManifest/*.cpp",
+        "lib/WindowsManifest/*.inc",
+        "lib/WindowsManifest/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/WindowsManifest/*.h",
+        "include/llvm/WindowsManifest/*.def",
+        "include/llvm/WindowsManifest/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "X86AsmParser",
+    srcs = glob([
+        "lib/Target/X86/AsmParser/*.c",
+        "lib/Target/X86/AsmParser/*.cpp",
+        "lib/Target/X86/AsmParser/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/X86/AsmParser/*.h",
+        "include/llvm/Target/X86/AsmParser/*.def",
+        "include/llvm/Target/X86/AsmParser/*.inc",
+        "lib/Target/X86/AsmParser/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/X86"],
+    deps = [
+        ":MC",
+        ":MCParser",
+        ":Support",
+        ":X86Desc",
+        ":X86Info",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "X86CodeGen",
+    srcs = glob([
+        "lib/Target/X86/*.c",
+        "lib/Target/X86/*.cpp",
+        "lib/Target/X86/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/X86/*.h",
+        "include/llvm/Target/X86/*.def",
+        "include/llvm/Target/X86/*.inc",
+        "lib/Target/X86/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/X86"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CFGuard",
+        ":CodeGen",
+        ":Core",
+        ":GlobalISel",
+        ":MC",
+        ":ProfileData",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":X86Desc",
+        ":X86Info",
+        ":config",
+        ":x86_defs",
+    ],
+)
+
+cc_library(
+    name = "X86Desc",
+    srcs = glob([
+        "lib/Target/X86/MCTargetDesc/*.c",
+        "lib/Target/X86/MCTargetDesc/*.cpp",
+        "lib/Target/X86/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/X86/MCTargetDesc/*.h",
+        "include/llvm/Target/X86/MCTargetDesc/*.def",
+        "include/llvm/Target/X86/MCTargetDesc/*.inc",
+        "lib/Target/X86/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/X86"],
+    deps = [
+        ":BinaryFormat",
+        ":MC",
+        ":MCDisassembler",
+        ":Support",
+        ":X86Info",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "X86Disassembler",
+    srcs = glob([
+        "lib/Target/X86/Disassembler/*.c",
+        "lib/Target/X86/Disassembler/*.cpp",
+        "lib/Target/X86/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/X86/Disassembler/*.h",
+        "include/llvm/Target/X86/Disassembler/*.def",
+        "include/llvm/Target/X86/Disassembler/*.inc",
+        "lib/Target/X86/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/X86"],
+    deps = [
+        ":MCDisassembler",
+        ":Support",
+        ":X86Info",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "X86Info",
+    srcs = glob([
+        "lib/Target/X86/TargetInfo/*.c",
+        "lib/Target/X86/TargetInfo/*.cpp",
+        "lib/Target/X86/TargetInfo/*.inc",
+        "lib/Target/X86/MCTargetDesc/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/X86/TargetInfo/*.h",
+        "include/llvm/Target/X86/TargetInfo/*.def",
+        "include/llvm/Target/X86/TargetInfo/*.inc",
+        "lib/Target/X86/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/X86"],
+    deps = [
+        ":MC",
+        ":Support",
+        ":X86CommonTableGen",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "XCoreCodeGen",
+    srcs = glob([
+        "lib/Target/XCore/*.c",
+        "lib/Target/XCore/*.cpp",
+        "lib/Target/XCore/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/XCore/*.h",
+        "include/llvm/Target/XCore/*.def",
+        "include/llvm/Target/XCore/*.inc",
+        "lib/Target/XCore/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/XCore"],
+    deps = [
+        ":Analysis",
+        ":AsmPrinter",
+        ":CodeGen",
+        ":Core",
+        ":MC",
+        ":SelectionDAG",
+        ":Support",
+        ":Target",
+        ":TransformUtils",
+        ":XCoreDesc",
+        ":XCoreInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "XCoreDesc",
+    srcs = glob([
+        "lib/Target/XCore/MCTargetDesc/*.c",
+        "lib/Target/XCore/MCTargetDesc/*.cpp",
+        "lib/Target/XCore/MCTargetDesc/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/XCore/MCTargetDesc/*.h",
+        "include/llvm/Target/XCore/MCTargetDesc/*.def",
+        "include/llvm/Target/XCore/MCTargetDesc/*.inc",
+        "lib/Target/XCore/MCTargetDesc/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/XCore"],
+    deps = [
+        ":MC",
+        ":Support",
+        ":XCoreInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "XCoreDisassembler",
+    srcs = glob([
+        "lib/Target/XCore/Disassembler/*.c",
+        "lib/Target/XCore/Disassembler/*.cpp",
+        "lib/Target/XCore/Disassembler/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/XCore/Disassembler/*.h",
+        "include/llvm/Target/XCore/Disassembler/*.def",
+        "include/llvm/Target/XCore/Disassembler/*.inc",
+        "lib/Target/XCore/Disassembler/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/XCore"],
+    deps = [
+        ":MCDisassembler",
+        ":Support",
+        ":XCoreInfo",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "XCoreInfo",
+    srcs = glob([
+        "lib/Target/XCore/TargetInfo/*.c",
+        "lib/Target/XCore/TargetInfo/*.cpp",
+        "lib/Target/XCore/TargetInfo/*.inc",
+    ]),
+    hdrs = glob([
+        "include/llvm/Target/XCore/TargetInfo/*.h",
+        "include/llvm/Target/XCore/TargetInfo/*.def",
+        "include/llvm/Target/XCore/TargetInfo/*.inc",
+        "lib/Target/XCore/TargetInfo/*.h",
+    ]),
+    copts = llvm_copts + ["-Iexternal/llvm-project/llvm/lib/Target/XCore"],
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "XRay",
+    srcs = glob([
+        "lib/XRay/*.c",
+        "lib/XRay/*.cpp",
+        "lib/XRay/*.inc",
+        "lib/XRay/*.h",
+    ]),
+    hdrs = glob([
+        "include/llvm/XRay/*.h",
+        "include/llvm/XRay/*.def",
+        "include/llvm/XRay/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Object",
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "gtest",
+    srcs = glob([
+        "utils/unittest/*.c",
+        "utils/unittest/*.cpp",
+        "utils/unittest/*.inc",
+        "utils/unittest/*.h",
+    ]),
+    hdrs = glob([
+        "utils/unittest/*.h",
+        "utils/unittest/*.def",
+        "utils/unittest/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":Support",
+        ":config",
+    ],
+)
+
+cc_library(
+    name = "gtest_main",
+    srcs = glob([
+        "utils/unittest/*.c",
+        "utils/unittest/*.cpp",
+        "utils/unittest/*.inc",
+        "utils/unittest/*.h",
+    ]),
+    hdrs = glob([
+        "utils/unittest/*.h",
+        "utils/unittest/*.def",
+        "utils/unittest/*.inc",
+    ]),
+    copts = llvm_copts,
+    deps = [
+        ":config",
+        ":gtest",
+    ],
+)
diff --git a/build_tools/bazel/third_party_import/llvm-project/overlay/mlir/BUILD.bazel b/build_tools/bazel/third_party_import/llvm-project/overlay/mlir/BUILD.bazel
new file mode 100644
index 0000000..1c82ec2
--- /dev/null
+++ b/build_tools/bazel/third_party_import/llvm-project/overlay/mlir/BUILD.bazel
@@ -0,0 +1,4050 @@
+# Description:
+#   The MLIR "Multi-Level Intermediate Representation" Compiler Infrastructure
+
+load("@org_tensorflow//third_party/mlir:tblgen.bzl", "gentbl")
+load("@org_tensorflow//third_party/mlir:linalggen.bzl", "genlinalg")
+
+package(
+    default_visibility = [":friends"],
+    licenses = ["notice"],
+)
+
+package_group(
+    name = "subpackages",
+    packages = ["//..."],
+)
+
+package_group(
+    name = "friends",
+    packages = ["//..."],
+)
+
+exports_files([
+    "LICENSE.TXT",
+    "include/mlir/Dialect/LLVMIR/LLVMOps.td",
+    "run_lit.sh",
+])
+
+[
+    gentbl(
+        name = name + "IncGen",
+        strip_include_prefix = "include",
+        tbl_outs = [
+            (
+                "-gen-op-interface-decls",
+                "include/mlir/IR/" + name + ".h.inc",
+            ),
+            (
+                "-gen-op-interface-defs",
+                "include/mlir/IR/" + name + ".cpp.inc",
+            ),
+        ],
+        tblgen = ":mlir-tblgen",
+        td_file = "include/mlir/IR/" + name + ".td",
+        td_srcs = [
+            ":OpBaseTdFiles",
+        ],
+    )
+    for name in [
+        "OpAsmInterface",
+        "RegionKindInterface",
+        "SymbolInterfaces",
+    ]
+]
+
+cc_library(
+    name = "IR",
+    srcs = glob([
+        "lib/IR/*.cpp",
+        "lib/IR/*.h",
+    ]),
+    hdrs = glob([
+        "include/mlir/IR/*.h",
+    ]) + [
+        "include/mlir/Interfaces/CallInterfaces.h",
+        "include/mlir/Interfaces/DecodeAttributesInterfaces.h",
+        "include/mlir/Interfaces/FoldInterfaces.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":CallOpInterfacesIncGen",
+        ":InferTypeOpInterfaceIncGen",
+        ":OpAsmInterfaceIncGen",
+        ":RegionKindInterfaceIncGen",
+        ":SideEffectInterfacesIncGen",
+        ":Support",
+        ":SymbolInterfacesIncGen",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "Pass",
+    srcs = glob([
+        "lib/Pass/*.cpp",
+        "lib/Pass/*.h",
+    ]),
+    hdrs = glob([
+        "include/mlir/Pass/*.h",
+    ]),
+    includes = ["include"],
+    linkopts = [
+        "-lm",
+        "-lpthread",
+    ],
+    deps = [
+        ":IR",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+# TODO(ntv): Update these to enable simplifying the cmake and build files.
+cc_library(
+    name = "EDSC",
+    srcs = [
+        "lib/EDSC/Builders.cpp",
+    ],
+    hdrs = [
+        "include/mlir-c/Core.h",
+        "include/mlir/EDSC/Builders.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "CAPIIR",
+    srcs = [
+        "lib/CAPI/IR/AffineMap.cpp",
+        "lib/CAPI/IR/IR.cpp",
+        "lib/CAPI/IR/StandardAttributes.cpp",
+        "lib/CAPI/IR/StandardTypes.cpp",
+        "lib/CAPI/IR/Support.cpp",
+        "lib/CAPI/Standard/StandardDialect.cpp",
+    ],
+    hdrs = [
+        "include/mlir-c/AffineMap.h",
+        "include/mlir-c/IR.h",
+        "include/mlir-c/StandardAttributes.h",
+        "include/mlir-c/StandardDialect.h",
+        "include/mlir-c/StandardTypes.h",
+        "include/mlir-c/Support.h",
+        "include/mlir/CAPI/AffineMap.h",
+        "include/mlir/CAPI/IR.h",
+        "include/mlir/CAPI/Support.h",
+        "include/mlir/CAPI/Utils.h",
+        "include/mlir/CAPI/Wrap.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":Parser",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "MLIRBindingsPythonExtension",
+    hdrs = [
+        "include/mlir-c/Bindings/Python/Interop.h",
+    ],
+    deps = [
+        ":CAPIIR",
+        "//third_party/python_runtime:headers",
+    ],
+)
+
+cc_library(
+    name = "CAPIRegistration",
+    srcs = [
+        "lib/CAPI/Registration/Registration.cpp",
+    ],
+    hdrs = [
+        "include/mlir-c/Registration.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":AllPassesAndDialectsNoRegistration",
+        ":CAPIIR",
+    ],
+)
+
+filegroup(
+    name = "OpBaseTdFiles",
+    srcs = [
+        "include/mlir/Dialect/StandardOps/IR/StandardOpsBase.td",
+        "include/mlir/IR/OpBase.td",
+    ],
+)
+
+##---------------------------------------------------------------------------##
+# Affine dialect.
+##---------------------------------------------------------------------------##
+
+filegroup(
+    name = "PassBaseTdFiles",
+    srcs = [
+        "include/mlir/Pass/PassBase.td",
+    ],
+)
+
+filegroup(
+    name = "AffineOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td",
+        "include/mlir/Dialect/Affine/IR/AffineOps.td",
+        "include/mlir/Interfaces/ControlFlowInterfaces.td",
+        "include/mlir/Interfaces/LoopLikeInterface.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "AffineOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/Affine/IR/AffineOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/Affine/IR/AffineOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/Affine/IR/AffineOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Affine/IR/AffineOps.td",
+    td_srcs = [
+        ":AffineOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "AffineMemoryOpInterfacesIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td",
+    td_srcs = [
+        ":AffineOpsTdFiles",
+    ],
+)
+
+##---------------------------------------------------------------------------##
+# Async dialect.
+##---------------------------------------------------------------------------##
+
+filegroup(
+    name = "AsyncOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/Async/IR/AsyncBase.td",
+        "include/mlir/Dialect/Async/IR/AsyncOps.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "AsyncOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/Async/IR/AsyncOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/Async/IR/AsyncOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/Async/IR/AsyncOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Async/IR/AsyncOps.td",
+    td_srcs = [
+        ":AsyncOpsTdFiles",
+    ],
+)
+
+##---------------------------------------------------------------------------##
+# AVX512 dialect.
+##---------------------------------------------------------------------------##
+
+filegroup(
+    name = "AVX512TdFiles",
+    srcs = [
+        "include/mlir/Dialect/AVX512/AVX512.td",
+        "include/mlir/Dialect/LLVMIR/LLVMOpBase.td",
+        "include/mlir/IR/OpBase.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+    ],
+)
+
+gentbl(
+    name = "AVX512IncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-dialect-decls -dialect=avx512",
+            "include/mlir/Dialect/AVX512/AVX512Dialect.h.inc",
+        ),
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/AVX512/AVX512.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/AVX512/AVX512.cpp.inc",
+        ),
+        (
+            "-gen-op-doc",
+            "g3doc/Dialects/AVX512/AVX512.md",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/AVX512/AVX512.td",
+    td_srcs = [
+        ":AVX512TdFiles",
+    ],
+)
+
+cc_library(
+    name = "AVX512",
+    srcs = [
+        "lib/Dialect/AVX512/IR/AVX512Dialect.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Dialect/AVX512/AVX512Dialect.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":AVX512IncGen",
+        ":IR",
+        ":SideEffectInterfaces",
+        ":VectorOps",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "AVX512ToLLVM",
+    srcs = glob([
+        "lib/Conversion/AVX512ToLLVM/*.cpp",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob([
+        "include/mlir/Conversion/AVX512ToLLVM/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":AVX512",
+        ":ConversionPassIncGen",
+        ":EDSC",
+        ":IR",
+        ":LLVMAVX512",
+        ":LLVMDialect",
+        ":Pass",
+        ":StandardOps",
+        ":StandardToLLVM",
+        ":Support",
+        ":Transforms",
+        ":VectorOps",
+        ":VectorToLLVM",
+        ":VectorToSCF",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "SCFTdFiles",
+    srcs = [
+        "include/mlir/Dialect/SCF/SCFOps.td",
+        "include/mlir/Interfaces/ControlFlowInterfaces.td",
+        "include/mlir/Interfaces/LoopLikeInterface.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "SCFIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/SCF/SCFOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/SCF/SCFOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/SCF/SCFOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SCF/SCFOps.td",
+    td_srcs = [
+        ":SCFTdFiles",
+    ],
+)
+
+gentbl(
+    name = "SCFPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-pass-decls -name SCF",
+            "include/mlir/Dialect/SCF/Passes.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SCF/Passes.td",
+    td_srcs = [
+        ":PassBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "SCFTransforms",
+    srcs = glob([
+        "lib/Dialect/SCF/Transforms/*.cpp",
+        "lib/Dialect/SCF/Transforms/*.h",
+    ]),
+    hdrs = ["include/mlir/Dialect/SCF/Passes.h"],
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":IR",
+        ":Pass",
+        ":SCFDialect",
+        ":SCFPassIncGen",
+        ":StandardOps",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "StdOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/StandardOps/IR/Ops.td",
+        "include/mlir/IR/OpAsmInterface.td",
+        "include/mlir/Interfaces/CallInterfaces.td",
+        "include/mlir/Interfaces/ControlFlowInterfaces.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        "include/mlir/Interfaces/VectorInterfaces.td",
+        "include/mlir/Interfaces/ViewLikeInterface.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "StandardOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/StandardOps/IR/Ops.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/StandardOps/IR/Ops.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/StandardOps/IR/OpsDialect.h.inc",
+        ),
+        (
+            "-gen-enum-decls",
+            "include/mlir/Dialect/StandardOps/IR/OpsEnums.h.inc",
+        ),
+        (
+            "-gen-enum-defs",
+            "include/mlir/Dialect/StandardOps/IR/OpsEnums.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/StandardOps/IR/Ops.td",
+    td_srcs = [
+        ":StdOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "Dialect",
+    srcs = glob([
+        "lib/Dialect/*.cpp",
+        "lib/Dialect/*.h",
+    ]),
+    hdrs = glob([
+        "include/mlir/Dialect/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":IR",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "DialectUtils",
+    srcs = glob([
+        "lib/Dialect/Utils/*.cpp",
+        "lib/Dialect/Utils/*.h",
+    ]),
+    hdrs = glob([
+        "include/mlir/Dialect/Utils/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "Affine",
+    srcs = glob(
+        [
+            "lib/Dialect/Affine/IR/*.cpp",
+            "lib/Dialect/Affine/IR/*.h",
+            "lib/Dialect/Affine/EDSC/*.cpp",
+        ],
+    ) + [
+        "include/mlir/Transforms/InliningUtils.h",
+    ],
+    hdrs = glob([
+        "include/mlir/Dialect/Affine/IR/*.h",
+        "include/mlir/Dialect/Affine/EDSC/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":AffineMemoryOpInterfacesIncGen",
+        ":AffineOpsIncGen",
+        ":EDSC",
+        ":IR",
+        ":LoopLikeInterface",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "Async",
+    srcs = glob([
+        "lib/Dialect/Async/IR/*.cpp",
+    ]),
+    hdrs = glob([
+        "include/mlir/Dialect/Async/IR/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":AsyncOpsIncGen",
+        ":Dialect",
+        ":IR",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "AffineUtils",
+    srcs = glob(
+        [
+            "lib/Dialect/Affine/Utils/*.cpp",
+            "lib/Dialect/Affine/Utils/*.h",
+        ],
+    ),
+    hdrs = ["include/mlir/Dialect/Affine/Utils.h"],
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":IR",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "AffinePassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-pass-decls -name Affine",
+            "include/mlir/Dialect/Affine/Passes.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Affine/Passes.td",
+    td_srcs = [
+        ":PassBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "AffineTransforms",
+    srcs = glob([
+        "lib/Dialect/Affine/Transforms/*.cpp",
+        "lib/Dialect/Affine/Transforms/*.h",
+    ]),
+    hdrs = [
+        "include/mlir/Dialect/Affine/Passes.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":AffinePassIncGen",
+        ":AffineUtils",
+        ":Analysis",
+        ":IR",
+        ":Pass",
+        ":SCFDialect",
+        ":StandardOps",
+        ":Support",
+        ":Transforms",
+        ":VectorOps",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "ConversionPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-pass-decls -name Conversion",
+            "include/mlir/Conversion/Passes.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Conversion/Passes.td",
+    td_srcs = [
+        ":PassBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "ConversionPasses",
+    hdrs = ["include/mlir/Conversion/Passes.h"],
+    includes = ["include"],
+    deps = [
+        ":AVX512ToLLVM",
+        ":AffineToStandard",
+        ":ConversionPassIncGen",
+        ":GPUToGPURuntimeTransforms",
+        ":GPUToNVVMTransforms",
+        ":GPUToROCDLTransforms",
+        ":GPUToSPIRVTransforms",
+        ":GPUToVulkanTransforms",
+        ":LinalgToLLVM",
+        ":LinalgToSPIRV",
+        ":LinalgToStandard",
+        ":OpenMPToLLVM",
+        ":SCFToGPUPass",
+        ":SCFToStandard",
+        ":SPIRVToLLVM",
+        ":ShapeToStandard",
+        ":StandardToLLVM",
+        ":StandardToSPIRVTransforms",
+        ":VectorToLLVM",
+        ":VectorToROCDL",
+        ":VectorToSCF",
+        ":VectorToSPIRV",
+    ],
+)
+
+cc_library(
+    name = "AffineToStandard",
+    srcs = glob([
+        "lib/Conversion/AffineToStandard/*.cpp",
+        "lib/Conversion/AffineToStandard/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob(["include/mlir/Conversion/AffineToStandard/*.h"]),
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":ConversionPassIncGen",
+        ":IR",
+        ":Pass",
+        ":SCFDialect",
+        ":StandardOps",
+        ":Support",
+        ":Transforms",
+        ":VectorOps",
+    ],
+)
+
+alias(
+    name = "AffineToStandardTransforms",
+    actual = "AffineToStandard",
+)
+
+# SDBM dialect only contains attribute components that can be constructed given
+# a dialect object, so whenever it is used it must also be registered. Therefore
+# we don't split out the registration library for it.
+cc_library(
+    name = "SDBM",
+    srcs = glob([
+        "lib/Dialect/SDBM/*.cpp",
+        "lib/Dialect/SDBM/*.h",
+    ]),
+    hdrs = glob([
+        "include/mlir/Dialect/SDBM/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "SCFDialect",
+    srcs = glob(
+        [
+            "lib/Dialect/SCF/*.cpp",
+            "lib/Dialect/SCF/*.h",
+            "lib/Dialect/SCF/EDSC/*.cpp",
+        ],
+    ),
+    hdrs = glob([
+        "include/mlir/Dialect/SCF/*.h",
+        "include/mlir/Dialect/SCF/EDSC/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":ControlFlowInterfaces",
+        ":EDSC",
+        ":IR",
+        ":LoopLikeInterface",
+        ":Pass",
+        ":SCFIncGen",
+        ":SCFPassIncGen",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "LoopLikeInterface",
+    srcs = ["lib/Interfaces/LoopLikeInterface.cpp"],
+    hdrs = ["include/mlir/Interfaces/LoopLikeInterface.h"],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":LoopLikeInterfaceIncGen",
+    ],
+)
+
+cc_library(
+    name = "VectorInterfaces",
+    srcs = ["lib/Interfaces/VectorInterfaces.cpp"],
+    hdrs = ["include/mlir/Interfaces/VectorInterfaces.h"],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":VectorInterfacesIncGen",
+    ],
+)
+
+cc_library(
+    name = "ViewLikeInterface",
+    srcs = ["lib/Interfaces/ViewLikeInterface.cpp"],
+    hdrs = ["include/mlir/Interfaces/ViewLikeInterface.h"],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":ViewLikeInterfaceIncGen",
+    ],
+)
+
+cc_library(
+    name = "CopyOpInterface",
+    srcs = ["lib/Interfaces/CopyOpInterface.cpp"],
+    hdrs = ["include/mlir/Interfaces/CopyOpInterface.h"],
+    includes = ["include"],
+    deps = [
+        ":CopyOpInterfaceIncGen",
+        ":IR",
+    ],
+)
+
+gentbl(
+    name = "ShapeOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/Shape/IR/ShapeOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/Shape/IR/ShapeOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/Shape/IR/ShapeOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Shape/IR/ShapeOps.td",
+    td_srcs = [
+        ":StdOpsTdFiles",
+        "include/mlir/Dialect/Shape/IR/ShapeBase.td",
+        "include/mlir/Interfaces/InferTypeOpInterface.td",
+    ],
+)
+
+gentbl(
+    name = "MLIRShapeCanonicalizationIncGen",
+    strip_include_prefix = "include/mlir/Dialect/Shape/IR",
+    tbl_outs = [
+        (
+            "-gen-rewriters",
+            "include/mlir/Dialect/Shape/IR/ShapeCanonicalization.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "lib/Dialect/Shape/IR/ShapeCanonicalization.td",
+    td_srcs = [
+        ":StdOpsTdFiles",
+        "include/mlir/Dialect/Shape/IR/ShapeBase.td",
+        "include/mlir/Dialect/Shape/IR/ShapeOps.td",
+        "include/mlir/Interfaces/InferTypeOpInterface.td",
+    ],
+)
+
+cc_library(
+    name = "Shape",
+    srcs = glob(["lib/Dialect/Shape/IR/*.cpp"]),
+    hdrs = ["include/mlir/Dialect/Shape/IR/Shape.h"],
+    includes = ["include"],
+    deps = [
+        ":CallOpInterfaces",
+        ":CommonFolders",
+        ":ControlFlowInterfaces",
+        ":Dialect",
+        ":IR",
+        ":InferTypeOpInterface",
+        ":MLIRShapeCanonicalizationIncGen",
+        ":ShapeOpsIncGen",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "ShapeToStandard",
+    srcs = glob([
+        "lib/Conversion/ShapeToStandard/*.cpp",
+        "lib/Conversion/ShapeToStandard/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = ["include/mlir/Conversion/ShapeToStandard/ShapeToStandard.h"],
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":IR",
+        ":Pass",
+        ":SCFDialect",
+        ":Shape",
+        ":StandardOps",
+        ":Support",
+        ":Transforms",
+    ],
+)
+
+gentbl(
+    name = "ShapeTransformsPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [(
+        "-gen-pass-decls -name Shape",
+        "include/mlir/Dialect/Shape/Transforms/Passes.h.inc",
+    )],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Shape/Transforms/Passes.td",
+    td_srcs = [":PassBaseTdFiles"],
+)
+
+cc_library(
+    name = "ShapeTransforms",
+    srcs = glob([
+        "lib/Dialect/Shape/Transforms/*.cpp",
+        "lib/Dialect/Shape/Transforms/*.h",
+    ]),
+    hdrs = ["include/mlir/Dialect/Shape/Transforms/Passes.h"],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":Pass",
+        ":Shape",
+        ":ShapeTransformsPassIncGen",
+        ":StandardOps",
+        ":Transforms",
+    ],
+)
+
+cc_library(
+    name = "StandardOps",
+    srcs = glob(
+        [
+            "lib/Dialect/StandardOps/IR/*.cpp",
+            "lib/Dialect/StandardOps/IR/*.h",
+            "lib/Dialect/StandardOps/EDSC/*.cpp",
+        ],
+    ),
+    hdrs = glob([
+        "include/mlir/Dialect/StandardOps/IR/*.h",
+        "include/mlir/Dialect/StandardOps/EDSC/*.h",
+    ]) + ["include/mlir/Transforms/InliningUtils.h"],
+    includes = ["include"],
+    deps = [
+        ":CallOpInterfaces",
+        ":CommonFolders",
+        ":ControlFlowInterfaces",
+        ":EDSC",
+        ":IR",
+        ":SideEffectInterfaces",
+        ":StandardOpsIncGen",
+        ":Support",
+        ":VectorInterfaces",
+        ":ViewLikeInterface",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "StandardOpsTransformsPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [(
+        "-gen-pass-decls -name Standard",
+        "include/mlir/Dialect/StandardOps/Transforms/Passes.h.inc",
+    )],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/StandardOps/Transforms/Passes.td",
+    td_srcs = [":PassBaseTdFiles"],
+)
+
+cc_library(
+    name = "StandardOpsTransforms",
+    srcs = glob([
+        "lib/Dialect/StandardOps/Transforms/*.cpp",
+        "lib/Dialect/StandardOps/Transforms/*.h",
+    ]),
+    hdrs = glob(["include/mlir/Dialect/StandardOps/Transforms/*.h"]),
+    includes = ["include"],
+    deps = [
+        ":Analysis",
+        ":ControlFlowInterfaces",
+        ":IR",
+        ":Pass",
+        ":StandardOps",
+        ":StandardOpsTransformsPassIncGen",
+        ":Support",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "VectorOps",
+    srcs = glob(
+        [
+            "lib/Dialect/Vector/*.cpp",
+            "lib/Dialect/Vector/*.h",
+            "lib/Dialect/Vector/EDSC/*.cpp",
+            "lib/Dialect/Vector/EDSC/*.h",
+        ],
+    ),
+    hdrs = glob([
+        "include/mlir/Dialect/Vector/*.h",
+        "include/mlir/Dialect/Vector/EDSC/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":Analysis",
+        ":DialectUtils",
+        ":EDSC",
+        ":IR",
+        ":LinalgOps",
+        ":SCFDialect",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        ":VectorInterfaces",
+        ":VectorOpsIncGen",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "Support",
+    srcs = glob(
+        [
+            "lib/Support/*.cpp",
+            "lib/Support/*.h",
+        ],
+        exclude = [
+            # TODO(jpienaar): Move this out, else Support depends on Analysis/
+            "lib/Support/MlirOptMain.cpp",
+        ],
+    ),
+    hdrs = glob(
+        [
+            "include/mlir/Support/*.h",
+        ],
+        exclude = [
+            "include/mlir/Support/MlirOptMain.h",
+        ],
+    ),
+    includes = ["include"],
+    deps = [
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "ParserTokenKinds",
+    # strip_include_prefix does not apply to textual_hdrs.
+    hdrs = ["lib/Parser/TokenKinds.def"],
+    strip_include_prefix = "lib/Parser",
+    textual_hdrs = ["lib/Parser/TokenKinds.def"],
+)
+
+cc_library(
+    name = "Parser",
+    srcs = glob([
+        "lib/Parser/*.cpp",
+        "lib/Parser/*.h",
+    ]),
+    hdrs = [
+        "include/mlir/Parser.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":ParserTokenKinds",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "LLVMAVX512TdFiles",
+    srcs = [
+        "include/mlir/Dialect/LLVMIR/LLVMAVX512.td",
+        ":LLVMOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "LLVMAVX512IncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-dialect-decls -dialect=llvm_avx512",
+            "include/mlir/Dialect/LLVMIR/LLVMAVX512Dialect.h.inc",
+        ),
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/LLVMIR/LLVMAVX512.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/LLVMIR/LLVMAVX512.cpp.inc",
+        ),
+        (
+            "-gen-op-doc",
+            "g3doc/Dialects/LLVMIR/LLVMAVX512.md",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/LLVMIR/LLVMAVX512.td",
+    td_srcs = [
+        ":LLVMAVX512TdFiles",
+    ],
+)
+
+cc_library(
+    name = "LLVMAVX512",
+    srcs = [
+        "lib/Dialect/LLVMIR/IR/LLVMAVX512Dialect.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Dialect/LLVMIR/LLVMAVX512Dialect.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":LLVMAVX512IncGen",
+        ":LLVMDialect",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "LLVMAVX512ConversionIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-llvmir-conversions",
+            "include/mlir/Dialect/LLVMIR/LLVMAVX512Conversions.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/LLVMIR/LLVMAVX512.td",
+    td_srcs = [
+        ":LLVMAVX512TdFiles",
+    ],
+)
+
+cc_library(
+    name = "TargetLLVMAVX512Intr",
+    srcs = [
+        "lib/Target/LLVMIR/LLVMAVX512Intr.cpp",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":LLVMAVX512",
+        ":LLVMAVX512ConversionIncGen",
+        ":LLVMIRModuleTranslation",
+        ":Translation",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "LLVMDialect",
+    srcs = glob(
+        [
+            "lib/Dialect/LLVMIR/IR/*.cpp",
+            "lib/Dialect/LLVMIR/IR/*.h",
+        ],
+        exclude = [
+            "lib/Dialect/LLVMIR/IR/*AVX512*.cpp",
+            "lib/Dialect/LLVMIR/IR/*AVX512*.h",
+            "lib/Dialect/LLVMIR/IR/NVVM*.cpp",
+            "lib/Dialect/LLVMIR/IR/NVVM*.h",
+            "lib/Dialect/LLVMIR/IR/ROCDL*.cpp",
+            "lib/Dialect/LLVMIR/IR/ROCDL*.h",
+        ],
+    ),
+    hdrs = glob(
+        [
+            "include/mlir/Dialect/LLVMIR/*.h",
+        ],
+        exclude = [
+            "include/mlir/Dialect/LLVMIR/*AVX512*.h",
+            "include/mlir/Dialect/LLVMIR/NVVM*.h",
+            "include/mlir/Dialect/LLVMIR/ROCDL*.h",
+        ],
+    ),
+    includes = ["include"],
+    deps = [
+        ":ControlFlowInterfaces",
+        ":IR",
+        ":LLVMOpsIncGen",
+        ":OpenMPDialect",
+        ":SideEffectInterfaces",
+        ":Support",
+        "@llvm-project//llvm:AsmParser",
+        "@llvm-project//llvm:BitReader",
+        "@llvm-project//llvm:BitWriter",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "LLVMPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-pass-decls -name LLVM",
+            "include/mlir/Dialect/LLVMIR/Transforms/Passes.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/LLVMIR/Transforms/Passes.td",
+    td_srcs = [
+        ":PassBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "LLVMIRTransforms",
+    srcs = glob([
+        "lib/Dialect/LLVMIR/Transforms/*.cpp",
+        "lib/Dialect/LLVMIR/Transforms/*.h",
+    ]),
+    hdrs = glob(["include/mlir/Dialect/LLVMIR/Transforms/*.h"]),
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":LLVMDialect",
+        ":LLVMPassIncGen",
+        ":Pass",
+    ],
+)
+
+filegroup(
+    name = "GPUOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/GPU/GPUBase.td",
+        "include/mlir/Dialect/GPU/GPUOps.td",
+        "include/mlir/Dialect/LLVMIR/LLVMOpBase.td",
+        "include/mlir/IR/SymbolInterfaces.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "ParallelLoopMapperAttrGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-struct-attr-decls",
+            "include/mlir/Dialect/GPU/ParallelLoopMapperAttr.h.inc",
+        ),
+        (
+            "-gen-struct-attr-defs",
+            "include/mlir/Dialect/GPU/ParallelLoopMapperAttr.cpp.inc",
+        ),
+        (
+            "-gen-enum-decls",
+            "include/mlir/Dialect/GPU/ParallelLoopMapperEnums.h.inc",
+        ),
+        (
+            "-gen-enum-defs",
+            "include/mlir/Dialect/GPU/ParallelLoopMapperEnums.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/GPU/ParallelLoopMapperAttr.td",
+    td_srcs = [
+        ":GPUOpsTdFiles",
+        ":AffineOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "GPUOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/GPU/GPUOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/GPU/GPUOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls -dialect=gpu",
+            "include/mlir/Dialect/GPU/GPUOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/GPU/GPUOps.td",
+    td_srcs = [
+        ":GPUOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "GPUDialect",
+    srcs = glob(
+        [
+            "lib/Dialect/GPU/IR/*.cpp",
+            "lib/Dialect/GPU/IR/*.h",
+        ],
+    ),
+    hdrs = glob([
+        "include/mlir/Dialect/GPU/GPUDialect.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":GPUOpsIncGen",
+        ":IR",
+        ":LLVMDialect",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+    ],
+)
+
+gentbl(
+    name = "GPUPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-pass-decls -name GPU",
+            "include/mlir/Dialect/GPU/Passes.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/GPU/Passes.td",
+    td_srcs = [
+        ":PassBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "GPUTransforms",
+    srcs = glob(
+        [
+            "lib/Dialect/GPU/Transforms/*.cpp",
+            "lib/Dialect/GPU/Transforms/*.h",
+        ],
+    ),
+    hdrs = [
+        "include/mlir/Dialect/GPU/MemoryPromotion.h",
+        "include/mlir/Dialect/GPU/ParallelLoopMapper.h",
+        "include/mlir/Dialect/GPU/Passes.h",
+        "include/mlir/Dialect/GPU/Utils.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":EDSC",
+        ":GPUDialect",
+        ":GPUPassIncGen",
+        ":IR",
+        ":ParallelLoopMapperAttrGen",
+        ":Pass",
+        ":SCFDialect",
+        ":StandardOps",
+        ":Support",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "LLVMOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/LLVMIR/LLVMOpBase.td",
+        "include/mlir/Dialect/LLVMIR/LLVMOps.td",
+        "include/mlir/IR/SymbolInterfaces.td",
+        "include/mlir/Interfaces/ControlFlowInterfaces.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "GPUCommonTransforms",
+    hdrs = [
+        "lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h",
+        "lib/Conversion/GPUCommon/OpToFuncCallLowering.h",
+    ],
+    # TODO(b/155492113): Move back to hdrs once fixed.
+    textual_hdrs = [
+        "lib/Conversion/GPUCommon/GPUOpsLowering.h",
+    ],
+    deps = [
+        ":GPUDialect",
+        ":IR",
+        ":LLVMDialect",
+        ":StandardOps",
+        ":StandardToLLVM",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "GPUToNVVMGen",
+    strip_include_prefix = "lib/Conversion/GPUToNVVM",
+    tbl_outs = [
+        (
+            "-gen-rewriters",
+            "lib/Conversion/GPUToNVVM/GPUToNVVM.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "lib/Conversion/GPUToNVVM/GPUToNVVM.td",
+    td_srcs = [
+        ":GPUOpsTdFiles",
+        ":NVVMOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "GPUToNVVMTransforms",
+    srcs = glob([
+        "lib/Conversion/GPUToNVVM/*.cpp",
+        "lib/Conversion/GPUToNVVM/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob([
+        "include/mlir/Conversion/GPUToNVVM/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":GPUCommonTransforms",
+        ":GPUDialect",
+        ":GPUToNVVMGen",
+        ":GPUTransforms",
+        ":IR",
+        ":NVVMDialect",
+        ":Pass",
+        ":StandardToLLVM",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "VectorToROCDL",
+    srcs = [
+        "lib/Conversion/PassDetail.h",
+        "lib/Conversion/VectorToROCDL/VectorToROCDL.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Conversion/VectorToROCDL/VectorToROCDL.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":GPUDialect",
+        ":LLVMDialect",
+        ":Pass",
+        ":ROCDLDialect",
+        ":StandardOps",
+        ":StandardToLLVM",
+        ":Transforms",
+        ":VectorOps",
+    ],
+)
+
+cc_library(
+    name = "VectorToSPIRV",
+    srcs = [
+        "lib/Conversion/PassDetail.h",
+        "lib/Conversion/VectorToSPIRV/VectorToSPIRV.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRV.h",
+        "include/mlir/Conversion/VectorToSPIRV/ConvertVectorToSPIRVPass.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":Pass",
+        ":SPIRVDialect",
+        ":SPIRVLowering",
+        ":Transforms",
+        ":VectorOps",
+    ],
+)
+
+gentbl(
+    name = "GPUToROCDLTGen",
+    strip_include_prefix = "lib/Conversion/GPUToROCDL",
+    tbl_outs = [
+        (
+            "-gen-rewriters",
+            "lib/Conversion/GPUToROCDL/GPUToROCDL.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "lib/Conversion/GPUToROCDL/GPUToROCDL.td",
+    td_srcs = [
+        ":GPUOpsTdFiles",
+        ":ROCDLOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "GPUToROCDLTransforms",
+    srcs = [
+        "lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp",
+        "lib/Conversion/PassDetail.h",
+    ],
+    hdrs = [
+        "include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":GPUCommonTransforms",
+        ":GPUDialect",
+        ":GPUToROCDLTGen",
+        ":GPUTransforms",
+        ":Pass",
+        ":ROCDLDialect",
+        ":StandardToLLVM",
+        ":Transforms",
+        ":VectorOps",
+        ":VectorToLLVM",
+        ":VectorToROCDL",
+        ":VectorToSCF",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "GPUToVulkanTransforms",
+    srcs = [
+        "lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp",
+        "lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp",
+        "lib/Conversion/PassDetail.h",
+    ],
+    hdrs = ["include/mlir/Conversion/GPUToVulkan/ConvertGPUToVulkanPass.h"],
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":GPUDialect",
+        ":IR",
+        ":LLVMDialect",
+        ":Pass",
+        ":SPIRVDialect",
+        ":SPIRVSerialization",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "GPUToGPURuntimeTransforms",
+    srcs = [
+        "lib/Conversion/GPUCommon/ConvertKernelFuncToBlob.cpp",
+        "lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp",
+        "lib/Conversion/PassDetail.h",
+    ],
+    hdrs = ["include/mlir/Conversion/GPUCommon/GPUCommonPass.h"],
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":GPUDialect",
+        ":IR",
+        ":LLVMDialect",
+        ":Pass",
+        ":StandardToLLVM",
+        ":Support",
+        ":TargetNVVMIR",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:NVPTXCodeGen",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//llvm:Target",
+    ],
+)
+
+gentbl(
+    name = "GPUToSPIRVIncGen",
+    strip_include_prefix = "lib/Conversion/GPUToSPIRV",
+    tbl_outs = [
+        (
+            "-gen-rewriters",
+            "lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "lib/Conversion/GPUToSPIRV/GPUToSPIRV.td",
+    td_srcs = [
+        ":GPUOpsTdFiles",
+        ":SPIRVOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "GPUToSPIRVTransforms",
+    srcs = [
+        "lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp",
+        "lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp",
+        "lib/Conversion/PassDetail.h",
+    ],
+    hdrs = [
+        "include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.h",
+        "include/mlir/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.h",
+    ],
+    includes = [
+        "include",
+        "lib/Conversions/GPUToSPIRV",
+    ],
+    deps = [
+        ":ConversionPassIncGen",
+        ":GPUDialect",
+        ":GPUToSPIRVIncGen",
+        ":IR",
+        ":Pass",
+        ":SCFDialect",
+        ":SCFToSPIRV",
+        ":SPIRVDialect",
+        ":SPIRVLowering",
+        ":StandardToSPIRVTransforms",
+        ":Support",
+        ":Transforms",
+        ":VectorToSPIRV",
+    ],
+)
+
+cc_library(
+    name = "SPIRVToLLVM",
+    srcs = glob([
+        "lib/Conversion/SPIRVToLLVM/*.cpp",
+    ]) + [
+        "lib/Conversion/PassDetail.h",
+    ],
+    hdrs = glob([
+        "include/mlir/Conversion/SPIRVToLLVM/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":IR",
+        ":LLVMDialect",
+        ":Pass",
+        ":SPIRVDialect",
+        ":StandardOps",
+        ":StandardToLLVM",
+        ":Support",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "LLVMOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/LLVMIR/LLVMOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/LLVMIR/LLVMOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/LLVMIR/LLVMOpsDialect.h.inc",
+        ),
+        (
+            "-gen-enum-decls",
+            "include/mlir/Dialect/LLVMIR/LLVMOpsEnums.h.inc",
+        ),
+        (
+            "-gen-enum-defs",
+            "include/mlir/Dialect/LLVMIR/LLVMOpsEnums.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/LLVMIR/LLVMOps.td",
+    td_srcs = [
+        ":LLVMOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "LLVMConversionIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-llvmir-conversions",
+            "include/mlir/Dialect/LLVMIR/LLVMConversions.inc",
+        ),
+        (
+            "-gen-enum-to-llvmir-conversions",
+            "include/mlir/Dialect/LLVMIR/LLVMConversionEnumsToLLVM.inc",
+        ),
+        (
+            "-gen-enum-from-llvmir-conversions",
+            "include/mlir/Dialect/LLVMIR/LLVMConversionEnumsFromLLVM.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/LLVMIR/LLVMOps.td",
+    td_srcs = [
+        ":LLVMOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "NVVMDialect",
+    srcs = [
+        "lib/Dialect/LLVMIR/IR/NVVMDialect.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Dialect/LLVMIR/NVVMDialect.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":LLVMDialect",
+        ":NVVMOpsIncGen",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:AsmParser",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "NVVMOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/LLVMIR/LLVMOpBase.td",
+        "include/mlir/Dialect/LLVMIR/NVVMOps.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "NVVMOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/LLVMIR/NVVMOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls -dialect=nvvm",
+            "include/mlir/Dialect/LLVMIR/NVVMOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/LLVMIR/NVVMOps.td",
+    td_srcs = [
+        ":NVVMOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "NVVMConversionIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-llvmir-conversions",
+            "include/mlir/Dialect/LLVMIR/NVVMConversions.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/LLVMIR/NVVMOps.td",
+    td_srcs = [
+        ":NVVMOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "ROCDLDialect",
+    srcs = [
+        "lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Dialect/LLVMIR/ROCDLDialect.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":LLVMDialect",
+        ":ROCDLOpsIncGen",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:AsmParser",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "ROCDLOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/LLVMIR/LLVMOpBase.td",
+        "include/mlir/Dialect/LLVMIR/ROCDLOps.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "ROCDLOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/LLVMIR/ROCDLOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/LLVMIR/ROCDLOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls -dialect=rocdl",
+            "include/mlir/Dialect/LLVMIR/ROCDLOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/LLVMIR/ROCDLOps.td",
+    td_srcs = [
+        ":ROCDLOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "ROCDLConversionIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-llvmir-conversions",
+            "include/mlir/Dialect/LLVMIR/ROCDLConversions.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/LLVMIR/ROCDLOps.td",
+    td_srcs = [
+        ":ROCDLOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "PDLDialect",
+    srcs = glob([
+        "lib/Dialect/PDL/IR/*.cpp",
+        "lib/Dialect/PDL/IR/*.h",
+    ]),
+    hdrs = glob([
+        "include/mlir/Dialect/PDL/IR/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":InferTypeOpInterface",
+        ":PDLOpsIncGen",
+        ":SideEffects",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "PDLOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/PDL/IR/PDLBase.td",
+        "include/mlir/Dialect/PDL/IR/PDLOps.td",
+        "include/mlir/IR/SymbolInterfaces.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "PDLOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/PDL/IR/PDLOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/PDL/IR/PDLOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/PDL/IR/PDLOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/PDL/IR/PDLOps.td",
+    td_srcs = [
+        ":PDLOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "PDLInterpDialect",
+    srcs = glob([
+        "lib/Dialect/PDLInterp/IR/*.cpp",
+        "lib/Dialect/PDLInterp/IR/*.h",
+    ]),
+    hdrs = glob([
+        "include/mlir/Dialect/PDLInterp/IR/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":InferTypeOpInterface",
+        ":PDLDialect",
+        ":PDLInterpOpsIncGen",
+        ":SideEffects",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "PDLInterpOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/PDL/IR/PDLBase.td",
+        "include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "PDLInterpOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls -dialect=pdl_interp",
+            "include/mlir/Dialect/PDLInterp/IR/PDLInterpOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td",
+    td_srcs = [
+        ":PDLInterpOpsTdFiles",
+    ],
+)
+
+# TODO(gcmn): Update SPIRV dependencies so that they map better to cmake files.
+filegroup(
+    name = "SPIRVOpsTdFiles",
+    srcs = [
+        "include/mlir/IR/SymbolInterfaces.td",
+        "include/mlir/Interfaces/CallInterfaces.td",
+        "include/mlir/Interfaces/ControlFlowInterfaces.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ] + glob(["include/mlir/Dialect/SPIRV/*.td"]),
+)
+
+gentbl(
+    name = "SPIRVOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/SPIRV/SPIRVOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/SPIRV/SPIRVOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/SPIRV/SPIRVOpsDialect.h.inc",
+        ),
+        (
+            "-gen-op-doc",
+            "g3doc/Dialects/SPIRV/SPIRVOps.md",
+        ),
+        (
+            "-gen-enum-decls",
+            "include/mlir/Dialect/SPIRV/SPIRVEnums.h.inc",
+        ),
+        (
+            "-gen-enum-defs",
+            "include/mlir/Dialect/SPIRV/SPIRVEnums.cpp.inc",
+        ),
+        (
+            "-gen-spirv-enum-avail-decls",
+            "include/mlir/Dialect/SPIRV/SPIRVEnumAvailability.h.inc",
+        ),
+        (
+            "-gen-spirv-enum-avail-defs",
+            "include/mlir/Dialect/SPIRV/SPIRVEnumAvailability.cpp.inc",
+        ),
+        (
+            "-gen-spirv-capability-implication",
+            "include/mlir/Dialect/SPIRV/SPIRVCapabilityImplication.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SPIRV/SPIRVOps.td",
+    td_srcs = [
+        ":SPIRVOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "SPIRVCanonicalizationIncGen",
+    strip_include_prefix = "lib/Dialect/SPIRV",
+    tbl_outs = [
+        (
+            "-gen-rewriters",
+            "lib/Dialect/SPIRV/SPIRVCanonicalization.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "lib/Dialect/SPIRV/SPIRVCanonicalization.td",
+    td_srcs = [
+        ":SPIRVOpsTdFiles",
+        "lib/Dialect/SPIRV/SPIRVCanonicalization.td",
+    ],
+)
+
+gentbl(
+    name = "SPIRVAvailabilityIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-avail-interface-decls",
+            "include/mlir/Dialect/SPIRV/SPIRVAvailability.h.inc",
+        ),
+        (
+            "-gen-avail-interface-defs",
+            "include/mlir/Dialect/SPIRV/SPIRVAvailability.cpp.inc",
+        ),
+        (
+            "-gen-spirv-avail-impls",
+            "include/mlir/Dialect/SPIRV/SPIRVOpAvailabilityImpl.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SPIRV/SPIRVOps.td",
+    td_srcs = [
+        ":SPIRVOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "SPIRVTargetAndABIStructGen",
+    tbl_outs = [
+        (
+            "-gen-struct-attr-decls",
+            "include/mlir/Dialect/SPIRV/TargetAndABI.h.inc",
+        ),
+        (
+            "-gen-struct-attr-defs",
+            "include/mlir/Dialect/SPIRV/TargetAndABI.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SPIRV/TargetAndABI.td",
+    td_srcs = [
+        ":SPIRVOpsTdFiles",
+        ":StdOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "SPIRVOpUtilsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-spirv-op-utils",
+            "include/mlir/Dialect/SPIRV/SPIRVOpUtils.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SPIRV/SPIRVBase.td",
+    td_srcs = [
+        ":SPIRVOpsTdFiles",
+        ":SPIRVAvailabilityIncGen",
+    ],
+)
+
+gentbl(
+    name = "SPIRVSerializationGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-spirv-serialization",
+            "include/mlir/Dialect/SPIRV/SPIRVSerialization.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SPIRV/SPIRVOps.td",
+    td_srcs = [
+        ":SPIRVOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "SPIRVDialect",
+    srcs = glob(
+        [
+            "lib/Dialect/SPIRV/*.cpp",
+            "lib/Dialect/SPIRV/*.h",
+        ],
+        exclude = [
+            "lib/Dialect/SPIRV/SPIRVLowering.cpp",
+        ],
+    ) + [
+        "include/mlir/Transforms/InliningUtils.h",
+    ],
+    hdrs = glob(
+        [
+            "include/mlir/Dialect/SPIRV/*.h",
+        ],
+        exclude = [
+            "include/mlir/Dialect/SPIRV/SPIRVBinaryUtils.h",
+            "include/mlir/Dialect/SPIRV/SPIRVLowering.h",
+        ],
+    ),
+    includes = ["include"],
+    deps = [
+        ":CommonFolders",
+        ":ControlFlowInterfaces",
+        ":IR",
+        ":Parser",
+        ":Pass",
+        ":SPIRVAvailabilityIncGen",
+        ":SPIRVCanonicalizationIncGen",
+        ":SPIRVOpUtilsIncGen",
+        ":SPIRVOpsIncGen",
+        ":SPIRVPassIncGen",
+        ":SPIRVSerializationGen",
+        ":SPIRVTargetAndABIStructGen",
+        ":SideEffectInterfaces",
+        ":Support",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "SPIRVPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-pass-decls -name SPIRV",
+            "include/mlir/Dialect/SPIRV/Passes.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/SPIRV/Passes.td",
+    td_srcs = [
+        ":PassBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "SPIRVLowering",
+    srcs = glob([
+        "lib/Dialect/SPIRV/Transforms/*.cpp",
+        "lib/Dialect/SPIRV/Transforms/*.h",
+    ]) + [
+        "lib/Dialect/SPIRV/SPIRVLowering.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Dialect/SPIRV/Passes.h",
+        "include/mlir/Dialect/SPIRV/SPIRVLowering.h",
+        "include/mlir/Dialect/SPIRV/TargetAndABI.h",
+    ],
+    includes = [
+        "include",
+    ],
+    deps = [
+        ":IR",
+        ":Pass",
+        ":SPIRVDialect",
+        ":SPIRVPassIncGen",
+        ":SPIRVTargetAndABIStructGen",
+        ":StandardOps",
+        ":Support",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "StandardToSPIRVTransforms",
+    srcs = glob([
+        "lib/Conversion/StandardToSPIRV/*.cpp",
+        "lib/Conversion/StandardToSPIRV/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob([
+        "include/mlir/Conversion/StandardToSPIRV/*.h",
+    ]),
+    includes = [
+        "include",
+        "lib/Conversion/StandardToSPIRV",
+    ],
+    deps = [
+        ":ConversionPassIncGen",
+        ":IR",
+        ":Pass",
+        ":SPIRVDialect",
+        ":SPIRVLowering",
+        ":StandardOps",
+        ":Support",
+        ":Transforms",
+        ":VectorOps",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+alias(
+    name = "StandardToSPIRVConversions",
+    actual = "StandardToSPIRVTransforms",
+)
+
+cc_library(
+    name = "SPIRVSerialization",
+    srcs = glob(
+        [
+            "lib/Dialect/SPIRV/Serialization/*.cpp",
+        ],
+        exclude = [
+            "lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp",
+        ],
+    ),
+    hdrs = [
+        "include/mlir/Dialect/SPIRV/SPIRVBinaryUtils.h",
+        "include/mlir/Dialect/SPIRV/Serialization.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":SPIRVDialect",
+        ":SPIRVOpUtilsIncGen",
+        ":SPIRVOpsIncGen",
+        ":SPIRVSerializationGen",
+        ":Support",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "SPIRVTranslateRegistration",
+    srcs = [
+        "lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":Parser",
+        ":SPIRVDialect",
+        ":SPIRVSerialization",
+        ":Support",
+        ":Translation",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "TransformUtils",
+    srcs = glob([
+        "lib/Transforms/Utils/*.cpp",
+        "lib/Transforms/Utils/*.h",
+    ]),
+    hdrs = glob([
+        "include/mlir/Transforms/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":Analysis",
+        ":ControlFlowInterfaces",
+        ":IR",
+        ":Pass",
+        ":SCFDialect",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        ":TransformsPassIncGen",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "DerivedAttributeOpInterfaceIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Interfaces/DerivedAttributeOpInterface.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Interfaces/DerivedAttributeOpInterface.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Interfaces/DerivedAttributeOpInterface.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "DerivedAttributeOpInterface",
+    srcs = [
+        "lib/Interfaces/DerivedAttributeOpInterface.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Interfaces/DerivedAttributeOpInterface.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":DerivedAttributeOpInterfaceIncGen",
+        ":IR",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "LoopLikeInterfaceIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Interfaces/LoopLikeInterface.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Interfaces/LoopLikeInterface.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Interfaces/LoopLikeInterface.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "VectorInterfacesIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Interfaces/VectorInterfaces.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Interfaces/VectorInterfaces.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Interfaces/VectorInterfaces.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "ViewLikeInterfaceIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Interfaces/ViewLikeInterface.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Interfaces/ViewLikeInterface.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Interfaces/ViewLikeInterface.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "CopyOpInterfaceIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Interfaces/CopyOpInterface.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Interfaces/CopyOpInterface.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Interfaces/CopyOpInterface.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "TransformsPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-pass-decls -name Transforms",
+            "include/mlir/Transforms/Passes.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Transforms/Passes.td",
+    td_srcs = [
+        ":PassBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "Transforms",
+    srcs = glob([
+        "lib/Transforms/*.cpp",
+        "lib/Transforms/*.h",
+    ]),
+    hdrs = glob(["include/mlir/Transforms/*.h"]),
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":Analysis",
+        ":ControlFlowInterfaces",
+        ":CopyOpInterface",
+        ":IR",
+        ":LinalgOps",
+        ":LoopLikeInterface",
+        ":Pass",
+        ":SCFDialect",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        ":TransformUtils",
+        ":TransformsPassIncGen",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "CommonFolders",
+    srcs = [
+    ],
+    hdrs = [
+        "include/mlir/Dialect/CommonFolders.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "SCFToGPU",
+    srcs = ["lib/Conversion/SCFToGPU/SCFToGPU.cpp"],
+    hdrs = ["include/mlir/Conversion/SCFToGPU/SCFToGPU.h"],
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":AffineToStandard",
+        ":ConversionPassIncGen",
+        ":GPUDialect",
+        ":GPUTransforms",
+        ":IR",
+        ":Pass",
+        ":SCFDialect",
+        ":StandardOps",
+        ":Support",
+        ":TransformUtils",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "SCFToGPUPass",
+    srcs = [
+        "lib/Conversion/PassDetail.h",
+        "lib/Conversion/SCFToGPU/SCFToGPUPass.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Conversion/SCFToGPU/SCFToGPUPass.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":ConversionPassIncGen",
+        ":GPUDialect",
+        ":Pass",
+        ":SCFDialect",
+        ":SCFToGPU",
+        ":StandardOps",
+        ":Support",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "SCFToSPIRV",
+    srcs = ["lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp"],
+    hdrs = ["include/mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h"],
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":AffineToStandard",
+        ":ConversionPassIncGen",
+        ":IR",
+        ":Pass",
+        ":SCFDialect",
+        ":SPIRVDialect",
+        ":SPIRVLowering",
+        ":StandardOps",
+        ":Support",
+        ":TransformUtils",
+        ":Transforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "SCFToStandard",
+    srcs = [
+        "lib/Conversion/PassDetail.h",
+        "lib/Conversion/SCFToStandard/SCFToStandard.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Conversion/SCFToStandard/SCFToStandard.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":IR",
+        ":LLVMDialect",
+        ":Pass",
+        ":SCFDialect",
+        ":StandardOps",
+        ":Support",
+        ":TransformUtils",
+        ":Transforms",
+    ],
+)
+
+alias(
+    name = "CFGTransforms",
+    actual = "SCFToStandard",
+)
+
+cc_library(
+    name = "StandardToLLVM",
+    srcs = [
+        "lib/Conversion/PassDetail.h",
+        "lib/Conversion/StandardToLLVM/StandardToLLVM.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h",
+        "include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":IR",
+        ":LLVMDialect",
+        ":Parser",
+        ":Pass",
+        ":StandardOps",
+        ":Support",
+        ":TransformUtils",
+        ":Transforms",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+alias(
+    name = "LLVMTransforms",
+    actual = "StandardToLLVM",
+)
+
+gentbl(
+    name = "CallOpInterfacesIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Interfaces/CallInterfaces.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Interfaces/CallInterfaces.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Interfaces/CallInterfaces.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "CallOpInterfaces",
+    srcs = [
+        "lib/Interfaces/CallInterfaces.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Interfaces/CallInterfaces.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":CallOpInterfacesIncGen",
+        ":IR",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "ControlFlowInterfacesIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Interfaces/ControlFlowInterfaces.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Interfaces/ControlFlowInterfaces.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Interfaces/ControlFlowInterfaces.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "ControlFlowInterfaces",
+    srcs = [
+        "lib/Interfaces/ControlFlowInterfaces.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Interfaces/ControlFlowInterfaces.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":ControlFlowInterfacesIncGen",
+        ":IR",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "InferTypeOpInterfaceIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Interfaces/InferTypeOpInterface.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Interfaces/InferTypeOpInterface.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Interfaces/InferTypeOpInterface.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "InferTypeOpInterface",
+    srcs = [
+        "lib/Interfaces/InferTypeOpInterface.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Interfaces/InferTypeOpInterface.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":InferTypeOpInterfaceIncGen",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "SideEffectInterfacesIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Interfaces/SideEffectInterfaces.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Interfaces/SideEffectInterfaces.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Interfaces/SideEffectInterfaces.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "SideEffectInterfaces",
+    srcs = [
+        "lib/Interfaces/SideEffectInterfaces.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Interfaces/SideEffectInterfaces.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":SideEffectInterfacesIncGen",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+alias(
+    name = "SideEffects",
+    actual = "SideEffectInterfaces",
+)
+
+cc_library(
+    name = "Analysis",
+    srcs = glob(
+        [
+            "lib/Analysis/*.cpp",
+            "lib/Analysis/*.h",
+            "lib/Analysis/*/*.cpp",
+            "lib/Analysis/*/*.h",
+        ],
+        exclude = [
+            "lib/Analysis/Vector*.cpp",
+            "lib/Analysis/Vector*.h",
+        ],
+    ),
+    hdrs = glob(
+        [
+            "include/mlir/Analysis/*.h",
+            "include/mlir/Analysis/*/*.h",
+        ],
+        exclude = [
+            "include/mlir/Analysis/Vector*.h",
+        ],
+    ),
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":CallOpInterfaces",
+        ":IR",
+        ":LinalgOps",
+        ":SCFDialect",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "Translation",
+    srcs = glob([
+        "lib/Translation/*.cpp",
+        "lib/Translation/*.h",
+    ]),
+    hdrs = [
+        "include/mlir/Translation.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":Analysis",
+        ":IR",
+        ":Parser",
+        ":Support",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "LLVMIRModuleTranslation",
+    srcs = [
+        "lib/Target/LLVMIR/DebugTranslation.cpp",
+        "lib/Target/LLVMIR/DebugTranslation.h",
+        "lib/Target/LLVMIR/ModuleTranslation.cpp",
+        "lib/Target/LLVMIR/TypeTranslation.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Target/LLVMIR/ModuleTranslation.h",
+        "include/mlir/Target/LLVMIR/TypeTranslation.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":LLVMConversionIncGen",
+        ":LLVMDialect",
+        ":LLVMIRTransforms",
+        ":OpenMPDialect",
+        ":Support",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:FrontendOpenMP",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//llvm:TransformUtils",
+    ],
+)
+
+cc_library(
+    name = "TargetLLVMIR",
+    srcs = [
+        "lib/Target/LLVMIR/ConvertFromLLVMIR.cpp",
+        "lib/Target/LLVMIR/ConvertToLLVMIR.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Target/LLVMIR.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":LLVMConversionIncGen",
+        ":LLVMDialect",
+        ":LLVMIRModuleTranslation",
+        ":Support",
+        ":TargetLLVMAVX512Intr",
+        ":Translation",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:IRReader",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "TargetNVVMIR",
+    srcs = [
+        "lib/Target/LLVMIR/ConvertToNVVMIR.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Target/NVVMIR.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":GPUDialect",
+        ":IR",
+        ":LLVMDialect",
+        ":LLVMIRModuleTranslation",
+        ":NVVMConversionIncGen",
+        ":NVVMDialect",
+        ":Support",
+        ":Translation",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "TargetROCDLIR",
+    srcs = [
+        "lib/Target/LLVMIR/ConvertToROCDLIR.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Target/ROCDLIR.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":GPUDialect",
+        ":IR",
+        ":LLVMDialect",
+        ":LLVMIRModuleTranslation",
+        ":ROCDLConversionIncGen",
+        ":ROCDLDialect",
+        ":Support",
+        ":Translation",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+# TODO(zinenko): Update these so that we can simplify mapping to cmake.
+cc_library(
+    name = "ExecutionEngine",
+    srcs = [
+        "lib/ExecutionEngine/ExecutionEngine.cpp",
+    ],
+    hdrs = [
+        "include/mlir/ExecutionEngine/ExecutionEngine.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":LLVMDialect",
+        ":Support",
+        ":TargetLLVMIR",
+        ":Translation",
+        "@llvm-project//llvm:BitReader",
+        "@llvm-project//llvm:BitWriter",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:ExecutionEngine",
+        "@llvm-project//llvm:MC",
+        "@llvm-project//llvm:OrcJIT",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//llvm:Target",  # fixdeps: keep
+        "@llvm-project//llvm:TransformUtils",
+        "@llvm-project//llvm:X86CodeGen",  # fixdeps: keep
+        "@llvm-project//llvm:X86Disassembler",  # fixdeps: keep
+    ],
+)
+
+cc_library(
+    name = "ExecutionEngineUtils",
+    srcs = [
+        "lib/ExecutionEngine/OptUtils.cpp",
+    ],
+    hdrs = [
+        "include/mlir/ExecutionEngine/OptUtils.h",
+    ],
+    includes = ["include"],
+    deps = [
+        "@llvm-project//llvm:Analysis",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:IPO",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//llvm:Target",
+    ],
+)
+
+# TODO(jpienaar): Update this.
+cc_library(
+    name = "MlirOptLib",
+    srcs = [
+        "lib/Support/MlirOptMain.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Support/MlirOptMain.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":Analysis",
+        ":ConversionPasses",
+        ":GPUToGPURuntimeTransforms",
+        ":GPUToNVVMTransforms",
+        ":GPUToROCDLTransforms",
+        ":GPUToSPIRVTransforms",
+        ":GPUTransforms",
+        ":IR",
+        ":LLVMDialect",
+        ":LinalgToLLVM",
+        ":LinalgToSPIRV",
+        ":LinalgToStandard",
+        ":NVVMDialect",
+        ":Parser",
+        ":Pass",
+        ":SCFTransforms",
+        ":ShapeToStandard",
+        ":ShapeTransforms",
+        ":StandardOpsTransforms",
+        ":StandardToLLVM",
+        ":StandardToSPIRVTransforms",
+        ":Support",
+        ":Transforms",
+        ":VectorToLLVM",
+        ":VectorToSCF",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//mlir/test:TestAffine",
+        "@llvm-project//mlir/test:TestDialect",
+        "@llvm-project//mlir/test:TestIR",
+        "@llvm-project//mlir/test:TestPass",
+        "@llvm-project//mlir/test:TestReducer",
+        "@llvm-project//mlir/test:TestSPIRV",
+        "@llvm-project//mlir/test:TestTransforms",
+        "@llvm-project//mlir/test:TestTypeDialect",
+    ],
+)
+
+cc_library(
+    name = "AllTranslations",
+    hdrs = ["include/mlir/InitAllTranslations.h"],
+    deps = [
+        ":SPIRVTranslateRegistration",
+        ":TargetLLVMIR",
+        ":TargetNVVMIR",
+        ":TargetROCDLIR",
+    ],
+)
+
+cc_library(
+    name = "MlirTranslateMain",
+    srcs = ["tools/mlir-translate/mlir-translate.cpp"],
+    deps = [
+        ":AllPassesAndDialectsNoRegistration",
+        ":AllTranslations",
+        ":IR",
+        ":Parser",
+        ":Support",
+        ":Translation",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_binary(
+    name = "mlir-translate",
+    deps = [
+        ":MlirTranslateMain",
+    ],
+)
+
+cc_library(
+    name = "AllPassesAndDialectsNoRegistration",
+    hdrs = [
+        "include/mlir/InitAllDialects.h",
+        "include/mlir/InitAllPasses.h",
+    ],
+    defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
+    deps = [
+        ":AVX512",
+        ":AVX512ToLLVM",
+        ":Affine",
+        ":AffinePassIncGen",
+        ":AffineToStandard",
+        ":AffineTransforms",
+        ":Async",
+        ":ConversionPasses",
+        ":GPUDialect",
+        ":GPUPassIncGen",
+        ":GPUToGPURuntimeTransforms",
+        ":GPUToNVVMTransforms",
+        ":GPUToROCDLTransforms",
+        ":GPUToSPIRVTransforms",
+        ":GPUToVulkanTransforms",
+        ":GPUTransforms",
+        ":IR",
+        ":LLVMAVX512",
+        ":LLVMDialect",
+        ":LLVMIRTransforms",
+        ":LLVMPassIncGen",
+        ":LinalgOps",
+        ":LinalgPassIncGen",
+        ":LinalgToLLVM",
+        ":LinalgToSPIRV",
+        ":LinalgToStandard",
+        ":LinalgTransforms",
+        ":NVVMDialect",
+        ":OpenACCDialect",
+        ":OpenMPDialect",
+        ":OpenMPToLLVM",
+        ":PDLDialect",
+        ":PDLInterpDialect",
+        ":QuantOps",
+        ":QuantPassIncGen",
+        ":ROCDLDialect",
+        ":SCFDialect",
+        ":SCFPassIncGen",
+        ":SCFToGPUPass",
+        ":SCFToStandard",
+        ":SCFTransforms",
+        ":SDBM",
+        ":SPIRVDialect",
+        ":SPIRVLowering",
+        ":SPIRVPassIncGen",
+        ":SPIRVToLLVM",
+        ":Shape",
+        ":ShapeToStandard",
+        ":ShapeTransforms",
+        ":ShapeTransformsPassIncGen",
+        ":StandardOps",
+        ":StandardOpsTransforms",
+        ":StandardOpsTransformsPassIncGen",
+        ":StandardToLLVM",
+        ":StandardToSPIRVTransforms",
+        ":Transforms",
+        ":TransformsPassIncGen",
+        ":VectorOps",
+        ":VectorToLLVM",
+        ":VectorToROCDL",
+        ":VectorToSCF",
+        ":VectorToSPIRV",
+    ],
+)
+
+cc_library(
+    name = "AllPassesAndDialects",
+    deps = [
+        ":AllPassesAndDialectsNoRegistration",
+    ],
+)
+
+cc_binary(
+    name = "mlir-opt",
+    srcs = [
+        "tools/mlir-opt/mlir-opt.cpp",
+    ],
+    copts = ["-DMLIR_INCLUDE_TESTS"],
+    deps = [
+        ":AllPassesAndDialectsNoRegistration",
+        ":Analysis",
+        ":IR",
+        ":MlirOptLib",
+        ":OpenMPDialect",
+        ":Pass",
+        ":QuantOps",
+        ":SCFToGPUPass",
+        ":Support",
+        ":Transforms",
+        "@llvm-project//llvm:AllTargetsCodeGens",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//mlir/test:TestAffine",
+        "@llvm-project//mlir/test:TestDialect",
+        "@llvm-project//mlir/test:TestIR",
+        "@llvm-project//mlir/test:TestPass",
+        "@llvm-project//mlir/test:TestReducer",
+        "@llvm-project//mlir/test:TestSPIRV",
+        "@llvm-project//mlir/test:TestTransforms",
+        "@llvm-project//mlir/test:TestTypeDialect",
+    ],
+)
+
+cc_library(
+    name = "MlirJitRunner",
+    srcs = ["lib/ExecutionEngine/JitRunner.cpp"],
+    hdrs = ["include/mlir/ExecutionEngine/JitRunner.h"],
+    includes = ["include"],
+    deps = [
+        ":AllPassesAndDialectsNoRegistration",
+        ":ExecutionEngine",
+        ":ExecutionEngineUtils",
+        ":IR",
+        ":LLVMDialect",
+        ":Parser",
+        ":Pass",
+        ":SCFToStandard",
+        ":Support",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:OrcJIT",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "mlir_c_runner_utils",
+    srcs = [
+        "lib/ExecutionEngine/CRunnerUtils.cpp",
+        "lib/ExecutionEngine/SparseUtils.cpp",
+    ],
+    hdrs = [
+        "include/mlir/ExecutionEngine/CRunnerUtils.h",
+    ],
+    includes = ["include"],
+)
+
+cc_library(
+    name = "mlir_runner_utils",
+    srcs = [
+        "lib/ExecutionEngine/RunnerUtils.cpp",
+    ],
+    hdrs = [
+        "include/mlir/ExecutionEngine/RunnerUtils.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":mlir_c_runner_utils",
+    ],
+)
+
+cc_binary(
+    name = "mlir-cpu-runner",
+    srcs = ["tools/mlir-cpu-runner/mlir-cpu-runner.cpp"],
+    linkopts = ["-ldl"],
+    deps = [
+        ":AllPassesAndDialectsNoRegistration",
+        ":ExecutionEngineUtils",
+        ":MlirJitRunner",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "tools/libcuda-runtime-wrappers",
+    srcs = ["tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp"],
+    compatible_with = ["//buildenv/target:prod"],
+    deps = [
+        ":mlir_c_runner_utils",
+        "//third_party/gpus/cuda:cuda_headers",
+        "//third_party/gpus/cuda:cuda_runtime",
+        "//third_party/gpus/cuda:libcuda",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_binary(
+    name = "tools/libcuda-runtime-wrappers.so",
+    linkshared = True,
+    deps = [":tools/libcuda-runtime-wrappers"],
+)
+
+cc_library(
+    name = "VulkanRuntime",
+    srcs = [
+        "tools/mlir-vulkan-runner/VulkanRuntime.cpp",
+    ],
+    hdrs = [
+        "tools/mlir-vulkan-runner/VulkanRuntime.h",
+    ],
+    deps = [
+        ":IR",
+        ":Pass",
+        ":SPIRVDialect",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        "@llvm-project//llvm:Support",
+        "@vulkan_headers",
+        "@vulkan_sdk//:sdk",
+    ],
+)
+
+cc_binary(
+    name = "tools/libvulkan-runtime-wrappers.so",
+    srcs = ["tools/mlir-vulkan-runner/vulkan-runtime-wrappers.cpp"],
+    linkshared = True,
+    deps = [
+        ":VulkanRuntime",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_binary(
+    name = "mlir-cuda-runner",
+    srcs = ["tools/mlir-cuda-runner/mlir-cuda-runner.cpp"],
+    data = [":tools/libcuda-runtime-wrappers.so"],
+    deps = [
+        ":AllPassesAndDialectsNoRegistration",
+        ":ExecutionEngineUtils",
+        ":GPUDialect",
+        ":GPUToGPURuntimeTransforms",
+        ":GPUToNVVMTransforms",
+        ":GPUToROCDLTransforms",
+        ":GPUTransforms",
+        ":IR",
+        ":LLVMDialect",
+        ":MlirJitRunner",
+        ":NVVMDialect",
+        ":Pass",
+        ":StandardToLLVM",
+        ":TargetNVVMIR",
+        ":Transforms",
+        "//devtools/build/runtime:get_runfiles_dir",
+        "//third_party/gpus/cuda:cuda_headers",
+        "//third_party/gpus/cuda:cuda_runtime",
+        "//third_party/gpus/cuda:libcuda",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_binary(
+    name = "mlir-vulkan-runner",
+    srcs = ["tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp"],
+    data = [
+        ":tools/libvulkan-runtime-wrappers.so",
+        "@llvm-project//mlir/test/mlir-cpu-runner:libmlir_runner_utils.so",
+    ],
+    deps = [
+        ":AllPassesAndDialectsNoRegistration",
+        ":ExecutionEngineUtils",
+        ":GPUToSPIRVTransforms",
+        ":GPUToVulkanTransforms",
+        ":GPUTransforms",
+        ":MlirJitRunner",
+        ":Pass",
+        ":SPIRVDialect",
+        ":StandardToLLVM",
+        ":StandardToSPIRVTransforms",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "TableGen",
+    srcs = glob(["lib/TableGen/*.cpp"]),
+    hdrs = glob(["include/mlir/TableGen/*.h"]),
+    includes = ["include"],
+    deps = [
+        ":Support",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//llvm:TableGen",
+    ],
+)
+
+cc_library(
+    name = "MlirTableGenMain",
+    srcs = [
+        "tools/mlir-tblgen/mlir-tblgen.cpp",
+    ],
+    includes = ["include"],
+    deps = [
+        ":Support",
+        ":TableGen",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//llvm:TableGen",
+        "@llvm-project//llvm:config",
+    ],
+)
+
+cc_binary(
+    name = "mlir-tblgen",
+    srcs = glob([
+        "tools/mlir-tblgen/*.h",
+        "tools/mlir-tblgen/*.cpp",
+    ]),
+    linkopts = [
+        "-lm",
+        "-lpthread",
+    ],
+    deps = [
+        ":MlirTableGenMain",
+        ":Support",
+        ":TableGen",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//llvm:TableGen",
+        "@llvm-project//llvm:config",
+    ],
+)
+
+cc_binary(
+    name = "mlir-linalg-ods-gen",
+    srcs = glob([
+        "tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp",
+    ]),
+    linkopts = [
+        "-lm",
+        "-lpthread",
+    ],
+    deps = [
+        ":IR",
+        ":Support",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//llvm:TableGen",
+        "@llvm-project//llvm:config",
+    ],
+)
+
+## OpenACC dialect
+
+gentbl(
+    name = "OpenACCOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-dialect-decls -dialect=acc",
+            "include/mlir/Dialect/OpenACC/OpenACCOpsDialect.h.inc",
+        ),
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/OpenACC/OpenACCOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/OpenACC/OpenACCOps.cpp.inc",
+        ),
+        (
+            "-gen-enum-decls",
+            "include/mlir/Dialect/OpenACC/OpenACCOpsEnums.h.inc",
+        ),
+        (
+            "-gen-enum-defs",
+            "include/mlir/Dialect/OpenACC/OpenACCOpsEnums.cpp.inc",
+        ),
+        (
+            "-gen-op-doc",
+            "g3doc/Dialects/OpenACC/OpenACCOps.md",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/OpenACC/OpenACCOps.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+        ":OmpCommonTdGen",
+    ],
+)
+
+cc_library(
+    name = "OpenACCDialect",
+    srcs = glob(
+        [
+            "lib/Dialect/OpenACC/IR/*.cpp",
+            "lib/Dialect/OpenACC/IR/*.h",
+        ],
+    ),
+    hdrs = glob([
+        "include/mlir/Dialect/OpenACC/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":OpenACCOpsIncGen",
+        ":StandardOps",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+## OpenMP dialect
+gentbl(
+    name = "OmpCommonTdGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-directive-decl",
+            "include/mlir/Dialect/OpenMP/OmpCommon.td",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "@llvm-project//llvm:include/llvm/Frontend/OpenMP/OMP.td",
+    td_includes = ["external/llvm-project/llvm/include"],
+    td_srcs = [
+        "@llvm-project//llvm:omp_td_files",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "OpenMPOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/OpenMP/OpenMPOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/OpenMP/OpenMPOps.cpp.inc",
+        ),
+        (
+            "-gen-enum-decls",
+            "include/mlir/Dialect/OpenMP/OpenMPOpsEnums.h.inc",
+        ),
+        (
+            "-gen-enum-defs",
+            "include/mlir/Dialect/OpenMP/OpenMPOpsEnums.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/OpenMP/OpenMPOpsDialect.h.inc",
+        ),
+        (
+            "-gen-op-doc",
+            "g3doc/Dialects/OpenMP/OpenMPOps.md",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/OpenMP/OpenMPOps.td",
+    td_srcs = [
+        ":OpBaseTdFiles",
+        ":OmpCommonTdGen",
+        "include/mlir/Dialect/OpenMP/OmpCommon.td",
+    ],
+)
+
+cc_library(
+    name = "OpenMPDialect",
+    srcs = glob(
+        [
+            "lib/Dialect/OpenMP/IR/*.cpp",
+            "lib/Dialect/OpenMP/IR/*.h",
+        ],
+    ),
+    hdrs = glob([
+        "include/mlir/Dialect/OpenMP/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":OpenMPOpsIncGen",
+        ":StandardOps",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "OpenMPToLLVM",
+    srcs = glob([
+        "lib/Conversion/OpenMPToLLVM/*.cpp",
+        "lib/Conversion/OpenMPToLLVM/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob([
+        "include/mlir/Conversion/OpenMPToLLVM/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":IR",
+        ":LLVMDialect",
+        ":OpenMPDialect",
+        ":Pass",
+        ":StandardOps",
+        ":StandardToLLVM",
+        ":Transforms",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+## QuantOps dialect
+filegroup(
+    name = "QuantizationOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/Quant/QuantOps.td",
+        "include/mlir/Dialect/Quant/QuantOpsBase.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "QuantOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/Quant/QuantOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/Quant/QuantOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "include/mlir/Dialect/Quant/QuantOpsDialect.h.inc",
+        ),
+        (
+            "-gen-op-doc",
+            "g3doc/Dialects/QuantOps/QuantOps.md",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Quant/QuantOps.td",
+    td_srcs = [
+        ":QuantizationOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "QuantPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-pass-decls -name Quant",
+            "include/mlir/Dialect/Quant/Passes.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Quant/Passes.td",
+    td_srcs = [
+        ":PassBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "QuantOps",
+    srcs = [
+        "lib/Dialect/Quant/IR/QuantOps.cpp",
+        "lib/Dialect/Quant/IR/QuantTypes.cpp",
+        "lib/Dialect/Quant/IR/TypeDetail.h",
+        "lib/Dialect/Quant/IR/TypeParser.cpp",
+        "lib/Dialect/Quant/Transforms/ConvertConst.cpp",
+        "lib/Dialect/Quant/Transforms/ConvertSimQuant.cpp",
+        "lib/Dialect/Quant/Transforms/PassDetail.h",
+        "lib/Dialect/Quant/Utils/FakeQuantSupport.cpp",
+        "lib/Dialect/Quant/Utils/QuantizeUtils.cpp",
+        "lib/Dialect/Quant/Utils/UniformSupport.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Dialect/Quant/FakeQuantSupport.h",
+        "include/mlir/Dialect/Quant/Passes.h",
+        "include/mlir/Dialect/Quant/QuantOps.h",
+        "include/mlir/Dialect/Quant/QuantTypes.h",
+        "include/mlir/Dialect/Quant/QuantizeUtils.h",
+        "include/mlir/Dialect/Quant/UniformSupport.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":IR",
+        ":Pass",
+        ":QuantOpsIncGen",
+        ":QuantPassIncGen",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":TransformUtils",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "LinalgOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/Linalg/IR/LinalgBase.td",
+        "include/mlir/Dialect/Linalg/IR/LinalgOps.td",
+        "include/mlir/Interfaces/CopyOpInterface.td",
+        "include/mlir/Interfaces/ViewLikeInterface.td",
+        ":AffineOpsTdFiles",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "LinalgOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/Linalg/IR/LinalgOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/Linalg/IR/LinalgOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls -dialect=linalg",
+            "include/mlir/Dialect/Linalg/IR/LinalgOpsDialect.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Linalg/IR/LinalgOps.td",
+    td_srcs = [
+        ":LinalgOpsTdFiles",
+    ],
+)
+
+genlinalg(
+    name = "LinalgNamedStructuredOpsIncGen",
+    src = "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOpsSpec.tc",
+    linalg_outs = [
+        (
+            "-gen-impl",
+            "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.cpp.inc",
+        ),
+        (
+            "-gen-ods-decl",
+            "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.td",
+        ),
+    ],
+    linalggen = ":mlir-linalg-ods-gen",
+)
+
+filegroup(
+    name = "LinalgStructuredOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.td",
+        "include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td",
+        "include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td",
+        "include/mlir/Interfaces/CopyOpInterface.td",
+        "include/mlir/Interfaces/ViewLikeInterface.td",
+        ":AffineOpsTdFiles",
+        ":LinalgOpsTdFiles",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "LinalgStructuredOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td",
+    td_srcs = [
+        ":LinalgStructuredOpsTdFiles",
+        "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.td",
+    ],
+)
+
+gentbl(
+    name = "LinalgStructuredInterfacesIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-interface-decls",
+            "include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterfaces.h.inc",
+        ),
+        (
+            "-gen-op-interface-defs",
+            "include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterfaces.cpp.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td",
+    td_srcs = [
+        ":LinalgStructuredOpsTdFiles",
+    ],
+)
+
+filegroup(
+    name = "LinalgDocTdFiles",
+    srcs = [
+        "include/mlir/Dialect/Linalg/IR/LinalgDoc.td",
+        ":LinalgOpsTdFiles",
+        ":LinalgStructuredOpsTdFiles",
+    ],
+)
+
+gentbl(
+    name = "LinalgDocIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-doc",
+            "g3doc/Dialects/Linalg/LinalgOps.md",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Linalg/IR/LinalgDoc.td",
+    td_srcs = [
+        ":LinalgDocTdFiles",
+    ],
+)
+
+cc_library(
+    name = "LinalgToLLVM",
+    srcs = glob([
+        "lib/Conversion/LinalgToLLVM/*.cpp",
+        "lib/Conversion/LinalgToLLVM/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob([
+        "include/mlir/Conversion/LinalgToLLVM/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":AffineToStandard",
+        ":Analysis",
+        ":ConversionPassIncGen",
+        ":EDSC",
+        ":IR",
+        ":LLVMDialect",
+        ":LinalgOps",
+        ":LinalgTransforms",
+        ":Pass",
+        ":SCFDialect",
+        ":SCFToStandard",
+        ":StandardOps",
+        ":StandardToLLVM",
+        ":Support",
+        ":Transforms",
+        ":VectorToLLVM",
+        ":VectorToSCF",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "LinalgToStandard",
+    srcs = glob([
+        "lib/Conversion/LinalgToStandard/*.cpp",
+        "lib/Conversion/LinalgToStandard/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob([
+        "include/mlir/Conversion/LinalgToStandard/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":ConversionPassIncGen",
+        ":IR",
+        ":LinalgOps",
+        ":Pass",
+        ":SCFDialect",
+        ":StandardOps",
+        ":Support",
+        ":Transforms",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "LinalgToSPIRV",
+    srcs = glob([
+        "lib/Conversion/LinalgToSPIRV/*.cpp",
+        "lib/Conversion/LinalgToSPIRV/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob([
+        "include/mlir/Conversion/LinalgToSPIRV/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":DialectUtils",
+        ":IR",
+        ":LinalgOps",
+        ":LinalgTransforms",
+        ":Pass",
+        ":SPIRVDialect",
+        ":SPIRVLowering",
+        ":StandardOps",
+    ],
+)
+
+cc_library(
+    name = "LinalgOps",
+    srcs = [
+        "lib/Dialect/Linalg/IR/LinalgOps.cpp",
+        "lib/Dialect/Linalg/IR/LinalgTypes.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Dialect/Linalg/EDSC/Intrinsics.h",
+        "include/mlir/Dialect/Linalg/IR/LinalgOps.h",
+        "include/mlir/Dialect/Linalg/IR/LinalgTraits.h",
+        "include/mlir/Dialect/Linalg/IR/LinalgTypes.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":CopyOpInterface",
+        ":DialectUtils",
+        ":EDSC",
+        ":IR",
+        ":LinalgNamedStructuredOpsIncGen",
+        ":LinalgOpsIncGen",
+        ":LinalgStructuredInterfacesIncGen",
+        ":LinalgStructuredOpsIncGen",
+        ":Parser",
+        ":SideEffectInterfaces",
+        ":StandardOps",
+        ":Support",
+        ":ViewLikeInterface",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+gentbl(
+    name = "LinalgPassIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-pass-decls -name Linalg",
+            "include/mlir/Dialect/Linalg/Passes.h.inc",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Linalg/Passes.td",
+    td_srcs = [
+        ":PassBaseTdFiles",
+    ],
+)
+
+cc_library(
+    name = "LinalgTransforms",
+    srcs = glob([
+        "lib/Dialect/Linalg/Transforms/*.cpp",
+        "lib/Dialect/Linalg/Transforms/*.h",
+    ]) + [
+        "lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp",
+        "lib/Dialect/Linalg/EDSC/Builders.cpp",
+        "lib/Dialect/Linalg/Utils/Utils.cpp",
+    ],
+    hdrs = [
+        "include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h",
+        "include/mlir/Dialect/Linalg/EDSC/Builders.h",
+        "include/mlir/Dialect/Linalg/EDSC/FoldedIntrinsics.h",
+        "include/mlir/Dialect/Linalg/Passes.h",
+        "include/mlir/Dialect/Linalg/Transforms/Hoisting.h",
+        "include/mlir/Dialect/Linalg/Transforms/Transforms.h",
+        "include/mlir/Dialect/Linalg/Utils/Utils.h",
+    ],
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":AffineToStandard",
+        ":Analysis",
+        ":DialectUtils",
+        ":EDSC",
+        ":IR",
+        ":LLVMDialect",
+        ":LinalgOps",
+        ":LinalgPassIncGen",
+        ":LinalgStructuredOpsIncGen",
+        ":Pass",
+        ":SCFDialect",
+        ":SCFToStandard",
+        ":SCFTransforms",
+        ":StandardOps",
+        ":StandardToLLVM",
+        ":Support",
+        ":TransformUtils",
+        ":Transforms",
+        ":TransformsPassIncGen",
+        ":VectorOps",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+filegroup(
+    name = "VectorOpsTdFiles",
+    srcs = [
+        "include/mlir/Dialect/Vector/VectorOps.td",
+        "include/mlir/Interfaces/VectorInterfaces.td",
+        ":AffineOpsTdFiles",
+        ":OpBaseTdFiles",
+    ],
+)
+
+gentbl(
+    name = "VectorOpsIncGen",
+    strip_include_prefix = "include",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "include/mlir/Dialect/Vector/VectorOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "include/mlir/Dialect/Vector/VectorOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls -dialect=vector",
+            "include/mlir/Dialect/Vector/VectorOpsDialect.h.inc",
+        ),
+        (
+            "-gen-op-doc",
+            "g3doc/Dialects/Vector/VectorOps.md",
+        ),
+    ],
+    tblgen = ":mlir-tblgen",
+    td_file = "include/mlir/Dialect/Vector/VectorOps.td",
+    td_srcs = [
+        ":VectorOpsTdFiles",
+    ],
+)
+
+cc_library(
+    name = "VectorToLLVM",
+    srcs = glob([
+        "lib/Conversion/VectorToLLVM/*.cpp",
+        "lib/Conversion/VectorToLLVM/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob([
+        "include/mlir/Conversion/VectorToLLVM/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":ConversionPassIncGen",
+        ":DialectUtils",
+        ":EDSC",
+        ":IR",
+        ":LLVMDialect",
+        ":LLVMIRModuleTranslation",
+        ":Pass",
+        ":StandardOps",
+        ":StandardToLLVM",
+        ":Support",
+        ":Transforms",
+        ":VectorOps",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+cc_library(
+    name = "VectorToSCF",
+    srcs = glob([
+        "lib/Conversion/VectorToSCF/*.cpp",
+        "lib/Conversion/VectorToSCF/*.h",
+    ]) + ["lib/Conversion/PassDetail.h"],
+    hdrs = glob([
+        "include/mlir/Conversion/VectorToSCF/*.h",
+    ]),
+    includes = ["include"],
+    deps = [
+        ":Affine",
+        ":ConversionPassIncGen",
+        ":EDSC",
+        ":IR",
+        ":LLVMDialect",
+        ":LinalgTransforms",
+        ":Pass",
+        ":SCFDialect",
+        ":StandardOps",
+        ":StandardToLLVM",
+        ":Support",
+        ":Transforms",
+        ":VectorOps",
+        "@llvm-project//llvm:Core",
+        "@llvm-project//llvm:Support",
+    ],
+)
+
+# To reference all tablegen files here when checking for updates to them.
+filegroup(
+    name = "TdFiles",
+    srcs = glob(["**/*.td"]),
+)
+
+exports_files(
+    [
+        "include/mlir/Interfaces/CallInterfaces.h",
+        "include/mlir/Interfaces/CallInterfaces.td",
+        "include/mlir/Interfaces/ControlFlowInterfaces.h",
+        "include/mlir/Interfaces/ControlFlowInterfaces.td",
+        "include/mlir/Interfaces/CopyOpInterface.td",
+        "include/mlir/Interfaces/SideEffectInterfaces.td",
+        "include/mlir/Interfaces/VectorInterfaces.td",
+        "include/mlir/Interfaces/ViewLikeInterface.td",
+        "include/mlir/Dialect/LLVMIR/LLVMOpBase.td",
+        "include/mlir/Dialect/StandardOps/IR/Ops.td",
+        "include/mlir/Dialect/Shape/IR/ShapeOps.td",
+        "include/mlir/Dialect/Shape/IR/ShapeBase.td",
+        "include/mlir/IR/OpAsmInterface.td",
+        "include/mlir/IR/OpBase.td",
+        "include/mlir/IR/RegionKindInterface.td",
+        "include/mlir/IR/SymbolInterfaces.td",
+        "include/mlir/Transforms/InliningUtils.h",
+        "include/mlir/Interfaces/InferTypeOpInterface.td",
+        "include/mlir/Interfaces/LoopLikeInterface.td",
+    ],
+    visibility = [":friends"],
+)
diff --git a/build_tools/bazel/third_party_import/llvm-project/overlay/mlir/test/BUILD.bazel b/build_tools/bazel/third_party_import/llvm-project/overlay/mlir/test/BUILD.bazel
new file mode 100644
index 0000000..d88190c
--- /dev/null
+++ b/build_tools/bazel/third_party_import/llvm-project/overlay/mlir/test/BUILD.bazel
@@ -0,0 +1,253 @@
+load("@org_tensorflow//third_party/mlir:tblgen.bzl", "gentbl")
+
+package(
+    default_visibility = [":test_friends"],
+    licenses = ["notice"],
+)
+
+# Please only depend on this from MLIR tests.
+package_group(
+    name = "test_friends",
+    packages = ["//..."],
+)
+
+cc_library(
+    name = "IRProducingAPITest",
+    hdrs = ["APITest.h"],
+    includes = ["."],
+)
+
+gentbl(
+    name = "TestOpsIncGen",
+    strip_include_prefix = "lib/Dialect/Test",
+    tbl_outs = [
+        (
+            "-gen-op-decls",
+            "lib/Dialect/Test/TestOps.h.inc",
+        ),
+        (
+            "-gen-op-defs",
+            "lib/Dialect/Test/TestOps.cpp.inc",
+        ),
+        (
+            "-gen-dialect-decls",
+            "lib/Dialect/Test/TestOpsDialect.h.inc",
+        ),
+        (
+            "-gen-enum-decls",
+            "lib/Dialect/Test/TestOpEnums.h.inc",
+        ),
+        (
+            "-gen-enum-defs",
+            "lib/Dialect/Test/TestOpEnums.cpp.inc",
+        ),
+        (
+            "-gen-struct-attr-decls",
+            "lib/Dialect/Test/TestOpStructs.h.inc",
+        ),
+        (
+            "-gen-struct-attr-defs",
+            "lib/Dialect/Test/TestOpStructs.cpp.inc",
+        ),
+        (
+            "-gen-rewriters",
+            "lib/Dialect/Test/TestPatterns.inc",
+        ),
+    ],
+    tblgen = "@llvm-project//mlir:mlir-tblgen",
+    td_file = "lib/Dialect/Test/TestOps.td",
+    td_srcs = [
+        "@llvm-project//mlir:OpBaseTdFiles",
+        "@llvm-project//mlir:include/mlir/IR/OpAsmInterface.td",
+        "@llvm-project//mlir:include/mlir/IR/RegionKindInterface.td",
+        "@llvm-project//mlir:include/mlir/IR/SymbolInterfaces.td",
+        "@llvm-project//mlir:include/mlir/Interfaces/CallInterfaces.td",
+        "@llvm-project//mlir:include/mlir/Interfaces/ControlFlowInterfaces.td",
+        "@llvm-project//mlir:include/mlir/Interfaces/InferTypeOpInterface.td",
+        "@llvm-project//mlir:include/mlir/Interfaces/SideEffectInterfaces.td",
+    ],
+    test = True,
+)
+
+gentbl(
+    name = "TestInterfacesIncGen",
+    strip_include_prefix = "lib/Dialect/Test",
+    tbl_outs = [
+        (
+            "-gen-type-interface-decls",
+            "lib/Dialect/Test/TestTypeInterfaces.h.inc",
+        ),
+        (
+            "-gen-type-interface-defs",
+            "lib/Dialect/Test/TestTypeInterfaces.cpp.inc",
+        ),
+    ],
+    tblgen = "@llvm-project//mlir:mlir-tblgen",
+    td_file = "lib/Dialect/Test/TestInterfaces.td",
+    td_srcs = [
+        "@llvm-project//mlir:OpBaseTdFiles",
+    ],
+    test = True,
+)
+
+cc_library(
+    name = "TestDialect",
+    srcs = [
+        "lib/Dialect/Test/TestDialect.cpp",
+        "lib/Dialect/Test/TestPatterns.cpp",
+    ],
+    hdrs = [
+        "lib/Dialect/Test/TestDialect.h",
+        "lib/Dialect/Test/TestTypes.h",
+    ],
+    includes = [
+        "lib/Dialect/Test",
+    ],
+    deps = [
+        ":TestInterfacesIncGen",
+        ":TestOpsIncGen",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//mlir:ControlFlowInterfaces",
+        "@llvm-project//mlir:DerivedAttributeOpInterface",
+        "@llvm-project//mlir:Dialect",
+        "@llvm-project//mlir:IR",
+        "@llvm-project//mlir:InferTypeOpInterface",
+        "@llvm-project//mlir:Pass",
+        "@llvm-project//mlir:SideEffects",
+        "@llvm-project//mlir:StandardOps",
+        "@llvm-project//mlir:StandardOpsTransforms",
+        "@llvm-project//mlir:TransformUtils",
+        "@llvm-project//mlir:Transforms",
+    ],
+)
+
+cc_library(
+    name = "TestIR",
+    srcs = [
+        "lib/IR/TestFunc.cpp",
+        "lib/IR/TestInterfaces.cpp",
+        "lib/IR/TestMatchers.cpp",
+        "lib/IR/TestPrintDefUse.cpp",
+        "lib/IR/TestPrintNesting.cpp",
+        "lib/IR/TestSideEffects.cpp",
+        "lib/IR/TestSlicing.cpp",
+        "lib/IR/TestSymbolUses.cpp",
+        "lib/IR/TestTypes.cpp",
+    ],
+    deps = [
+        ":TestDialect",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//mlir:Analysis",
+        "@llvm-project//mlir:IR",
+        "@llvm-project//mlir:LinalgOps",
+        "@llvm-project//mlir:Pass",
+        "@llvm-project//mlir:StandardOps",
+        "@llvm-project//mlir:Support",
+    ],
+)
+
+cc_library(
+    name = "TestPass",
+    srcs = [
+        "lib/Pass/TestPassManager.cpp",
+    ],
+    deps = [
+        "@llvm-project//llvm:Support",
+        "@llvm-project//mlir:IR",
+        "@llvm-project//mlir:Pass",
+        "@llvm-project//mlir:Support",
+    ],
+)
+
+cc_library(
+    name = "TestReducer",
+    srcs = [
+        "lib/Reducer/MLIRTestReducer.cpp",
+    ],
+    deps = [
+        "@llvm-project//mlir:IR",
+        "@llvm-project//mlir:Pass",
+        "@llvm-project//mlir:Support",
+    ],
+)
+
+cc_library(
+    name = "TestTransforms",
+    srcs = glob(["lib/Transforms/*.cpp"]),
+    defines = ["MLIR_CUDA_CONVERSIONS_ENABLED"],
+    includes = ["lib/Dialect/Test"],
+    deps = [
+        ":TestDialect",
+        "@llvm-project//llvm:Support",
+        "@llvm-project//mlir:Affine",
+        "@llvm-project//mlir:AffineTransforms",
+        "@llvm-project//mlir:Analysis",
+        "@llvm-project//mlir:EDSC",
+        "@llvm-project//mlir:GPUDialect",
+        "@llvm-project//mlir:GPUToGPURuntimeTransforms",
+        "@llvm-project//mlir:GPUTransforms",
+        "@llvm-project//mlir:IR",
+        "@llvm-project//mlir:LLVMDialect",
+        "@llvm-project//mlir:LLVMTransforms",
+        "@llvm-project//mlir:LinalgOps",
+        "@llvm-project//mlir:LinalgTransforms",
+        "@llvm-project//mlir:Pass",
+        "@llvm-project//mlir:SCFDialect",
+        "@llvm-project//mlir:SPIRVDialect",
+        "@llvm-project//mlir:StandardOps",
+        "@llvm-project//mlir:StandardOpsTransforms",
+        "@llvm-project//mlir:Support",
+        "@llvm-project//mlir:TargetNVVMIR",
+        "@llvm-project//mlir:TargetROCDLIR",
+        "@llvm-project//mlir:TransformUtils",
+        "@llvm-project//mlir:Transforms",
+        "@llvm-project//mlir:VectorOps",
+        "@llvm-project//mlir:VectorToLLVM",
+        "@llvm-project//mlir:VectorToSCF",
+    ],
+)
+
+cc_library(
+    name = "TestAffine",
+    srcs = glob([
+        "lib/Dialect/Affine/*.cpp",
+    ]),
+    deps = [
+        "@llvm-project//llvm:Support",
+        "@llvm-project//mlir:Affine",
+        "@llvm-project//mlir:AffineTransforms",
+        "@llvm-project//mlir:AffineUtils",
+        "@llvm-project//mlir:Analysis",
+        "@llvm-project//mlir:IR",
+        "@llvm-project//mlir:Pass",
+        "@llvm-project//mlir:Support",
+        "@llvm-project//mlir:Transforms",
+        "@llvm-project//mlir:VectorOps",
+    ],
+)
+
+cc_library(
+    name = "TestSPIRV",
+    srcs = glob([
+        "lib/Dialect/SPIRV/*.cpp",
+    ]),
+    deps = [
+        "@llvm-project//mlir:GPUDialect",
+        "@llvm-project//mlir:IR",
+        "@llvm-project//mlir:Pass",
+        "@llvm-project//mlir:SPIRVDialect",
+        "@llvm-project//mlir:SPIRVLowering",
+    ],
+)
+
+cc_library(
+    name = "TestTypeDialect",
+    srcs = glob([
+        "lib/Dialect/LLVMIR/*.cpp",
+    ]),
+    deps = [
+        ":TestDialect",
+        "@llvm-project//mlir:IR",
+        "@llvm-project//mlir:LLVMDialect",
+    ],
+)
diff --git a/docs/developing_iree/repository_management.md b/docs/developing_iree/repository_management.md
index 3ac31bf..df769f7 100644
--- a/docs/developing_iree/repository_management.md
+++ b/docs/developing_iree/repository_management.md
@@ -56,15 +56,14 @@
 Currently, the two most challenging projects to manage as dependencies are
 TensorFlow and LLVM. Both are typically pinned to specific versions that are
 integrated in the Google source repository at a cadence up to many times per
-day. Additionally, TensorFlow itself depends on LLVM. Further, since LLVM does
-not ship with Bazel BUILD files, we use BUILD files maintained in a separate
-[llvm-bazel repository](https://github.com/google/llvm-bazel). Just to make it
-more interesting, since TensorFlow does not ship with CMakeLists, IREE uses
-overlay CMakeLists.txt to build subsets of TensorFlow needed for the compiler
-(when built with CMake). While these externally managed build files are written
-to be moderately generic, they can and do break and require manual intervention
-at times (i.e. there is no guarantee that updating to a new commit of either
-will not require some manual work on the build files).
+day. Further, because LLVM does not ship with Bazel BUILD files, IREE "borrows"
+the BUILD files from TensorFlow (for building with Bazel). Just to make it more
+interesting, since TensorFlow does not ship with CMakeLists, IREE uses overlay
+CMakeLists.txt to build subsets of TensorFlow needed for the compiler (when
+built with CMake). While these externally managed build files are written to be
+moderately generic, they can and do break and require manual intervention at
+times (i.e. there is no guarantee that updating to a new commit of either will
+not require some manual work on the build files).
 
 The only combination which is expected to work is the llvm-project commit noted
 in the `LLVM_COMMIT` setting in
@@ -80,7 +79,7 @@
 APIs, these updates are performed atomically as part of the integration. However
 the changes performed here only guarantee that the internal build is not broken,
 which means that such integrations may very well break the OSS build on the
-`google` branch (in particular, it does not update the LLVM BUILD files). The
+`google` branch (in particular, it does not update teh LLVM BUILD files). The
 IREE build cop will fix the breakage on the `google` branch. We are continuing
 to work on improving this situation.
 
diff --git a/integrations/tensorflow/e2e/README.md b/integrations/tensorflow/e2e/README.md
index c5a8f8f..54402dd 100644
--- a/integrations/tensorflow/e2e/README.md
+++ b/integrations/tensorflow/e2e/README.md
@@ -210,7 +210,7 @@
 compilation and benchmarking artifacts. This allows us to validate that our
 benchmarks are behaving as we expect them to, and to run them using valid inputs
 for each model. An overview of how to run benchmarks on IREE and TFLite can be
-found in [this doc](TODO(meadowlark)).
+found in [this doc](https://google.github.io/iree/developing-iree/e2e-benchmarking).
 
 ## Debugging Tests
 
diff --git a/iree/base/tracing.h b/iree/base/tracing.h
index d8026a9..38f1237 100644
--- a/iree/base/tracing.h
+++ b/iree/base/tracing.h
@@ -151,7 +151,7 @@
 // use it. Note that this means that unless code is instrumented we won't be
 // able to tell what's happening in the Tracy UI.
 #if IREE_TRACING_MAX_CALLSTACK_DEPTH == 0
-#undef TRACY_HAS_CALLSTACK
+#undef TRACY_CALLSTACK
 #endif  // IREE_TRACING_MAX_CALLSTACK_DEPTH
 
 //===----------------------------------------------------------------------===//
@@ -390,7 +390,7 @@
 #if IREE_TRACING_FEATURES & IREE_TRACING_FEATURE_INSTRUMENTATION
 
 // TODO(#1886): update these to tracy and drop the 0.
-#define IREE_TRACE_SCOPE0(name_spec) ZoneScopedNS(name_spec, 13)
+#define IREE_TRACE_SCOPE0(name_spec) ZoneScopedN(name_spec)
 #define IREE_TRACE_SCOPE(name_spec, ...)
 #define IREE_TRACE_EVENT0
 #define IREE_TRACE_EVENT
diff --git a/scripts/git/update_llvm_dependent_submodules.sh b/scripts/git/update_tf_submodule.sh
similarity index 72%
rename from scripts/git/update_llvm_dependent_submodules.sh
rename to scripts/git/update_tf_submodule.sh
index 1890412..28799d1 100755
--- a/scripts/git/update_llvm_dependent_submodules.sh
+++ b/scripts/git/update_tf_submodule.sh
@@ -15,46 +15,47 @@
 # limitations under the License.
 
 # Creates a PR based on the specified BASE_BRANCH (default "google") to update
-# the LLVM-dependent submodules to the configured commits.
-#
-# Positional args will be passed through to update_to_llvm_syncpoint.py
+# the TF submodule to the configured TENSORFLOW_COMMIT (default REMOTE for
+# current HEAD).
 #
 # - Requries the gh CLI (https://github.com/cli/cli) to create a PR.
-# - Will force push to the configured PR_BRANCH (default
-#   "llvm-dependent-submodule-update") on the configured FORK_REMOTE (default
-#   "origin")
+# - Will force push to the configured PR_BRANCH (default "tf-submodule-update")
+#   on the configured FORK_REMOTE (default "origin")
 # - Requires that local BASE_BRANCH branch is a pristine (potentially stale)
 #   copy of the same branch on the configured UPSTREAM_REMOTE
 #   (default "upstream").
 # - Requires that the working directory be clean. Will abort otherwise.
+# - An optional TF_COMMIT_NICKNAME nickname can be given to the commit for the
+#   PR description. Otherwise, it will default to "current HEAD" if
+#   TENSORFLOW_COMMIT is REMOTE and the trimmed commit sha otherwise.
 
 set -e
 set -o pipefail
 
 export UPSTREAM_REMOTE="${UPSTREAM_REMOTE:-upstream}"
-PR_BRANCH="llvm-dependent-submodule-update"
+TENSORFLOW_COMMIT="${1:-LATEST_MATCH}"
+PR_BRANCH="tf-submodule-update"
 BASE_BRANCH="${BASE_BRANCH:-google}"
 FORK_REMOTE="${FORK_REMOTE:-origin}"
 
 ./scripts/git/git_update.sh "${BASE_BRANCH?}"
 git checkout -B "${PR_BRANCH?}"
 
-CMD="./scripts/git/update_to_llvm_syncpoint.py $@"
+CMD="./scripts/git/update_to_llvm_syncpoint.py --tensorflow_commit=${TENSORFLOW_COMMIT?}"
 
 bash -c "${CMD?}"
 
-LLVM_SHA="$(git submodule status third_party/llvm-project | awk '{print $1}' | cut -c -12)"
-LLVM_BAZEL_SHA="$(git submodule status third_party/llvm-bazel | awk '{print $1}' | cut -c -12)"
 TF_SHA="$(git submodule status third_party/tensorflow | awk '{print $1}' | cut -c -12)"
 
-TITLE="Synchronize submodules with LLVM at llvm/llvm-project@${LLVM_SHA?}"
+LLVM_SHA="$(git submodule status third_party/llvm-project | awk '{print $1}' | cut -c -12)"
+
+TITLE="Integrate TF at tensorflow/tensorflow@${TF_SHA?}"
 BODY="$(cat <<-EOF
-Updates LLVM dependencies to match
-[${LLVM_SHA?}](https://github.com/llvm/llvm-project/commit/${LLVM_SHA?}).
-- llvm-bazel to
-  [${LLVM_BAZEL_SHA?}](https://github.com/google/llvm-bazel/commit/${LLVM_BAZEL_SHA?})
-- TensorFlow to
-  [${TF_SHA?}](https://github.com/tensorflow/tensorflow/commit/${TF_SHA?})
+Updates TF to
+[${TF_SHA?}](https://github.com/tensorflow/tensorflow/commit/${TF_SHA?})
+matching
+[${LLVM_SHA?}](https://github.com/llvm/llvm-project/commit/${LLVM_SHA?})
+and copies over the LLVM BUILD files.
 
 \`${CMD?}\`
 EOF
diff --git a/scripts/git/update_to_llvm_syncpoint.py b/scripts/git/update_to_llvm_syncpoint.py
index 502d690..efb7def 100755
--- a/scripts/git/update_to_llvm_syncpoint.py
+++ b/scripts/git/update_to_llvm_syncpoint.py
@@ -16,18 +16,20 @@
 # pylint: disable=missing-docstring
 """Updates LLVM-dependent submodules based on the current LLVM commit.
 
-Updates the third_party/llvm-bazel and third_party/tensorflow submodules to
-commits that match the LLVM commit in third_party/llvm-project submodule. We
-have special conditions around these submodules since they are synced as part of
-the integration of LLVM into Google's source repository. See
+Updates the third_party/tensorflow submodule to a new commit based on the commit
+in the third_party/llvm-project submodule. We have special conditions around
+these submodules since they are synced as part of the integration of LLVM into
+Google's source repository. See
 https://google.github.io/iree/developing-iree/repository-management#the-special-relationship-with-llvm-and-tensorflow.
 
+In addition we currently copy LLVM Bazel BUILD files from TensorFlow.
+
 Typical usage:
   Syntax: ./scripts/git/update_to_llvm_syncpoint.py
 
-  By default, this will update llvm-bazel to the tag corresponding to the
-  current LLVM commit and update TensorFlow to the most recent commit that has a
-  matching LLVM commit.
+  By default, this will update the TensorFlow submodule to the most recent
+  commit with an LLVM version that matches IREE's and copy over the LLVM
+  BUILD file changes as needed.
 """
 
 import argparse
@@ -59,30 +61,20 @@
 def parse_arguments():
   parser = argparse.ArgumentParser()
   parser.add_argument("--repo", help="Repository root directory")
-  parser.add_argument("--llvm",
-                      help="Path to the LLVM sources "
-                      "(defaults to third_party/llvm-project)",
-                      default=None)
-  parser.add_argument("--llvm_bazel",
-                      help="Path to the LLVM Bazel BUILD files"
-                      "(defaults to third_party/llvm-bazel)",
-                      default=None)
   parser.add_argument(
-      "--llvm_bazel_commit",
-      help=("Update llvm-bazel to this commit, or a named option:"
-            f" {COMMIT_OPTIONS}."
-            f" {LATEST_MATCHING_COMMIT} and {INTEGRATE_COMMIT} are equivalent"
-            " for this repository."),
-      default=LATEST_MATCHING_COMMIT)
-  parser.add_argument("--tensorflow",
-                      help="Path to the tensorflow sources "
-                      "(default to third_party/tensorflow)",
-                      default=None)
+      "--tensorflow",
+      help="Path to the tensorflow sources "
+      "(default to third_party/tensorflow)",
+      default=None)
+  parser.add_argument(
+      "--llvm",
+      help="Path to the LLVM sources "
+      "(defaults to third_party/llvm-project)",
+      default=None)
   parser.add_argument(
       "--tensorflow_commit",
       "--tf_commit",
-      help=("Update TensorFlow to this commit, or a named option:"
-            f" {COMMIT_OPTIONS}"),
+      help=f"Update TensorFlow to this commit, or a named option: {COMMIT_OPTIONS}",
       default=LATEST_MATCHING_COMMIT)
   parser.add_argument(
       "--validate",
@@ -92,6 +84,12 @@
       default=True,
   )
 
+  parser.add_argument(
+      "--update_build_files",
+      help="Updates the IREE LLVM build files from TensorFlow.",
+      type=utils.str2bool,
+      nargs="?",
+      default=True)
   args = parser.parse_args()
 
   # Default repo path.
@@ -103,8 +101,6 @@
     args.tensorflow = os.path.join(args.repo, "third_party", "tensorflow")
   if not args.llvm:
     args.llvm = os.path.join(args.repo, "third_party", "llvm-project")
-  if not args.llvm_bazel:
-    args.llvm_bazel = os.path.join(args.repo, "third_party", "llvm-bazel")
 
   return args
 
@@ -114,7 +110,7 @@
   print("  IREE Path :", args.repo)
   print("  LLVM Path :", args.llvm)
   print("  TensorFlow Path :", args.tensorflow)
-  print("  LLVM Bazel Path :", args.llvm_bazel)
+  print("  Update Build files:", args.update_build_files)
   current_llvm_commit = get_commit(args.llvm)
   current_tensorflow_commit = get_commit(args.tensorflow)
 
@@ -128,20 +124,12 @@
   utils.execute(["git", "checkout", new_tf_commit], cwd=args.tensorflow)
   stage_path(args.repo, args.tensorflow)
 
-  validate_tf_commit(current_llvm_commit,
-                     args.tensorflow,
-                     exit_on_failure=args.validate)
+  validate_tf_commit(
+      current_llvm_commit, args.tensorflow, exit_on_failure=args.validate)
 
-  new_llvm_bazel_commit = find_new_llvm_bazel_commit(args.llvm_bazel,
-                                                     current_llvm_commit,
-                                                     args.llvm_bazel_commit)
-  print("\n*** Updating LLVM Bazel to", new_llvm_bazel_commit, "***")
-  utils.execute(["git", "checkout", new_llvm_bazel_commit], cwd=args.llvm_bazel)
-  stage_path(args.repo, args.llvm_bazel)
-
-  validate_llvm_bazel_commit(current_llvm_commit,
-                             args.llvm_bazel,
-                             exit_on_failure=args.validate)
+  if args.update_build_files:
+    print("\n*** Updating BUILD.bazel files ***")
+    update_build_files_from_tensorflow(args.repo, args.tensorflow)
 
   # Export SUBMODULE_VERSIONS.
   print()  # Add line break.
@@ -156,44 +144,6 @@
                        universal_newlines=True).strip()
 
 
-def find_new_llvm_bazel_commit(llvm_bazel_path, llvm_commit, llvm_bazel_commit):
-  utils.execute(["git", "fetch"], cwd=llvm_bazel_path)
-
-  if llvm_bazel_commit not in COMMIT_OPTIONS:
-    return get_commit(llvm_bazel_path, rev=llvm_bazel_commit)
-
-  if llvm_bazel_commit == KEEP_COMMIT:
-    return get_commit(llvm_bazel_path)
-
-  if llvm_bazel_commit == REMOTE_HEAD_COMMIT:
-    return get_commit(llvm_bazel_path, "origin/main")
-
-  if (llvm_bazel_commit == INTEGRATE_COMMIT or
-      llvm_bazel_commit == LATEST_MATCHING_COMMIT):
-    return get_commit(llvm_bazel_path, f"llvm-project-{llvm_commit}")
-
-
-def validate_llvm_bazel_commit(llvm_commit,
-                               llvm_bazel_path,
-                               exit_on_failure=True):
-  llvm_bazel_llvm_commit = find_llvm_bazel_llvm_commit(llvm_bazel_path)
-
-  matches = llvm_bazel_llvm_commit == llvm_commit
-  if not matches:
-    print("WARNING: LLVM commit in llvm-bazel does not match that in IREE"
-          f" ({llvm_bazel_llvm_commit} vs {llvm_commit})")
-    if exit_on_failure:
-      sys.exit(1)
-
-
-def find_llvm_bazel_llvm_commit(llvm_bazel_path):
-  return utils.execute(
-      ["git", "submodule", "status", "third_party/llvm-project"],
-      capture_output=True,
-      universal_newlines=True,
-      cwd=llvm_bazel_path).split()[0].lstrip("+-")
-
-
 def find_new_tf_commit(tensorflow_path, llvm_commit, tf_commit):
   utils.execute(["git", "fetch"], cwd=tensorflow_path)
 
@@ -284,6 +234,35 @@
   sys.exit(1)
 
 
+def update_build_files_from_tensorflow(repo_path, tensorflow_path):
+  src_llvm_build = os.path.join(tensorflow_path, "third_party", "llvm",
+                                "llvm.autogenerated.BUILD")
+  # NOTE(laurenzo): These will probably move upstream.
+  src_mlir_build = os.path.join(tensorflow_path, "third_party", "mlir", "BUILD")
+  src_mlir_test_build = os.path.join(tensorflow_path, "third_party", "mlir",
+                                     "test.BUILD")
+  overlay_path = os.path.join(repo_path, "build_tools", "bazel",
+                              "third_party_import", "llvm-project", "overlay")
+  copy_text_file(repo_path, src_llvm_build,
+                 os.path.join(overlay_path, "llvm", "BUILD.bazel"))
+  copy_text_file(repo_path, src_mlir_build,
+                 os.path.join(overlay_path, "mlir", "BUILD.bazel"))
+  copy_text_file(repo_path, src_mlir_test_build,
+                 os.path.join(overlay_path, "mlir", "test", "BUILD.bazel"))
+
+
+def copy_text_file(repo_path, src_file, dst_file):
+  print(f"+ cp {src_file} {dst_file}")
+  with open(src_file, "r", encoding="UTF-8") as f:
+    src_contents = f.read()
+
+  if not os.path.exists(dst_file):
+    print("WARNING: Destination file does not exist:", dst_file)
+  with open(dst_file, "w", encoding="UTF-8") as f:
+    f.write(src_contents)
+  stage_path(repo_path, dst_file)
+
+
 def stage_path(repo_path, to_stage):
   # TODO(laurenzo): Move to utils.py.
   utils.execute(["git", "add", to_stage], cwd=repo_path)
diff --git a/third_party/llvm-bazel b/third_party/llvm-bazel
deleted file mode 160000
index f0d4260..0000000
--- a/third_party/llvm-bazel
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit f0d426064ff1ed45438424d5c53f753c6d4c809b