Move C runtime source directories into runtime/src/iree. (#8950)

* Pries apart the global include directory situation on both the Bazel and CMake side. On Bazel, we use a new iree_runtime_cc_(library|binary) macro that adds an implicit dep for include propagation and (in the future) can set copts. 
* On the CMake side, we use a path-based implicit dep to similar effect. I tried a couple of other ways and this was the least intrusive.
* Reworks bazel_to_cmake target rewriting to account for the new split root.
* Removes the CMake DATA include::this:file.png style of data includes (used in one place) in favor of a path, since package names are no longer reversible to a location. This seems to be the only place we made that assumption.
* Will do a couple more followups to completely retire the iree/iree directory (in favor of top-level compiler/ and tools/ directories).

Progress on #8955
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 66f1a1f..2f236dc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -614,17 +614,8 @@
 
 add_subdirectory(build_tools/embed_data/)
 
-add_subdirectory(iree/base)
-add_subdirectory(iree/builtins)
-add_subdirectory(iree/hal)
-add_subdirectory(iree/modules)
-add_subdirectory(iree/runtime)
-add_subdirectory(iree/schemas)
-add_subdirectory(iree/task)
-add_subdirectory(iree/testing)
 # Note: Test deps are not built as part of all (use the iree-test-deps target).
 add_subdirectory(iree/test EXCLUDE_FROM_ALL)
-add_subdirectory(iree/vm)
 
 if(${IREE_BUILD_BENCHMARKS})
   find_program(IREE_IMPORT_TFLITE_PATH iree-import-tflite)
@@ -645,6 +636,10 @@
   add_subdirectory(iree/compiler)
 endif()
 
+if(IREE_BUILD_SAMPLES)
+  add_subdirectory(iree/samples)
+endif()
+
 add_subdirectory(iree/tools)
 
 if(IREE_BUILD_TRACY)
@@ -676,10 +671,6 @@
   add_subdirectory(bindings/tflite)
 endif()
 
-if(${IREE_BUILD_SAMPLES})
-  add_subdirectory(iree/samples)
-endif()
-
 if(${IREE_BUILD_EXPERIMENTAL_REMOTING})
   # NOTE: Currently liburing is only used by the experimental remoting
   # support, so keeping it scoped here. If this broadens, then include along
diff --git a/build_tools/bazel/build_core.sh b/build_tools/bazel/build_core.sh
index a696b1a..9e9e761 100755
--- a/build_tools/bazel/build_core.sh
+++ b/build_tools/bazel/build_core.sh
@@ -83,7 +83,7 @@
   --bazelrc=build_tools/bazel/iree.bazelrc \
   query \
     --config=non_darwin \
-    //iree/... + //build_tools/... + \
+    //iree/... + //runtime/... + //build_tools/... + \
     //llvm-external-projects/iree-dialects/... | \
       xargs --max-args 1000000 --max-chars 1000000 --exit \
         bazel \
diff --git a/build_tools/bazel_to_cmake/bazel_to_cmake.py b/build_tools/bazel_to_cmake/bazel_to_cmake.py
index 51354c3..d8d1a03 100755
--- a/build_tools/bazel_to_cmake/bazel_to_cmake.py
+++ b/build_tools/bazel_to_cmake/bazel_to_cmake.py
@@ -71,15 +71,17 @@
       " whether the directory is skipped."
       " 2: Also output when conversion was successful.")
 
-  # Specify only one of these (defaults to --root_dir=iree).
+  # Specify only one of these (defaults to --root_dir=<main source dirs>).
   group = parser.add_mutually_exclusive_group()
   group.add_argument("--dir",
                      help="Converts the BUILD file in the given directory",
                      default=None)
   group.add_argument(
       "--root_dir",
-      help="Converts all BUILD files under a root directory (defaults to iree/)",
-      default="iree")
+      nargs="+",
+      help=
+      "Converts all BUILD files under a root directory (defaults to iree, runtime)",
+      default=["iree", "runtime"])
 
   args = parser.parse_args()
 
@@ -240,12 +242,14 @@
   write_files = not args.preview
 
   if args.root_dir:
-    root_directory_path = os.path.join(repo_root, args.root_dir)
-    log(f"Converting directory tree rooted at: {root_directory_path}")
-    convert_directories((root for root, _, _ in os.walk(root_directory_path)),
-                        write_files=write_files,
-                        allow_partial_conversion=args.allow_partial_conversion,
-                        verbosity=args.verbosity)
+    for root_dir in args.root_dir:
+      root_directory_path = os.path.join(repo_root, root_dir)
+      log(f"Converting directory tree rooted at: {root_directory_path}")
+      convert_directories(
+          (root for root, _, _ in os.walk(root_directory_path)),
+          write_files=write_files,
+          allow_partial_conversion=args.allow_partial_conversion,
+          verbosity=args.verbosity)
   elif args.dir:
     convert_directories([os.path.join(repo_root, args.dir)],
                         write_files=write_files,
diff --git a/build_tools/bazel_to_cmake/bazel_to_cmake_converter.py b/build_tools/bazel_to_cmake/bazel_to_cmake_converter.py
index c953943..ffd3255 100644
--- a/build_tools/bazel_to_cmake/bazel_to_cmake_converter.py
+++ b/build_tools/bazel_to_cmake/bazel_to_cmake_converter.py
@@ -69,11 +69,19 @@
 def _convert_target_block(name, target):
   if target is None:
     return ""
-  # Bazel target name to cmake binary name
-  # Bazel `//iree/custom:custom-translate` -> CMake `iree_custom_custom-translate`
-  target = target.replace("//iree", "iree")  # iree/custom:custom-translate
-  target = target.replace(":", "_")  # iree/custom_custom-translate
-  target = target.replace("/", "_")  # iree_custom_custom-translate
+
+  # Targets in this context can't be aliases, because CMake. So we first convert
+  # it in the usual way and then syntactically change it back from the pretty
+  # alias name to the underscored variant. Example:
+  #   //iree/tools:iree-translate
+  #   iree::tools::iree-translate
+  #   iree_tools_iree-translate
+  cmake_aliases = bazel_to_cmake_targets.convert_target(target)
+  if len(cmake_aliases) != 1:
+    raise ValueError(
+        f"Expected a CMake alias from {target}. Got {cmake_aliases}")
+  target = cmake_aliases[0]
+  target = target.replace("::", "_")
   return _convert_string_arg_block(name, target, quote=False)
 
 
@@ -325,6 +333,9 @@
                             f"{testonly_block}"
                             f"  PUBLIC\n)\n\n")
 
+  def iree_runtime_cc_library(self, deps=[], **kwargs):
+    self.cc_library(deps=deps + ["//runtime/src:runtime_defines"], **kwargs)
+
   def cc_test(self,
               name,
               hdrs=None,
@@ -358,6 +369,9 @@
                             f"{labels_block}"
                             f")\n\n")
 
+  def iree_runtime_cc_test(self, deps=[], **kwargs):
+    self.cc_test(deps=deps + ["//runtime/src:runtime_defines"], **kwargs)
+
   def cc_binary(self,
                 name,
                 srcs=None,
@@ -400,6 +414,7 @@
                    strip_prefix=None,
                    flatten=None,
                    identifier=None,
+                   deps=None,
                    **kwargs):
     name_block = _convert_string_arg_block("NAME", name, quote=False)
     srcs_block = _convert_srcs_block(srcs)
@@ -410,10 +425,12 @@
     testonly_block = _convert_option_block("TESTONLY", testonly)
     identifier_block = _convert_string_arg_block("IDENTIFIER", identifier)
     flatten_block = _convert_option_block("FLATTEN", flatten)
+    deps_block = _convert_target_list_block("DEPS", deps)
 
     self.converter.body += (f"iree_c_embed_data(\n"
                             f"{name_block}"
                             f"{srcs_block}"
+                            f"{deps_block}"
                             f"{c_file_output_block}"
                             f"{h_file_output_block}"
                             f"{identifier_block}"
diff --git a/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py b/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
index fd511b3..f65a2ab 100644
--- a/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
+++ b/build_tools/bazel_to_cmake/bazel_to_cmake_targets.py
@@ -5,12 +5,15 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+import re
+
 # Bazel to CMake target name conversions used by bazel_to_cmake.py.
 
 EXPLICIT_TARGET_MAPPING = {
     # Internal utilities to emulate various binary/library options.
     "//build_tools:default_linkopts": [],
     "//build_tools:dl": ["${CMAKE_DL_LIBS}"],
+    "//runtime/src:runtime_defines": [],
 
     # IREE llvm-external-projects
     "//llvm-external-projects/iree-dialects:IREEPyDMTransforms": [
@@ -192,6 +195,17 @@
   return [target.rsplit(":")[-1]]
 
 
+def _convert_bazel_path(bazel_path: str) -> str:
+  # Bazel `:api`            -> CMake `::api`
+  # Bazel `//iree/base`     -> CMake `iree::base`
+  # Bazel `//iree/base:foo` -> CMake `iree::base::foo`
+  if bazel_path.startswith("//"):
+    bazel_path = bazel_path[len("//"):]
+  bazel_path = bazel_path.replace(":", "::")  # iree/base::foo or ::foo
+  bazel_path = bazel_path.replace("/", "::")  # iree::base
+  return bazel_path
+
+
 def convert_target(target):
   """Converts a Bazel target to a list of CMake targets.
 
@@ -216,14 +230,19 @@
     return _convert_mlir_target(target)
   if target.startswith("//llvm-external-projects/iree-dialects"):
     return _convert_iree_dialects_target(target)
+
+  # Map //runtime/src/iree/(.*) -> iree::\1
+  m = re.match("^//runtime/src/iree/(.+)", target)
+  if m:
+    return ["iree::" + _convert_bazel_path(m.group(1))]
+
+  # Map //runtime/bindings/(.*) -> iree::bindings\1
+  m = re.match("^//runtime/bindings/(.+)", target)
+  if m:
+    return ["iree::bindings::" + _convert_bazel_path(m.group(1))]
+
+  # Default (legacy) rewrite.
   if not target.startswith("@"):
-    # Bazel `:api`            -> CMake `::api`
-    # Bazel `//iree/base`     -> CMake `iree::base`
-    # Bazel `//iree/base:foo` -> CMake `iree::base::foo`
-    if target.startswith("//"):
-      target = target[len("//"):]
-    target = target.replace(":", "::")  # iree/base::foo or ::foo
-    target = target.replace("/", "::")  # iree::base
-    return [target]
+    return [_convert_bazel_path(target)]
 
   raise KeyError(f"No conversion found for target '{target}'")
diff --git a/build_tools/cmake/flatbuffer_c_library.cmake b/build_tools/cmake/flatbuffer_c_library.cmake
index 834aef1..b88c3ae 100644
--- a/build_tools/cmake/flatbuffer_c_library.cmake
+++ b/build_tools/cmake/flatbuffer_c_library.cmake
@@ -117,8 +117,6 @@
   add_dependencies(${_NAME} ${_GEN_TARGET})
   target_include_directories(${_NAME} SYSTEM
     INTERFACE
-      "$<BUILD_INTERFACE:${IREE_SOURCE_DIR}>"
-      "$<BUILD_INTERFACE:${IREE_BINARY_DIR}>"
       ${CMAKE_CURRENT_BINARY_DIR}
     )
   target_link_libraries(${_NAME}
diff --git a/build_tools/cmake/iree_c_embed_data.cmake b/build_tools/cmake/iree_c_embed_data.cmake
index 34a6aa4..9cb3ec1 100644
--- a/build_tools/cmake/iree_c_embed_data.cmake
+++ b/build_tools/cmake/iree_c_embed_data.cmake
@@ -32,7 +32,7 @@
     _RULE
     "PUBLIC;TESTONLY;FLATTEN"
     "NAME;IDENTIFIER;STRIP_PREFIX;C_FILE_OUTPUT;H_FILE_OUTPUT"
-    "SRCS;GENERATED_SRCS"
+    "DEPS;SRCS;GENERATED_SRCS"
     ${ARGN}
   )
 
@@ -87,6 +87,7 @@
     NAME ${_RULE_NAME}
     HDRS "${_RULE_H_FILE_OUTPUT}"
     SRCS "${_RULE_C_FILE_OUTPUT}"
+    DEPS "${_RULE_DEPS}"
     "${_PUBLIC_ARG}"
     "${_TESTONLY_ARG}"
   )
diff --git a/build_tools/cmake/iree_c_module.cmake b/build_tools/cmake/iree_c_module.cmake
index 05eb2db..feaadf6 100644
--- a/build_tools/cmake/iree_c_module.cmake
+++ b/build_tools/cmake/iree_c_module.cmake
@@ -68,10 +68,14 @@
   iree_cc_library(
     NAME ${_RULE_NAME}
     HDRS "${_RULE_H_FILE_OUTPUT}"
-    SRCS "${IREE_SOURCE_DIR}/iree/vm/module_impl_emitc.c"
+    SRCS "${IREE_SOURCE_DIR}/runtime/src/iree/vm/module_impl_emitc.c"
     INCLUDES "${CMAKE_CURRENT_BINARY_DIR}"
-    COPTS "-DEMITC_IMPLEMENTATION=\"${_RULE_H_FILE_OUTPUT}\""
-    "${_TESTONLY_ARG}"
+    COPTS 
+      "-DEMITC_IMPLEMENTATION=\"${_RULE_H_FILE_OUTPUT}\""
+      "${_TESTONLY_ARG}"
+    DEPS
+      # Include paths and options for the runtime sources.
+      iree_defs_runtime
   )
 
   set(_GEN_TARGET "${_NAME}_gen")
diff --git a/build_tools/cmake/iree_cc_binary.cmake b/build_tools/cmake/iree_cc_binary.cmake
index e9a1028..b971743 100644
--- a/build_tools/cmake/iree_cc_binary.cmake
+++ b/build_tools/cmake/iree_cc_binary.cmake
@@ -122,6 +122,11 @@
   # Replace dependencies passed by ::name with iree::package::name
   list(TRANSFORM _RULE_DEPS REPLACE "^::" "${_PACKAGE_NS}::")
 
+  # Implicit deps.
+  if(IREE_IMPLICIT_DEFS_CC_DEPS)
+    list(APPEND _RULE_DEPS ${IREE_IMPLICIT_DEFS_CC_DEPS})
+  endif()
+
   target_link_libraries(${_NAME}
     PUBLIC
       ${_RULE_DEPS}
diff --git a/build_tools/cmake/iree_cc_library.cmake b/build_tools/cmake/iree_cc_library.cmake
index 517f449..6f71f1d 100644
--- a/build_tools/cmake/iree_cc_library.cmake
+++ b/build_tools/cmake/iree_cc_library.cmake
@@ -95,6 +95,11 @@
     set(_RULE_IS_INTERFACE 0)
   endif()
 
+  # Implicit deps.
+  if(IREE_IMPLICIT_DEFS_CC_DEPS)
+    list(APPEND _RULE_DEPS ${IREE_IMPLICIT_DEFS_CC_DEPS})
+  endif()
+
   if(NOT _RULE_IS_INTERFACE)
     add_library(${_OBJECTS_NAME} OBJECT)
     if(_RULE_SHARED)
diff --git a/build_tools/cmake/iree_cc_test.cmake b/build_tools/cmake/iree_cc_test.cmake
index 2714d3a..82311e4 100644
--- a/build_tools/cmake/iree_cc_test.cmake
+++ b/build_tools/cmake/iree_cc_test.cmake
@@ -127,6 +127,11 @@
 
   list(APPEND _RULE_DEPS "gmock")
 
+  # Implicit deps.
+  if(IREE_IMPLICIT_DEFS_CC_DEPS)
+    list(APPEND _RULE_DEPS ${IREE_IMPLICIT_DEFS_CC_DEPS})
+  endif()
+
   string(REPLACE "::" "/" _PACKAGE_PATH ${_PACKAGE_NS})
   set(_NAME_PATH "${_PACKAGE_PATH}/${_RULE_NAME}")
 
diff --git a/build_tools/cmake/iree_hal_cts_test_suite.cmake b/build_tools/cmake/iree_hal_cts_test_suite.cmake
index 5d0fe45..5ea8d84 100644
--- a/build_tools/cmake/iree_hal_cts_test_suite.cmake
+++ b/build_tools/cmake/iree_hal_cts_test_suite.cmake
@@ -113,7 +113,7 @@
           MODULE_FILE_NAME
             "${_RULE_COMPILER_TARGET_BACKEND}_${_FILE_NAME}.bin"
           SRC
-            "${IREE_ROOT_DIR}/iree/hal/cts/testdata/${_FILE_NAME}.mlir"
+            "${IREE_ROOT_DIR}/runtime/src/iree/hal/cts/testdata/${_FILE_NAME}.mlir"
           FLAGS
             ${_TRANSLATE_FLAGS}
           TRANSLATE_TOOL
@@ -191,14 +191,14 @@
 
     # Generate the source file for this [test x driver] pair.
     # TODO(scotttodd): Move to build time instead of configure time?
-    set(IREE_CTS_TEST_FILE_PATH "iree/hal/cts/${_TEST_NAME}_test.h")
+    set(IREE_CTS_TEST_FILE_PATH "runtime/src/iree/hal/cts/${_TEST_NAME}_test.h")
     set(IREE_CTS_DRIVER_REGISTRATION_HDR "${_RULE_DRIVER_REGISTRATION_HDR}")
     set(IREE_CTS_DRIVER_REGISTRATION_FN "${_RULE_DRIVER_REGISTRATION_FN}")
     set(IREE_CTS_TEST_CLASS_NAME "${_TEST_NAME}_test")
     set(IREE_CTS_DRIVER_NAME "${_RULE_DRIVER_NAME}")
 
     configure_file(
-      "${IREE_ROOT_DIR}/iree/hal/cts/cts_test_template.cc.in"
+      "${IREE_ROOT_DIR}/runtime/src/iree/hal/cts/cts_test_template.cc.in"
       ${_TEST_SOURCE_NAME}
     )
 
diff --git a/build_tools/cmake/iree_macros.cmake b/build_tools/cmake/iree_macros.cmake
index 31e28b4..f0606bf 100644
--- a/build_tools/cmake/iree_macros.cmake
+++ b/build_tools/cmake/iree_macros.cmake
@@ -56,8 +56,21 @@
 # Example when called from iree/base/CMakeLists.txt:
 #   iree::base
 function(iree_package_ns PACKAGE_NS)
-  string(REPLACE ${IREE_ROOT_DIR} "" _PACKAGE ${CMAKE_CURRENT_LIST_DIR})
-  string(SUBSTRING ${_PACKAGE} 1 -1 _PACKAGE)
+  # Get the relative path of the current dir (i.e. runtime/src/iree/vm).
+  string(REPLACE ${IREE_ROOT_DIR} "" _RELATIVE_PATH ${CMAKE_CURRENT_LIST_DIR})
+  string(SUBSTRING ${_RELATIVE_PATH} 1 -1 _RELATIVE_PATH)
+
+  # Some sub-trees form their own roots for package purposes. Rewrite them.
+  if(_RELATIVE_PATH MATCHES "^runtime/src/(.*)")
+    # runtime/src/iree/base -> iree/base
+    set(_PACKAGE "${CMAKE_MATCH_1}")
+  else()
+    # Default to pass-through. Examples:
+    #   iree/compiler/API
+    #   iree/tools
+    set(_PACKAGE "${_RELATIVE_PATH}")
+  endif()
+
   string(REPLACE "/" "::" _PACKAGE_NS ${_PACKAGE})
   set(${PACKAGE_NS} ${_PACKAGE_NS} PARENT_SCOPE)
 endfunction()
@@ -189,8 +202,8 @@
 #
 # Parameters:
 # NAME: name of the target to add data dependencies to
-# DATA: List of targets and/or files in the source tree. Files should use the
-#       same format as targets (i.e. iree::package::subpackage::file.txt)
+# DATA: List of targets and/or files in the source tree (relative to the 
+# project root).
 function(iree_add_data_dependencies)
   cmake_parse_arguments(
     _RULE
@@ -209,11 +222,12 @@
       add_dependencies(${_RULE_NAME} ${_DATA_LABEL})
     else()
       # Not a target, assume to be a file instead.
-      string(REPLACE "::" "/" _FILE_PATH ${_DATA_LABEL})
+      set(_FILE_PATH ${_DATA_LABEL})
 
       # Create a target which copies the data file into the build directory.
       # If this file is included in multiple rules, only create the target once.
       string(REPLACE "::" "_" _DATA_TARGET ${_DATA_LABEL})
+      string(REPLACE "/" "_" _DATA_TARGET ${_DATA_TARGET})
       if(NOT TARGET ${_DATA_TARGET})
         set(_INPUT_PATH "${PROJECT_SOURCE_DIR}/${_FILE_PATH}")
         set(_OUTPUT_PATH "${PROJECT_BINARY_DIR}/${_FILE_PATH}")
diff --git a/build_tools/embed_data/BUILD b/build_tools/embed_data/BUILD
index d7c129a..57b5597 100644
--- a/build_tools/embed_data/BUILD
+++ b/build_tools/embed_data/BUILD
@@ -47,7 +47,7 @@
     deps = [
         ":testembed1",
         ":testembed2",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
diff --git a/build_tools/kokoro/gcp_ubuntu/cmake/baremetal/riscv32/test.sh b/build_tools/kokoro/gcp_ubuntu/cmake/baremetal/riscv32/test.sh
index 5f87dd8..fceaab0 100755
--- a/build_tools/kokoro/gcp_ubuntu/cmake/baremetal/riscv32/test.sh
+++ b/build_tools/kokoro/gcp_ubuntu/cmake/baremetal/riscv32/test.sh
@@ -16,7 +16,7 @@
 
 # Run the embedded_library module loader and simple_embedding under QEMU.
 echo "Test elf_module_test_binary"
-pushd "${BUILD_RISCV_DIR?}/iree/hal/local/elf" > /dev/null
+pushd "${BUILD_RISCV_DIR?}/runtime/src/iree/hal/local/elf" > /dev/null
 "${QEMU_RV32_BIN?}" -cpu rv32,x-v=true,x-k=true,vlen=256,elen=64,vext_spec=v1.0 \
 elf_module_test_binary
 popd > /dev/null
diff --git a/iree/build_defs.oss.bzl b/iree/build_defs.oss.bzl
index 96dba99..3bd655b 100644
--- a/iree/build_defs.oss.bzl
+++ b/iree/build_defs.oss.bzl
@@ -45,3 +45,29 @@
         be inserted near the top of the converted file.
     """
     pass
+
+def iree_runtime_cc_library(deps = [], **kwargs):
+    """Used for cc_library targets within the //runtime tree.
+
+    This is a pass-through to the native cc_library which adds specific
+    runtime specific options and deps.
+    """
+    native.cc_library(
+        deps = deps + [
+            "//runtime/src:runtime_defines",
+        ],
+        **kwargs
+    )
+
+def iree_runtime_cc_test(deps = [], **kwargs):
+    """Used for cc_test targets within the //runtime tree.
+
+    This is a pass-through to the native cc_test which adds specific
+    runtime specific options and deps.
+    """
+    native.cc_test(
+        deps = deps + [
+            "//runtime/src:runtime_defines",
+        ],
+        **kwargs
+    )
diff --git a/iree/builtins/CMakeLists.txt b/iree/builtins/CMakeLists.txt
deleted file mode 100644
index 25ddd46..0000000
--- a/iree/builtins/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/builtins/BUILD                                                          #
-#                                                                              #
-# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
-# CMake-only content.                                                          #
-#                                                                              #
-# To disable autogeneration for this file entirely, delete this header.        #
-################################################################################
-
-iree_add_all_subdirs()
-
-### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
diff --git a/iree/builtins/device/tools/BUILD b/iree/builtins/device/tools/BUILD
deleted file mode 100644
index 67b708d..0000000
--- a/iree/builtins/device/tools/BUILD
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2021 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-load("//build_tools/bazel:cc_binary_benchmark.bzl", "cc_binary_benchmark")
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-cc_binary_benchmark(
-    name = "libdevice_benchmark",
-    srcs = ["libdevice_benchmark.c"],
-    deps = [
-        "//iree/base",
-        "//iree/base/internal:flags",
-        "//iree/builtins/device",
-        "//iree/testing:benchmark",
-    ],
-)
-
-cc_test(
-    name = "libdevice_test",
-    srcs = ["libdevice_test.cc"],
-    deps = [
-        "//iree/base",
-        "//iree/base/internal:flags",
-        "//iree/builtins/device",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
diff --git a/iree/builtins/musl/CMakeLists.txt b/iree/builtins/musl/CMakeLists.txt
deleted file mode 100644
index 57fa7a2..0000000
--- a/iree/builtins/musl/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/builtins/musl/BUILD                                                     #
-#                                                                              #
-# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
-# CMake-only content.                                                          #
-#                                                                              #
-# To disable autogeneration for this file entirely, delete this header.        #
-################################################################################
-
-iree_add_all_subdirs()
-
-### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
diff --git a/iree/compiler/ConstEval/BUILD b/iree/compiler/ConstEval/BUILD
index 8d46a3a..63b1e2f 100644
--- a/iree/compiler/ConstEval/BUILD
+++ b/iree/compiler/ConstEval/BUILD
@@ -73,13 +73,13 @@
     ],
     deps = [
         "//iree/compiler/Dialect/VM/Target/Bytecode",
-        "//iree/hal",
-        "//iree/hal/vmvx/registration",
-        "//iree/modules/hal",
         "//iree/tools/utils:vm_util",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
-        "//iree/vm:cc",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/vmvx/registration",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
+        "//runtime/src/iree/vm:cc",
         "@llvm-project//mlir:IR",
     ],
 )
diff --git a/iree/compiler/Dialect/HAL/Target/CUDA/BUILD b/iree/compiler/Dialect/HAL/Target/CUDA/BUILD
index 6ec35df..318861b 100644
--- a/iree/compiler/Dialect/HAL/Target/CUDA/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/CUDA/BUILD
@@ -27,7 +27,7 @@
 #         "//iree/compiler/Codegen/LLVMGPU",
 #         "//iree/compiler/Dialect/HAL/Target",
 #         "//iree/compiler/Utils",
-#         "//iree/schemas:cuda_executable_def_c_fbs",
+#         "//runtime/src/iree/schemas:cuda_executable_def_c_fbs",
 #         "@llvm-project//llvm:Analysis",
 #         "@llvm-project//llvm:BitReader",
 #         "@llvm-project//llvm:Core",
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/Builtins/BUILD b/iree/compiler/Dialect/HAL/Target/LLVM/Builtins/BUILD
index ecf662c..9e4f052 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/Builtins/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/Builtins/BUILD
@@ -21,8 +21,8 @@
         "Musl.h",
     ],
     deps = [
-        "//iree/builtins/device/bin:libdevice",
-        "//iree/builtins/musl/bin:libmusl",
+        "//runtime/src/iree/builtins/device/bin:libdevice",
+        "//runtime/src/iree/builtins/musl/bin:libmusl",
         "@llvm-project//llvm:BitReader",
         "@llvm-project//llvm:Core",
         "@llvm-project//llvm:Support",
diff --git a/iree/compiler/Dialect/HAL/Target/MetalSPIRV/BUILD b/iree/compiler/Dialect/HAL/Target/MetalSPIRV/BUILD
index f0a6c81..434a776 100644
--- a/iree/compiler/Dialect/HAL/Target/MetalSPIRV/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/MetalSPIRV/BUILD
@@ -33,7 +33,7 @@
         "//iree/compiler/Codegen/Utils",
         "//iree/compiler/Dialect/HAL/Target",
         "//iree/compiler/Utils",
-        "//iree/schemas:metal_executable_def_c_fbs",
+        "//runtime/src/iree/schemas:metal_executable_def_c_fbs",
         "@llvm-project//mlir:Affine",
         "@llvm-project//mlir:GPUDialect",
         "@llvm-project//mlir:LinalgOps",
diff --git a/iree/compiler/Dialect/HAL/Target/ROCM/BUILD b/iree/compiler/Dialect/HAL/Target/ROCM/BUILD
index 6c1f412..39b00de 100644
--- a/iree/compiler/Dialect/HAL/Target/ROCM/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/ROCM/BUILD
@@ -35,7 +35,7 @@
         "//iree/compiler/Codegen/LLVMGPU",
         "//iree/compiler/Dialect/HAL/Target",
         "//iree/compiler/Utils",
-        "//iree/schemas:rocm_executable_def_c_fbs",
+        "//runtime/src/iree/schemas:rocm_executable_def_c_fbs",
         "@llvm-project//llvm:AMDGPUCodeGen",
         "@llvm-project//llvm:Core",
         "@llvm-project//llvm:IPO",
diff --git a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/BUILD b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/BUILD
index 813426b..acc61c7 100644
--- a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/BUILD
+++ b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/BUILD
@@ -38,7 +38,7 @@
         "//iree/compiler/Dialect/Vulkan/IR",
         "//iree/compiler/Dialect/Vulkan/Utils",
         "//iree/compiler/Utils",
-        "//iree/schemas:spirv_executable_def_c_fbs",
+        "//runtime/src/iree/schemas:spirv_executable_def_c_fbs",
         "@llvm-project//llvm:Support",
         "@llvm-project//mlir:GPUDialect",
         "@llvm-project//mlir:IR",
diff --git a/iree/compiler/Dialect/VM/Target/Bytecode/BUILD b/iree/compiler/Dialect/VM/Target/Bytecode/BUILD
index 3914d3c..23d7157 100644
--- a/iree/compiler/Dialect/VM/Target/Bytecode/BUILD
+++ b/iree/compiler/Dialect/VM/Target/Bytecode/BUILD
@@ -25,7 +25,7 @@
         "//iree/compiler/Dialect/VM/Transforms",
         "//iree/compiler/Dialect/VM/Utils:CallingConvention",
         "//iree/compiler/Utils",
-        "//iree/schemas:bytecode_module_def_c_fbs",
+        "//runtime/src/iree/schemas:bytecode_module_def_c_fbs",
         "@llvm-project//llvm:Support",
         "@llvm-project//mlir:IR",
         "@llvm-project//mlir:Pass",
diff --git a/iree/compiler/Utils/BUILD b/iree/compiler/Utils/BUILD
index 89311cb..e9dd5e1 100644
--- a/iree/compiler/Utils/BUILD
+++ b/iree/compiler/Utils/BUILD
@@ -39,11 +39,11 @@
         "TracingUtils.h",
     ],
     deps = [
-        "//iree/base:tracing",
-        "//iree/base/internal/flatcc:building",
-        "//iree/base/internal/flatcc:debugging",
-        "//iree/base/internal/flatcc:parsing",
         "//iree/compiler/Dialect/Util/IR",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal/flatcc:building",
+        "//runtime/src/iree/base/internal/flatcc:debugging",
+        "//runtime/src/iree/base/internal/flatcc:parsing",
         "@llvm-project//llvm:Support",
         "@llvm-project//mlir:ArithmeticDialect",
         "@llvm-project//mlir:FuncDialect",
diff --git a/iree/hal/dylib/CMakeLists.txt b/iree/hal/dylib/CMakeLists.txt
deleted file mode 100644
index 4720aeb..0000000
--- a/iree/hal/dylib/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/dylib/BUILD                                                         #
-#                                                                              #
-# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
-# CMake-only content.                                                          #
-#                                                                              #
-# To disable autogeneration for this file entirely, delete this header.        #
-################################################################################
-
-iree_add_all_subdirs()
-
-### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
diff --git a/iree/hal/dylib/registration/BUILD b/iree/hal/dylib/registration/BUILD
deleted file mode 100644
index 4d68498..0000000
--- a/iree/hal/dylib/registration/BUILD
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 2020 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content")
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-iree_cmake_extra_content(
-    content = """
-if(${IREE_HAL_DRIVER_DYLIB})
-""",
-    inline = True,
-)
-
-cc_library(
-    name = "registration",
-    srcs = ["driver_module.c"],
-    hdrs = ["driver_module.h"],
-    defines = [
-        "IREE_HAL_HAVE_DYLIB_DRIVER_MODULE=1",
-    ],
-    deps = [
-        "//iree/base",
-        "//iree/base/internal:flags",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:task_driver",
-        "//iree/hal/local/loaders:embedded_library_loader",
-        "//iree/hal/local/loaders:system_library_loader",
-        "//iree/task:api",
-    ],
-)
-
-iree_cmake_extra_content(
-    content = """
-endif()
-
-if(${IREE_HAL_DRIVER_DYLIB_SYNC})
-""",
-    inline = True,
-)
-
-cc_library(
-    name = "sync",
-    srcs = ["driver_module_sync.c"],
-    hdrs = ["driver_module_sync.h"],
-    defines = [
-        "IREE_HAL_HAVE_DYLIB_SYNC_DRIVER_MODULE=1",
-    ],
-    deps = [
-        "//iree/base",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:sync_driver",
-        "//iree/hal/local/loaders:embedded_library_loader",
-    ],
-)
-
-iree_cmake_extra_content(
-    content = """
-endif()
-""",
-    inline = True,
-)
diff --git a/iree/hal/local/loaders/BUILD b/iree/hal/local/loaders/BUILD
deleted file mode 100644
index a780c38..0000000
--- a/iree/hal/local/loaders/BUILD
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright 2020 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-# Default implementations for HAL types that use the host resources.
-# These are generally just wrappers around host heap memory and host threads.
-
-load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content")
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-cc_library(
-    name = "embedded_library_loader",
-    srcs = ["embedded_library_loader.c"],
-    hdrs = ["embedded_library_loader.h"],
-    defines = [
-        "IREE_HAL_HAVE_EMBEDDED_LIBRARY_LOADER=1",
-    ],
-    deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:executable_library",
-        "//iree/hal/local/elf:elf_module",
-    ],
-)
-
-cc_library(
-    name = "static_library_loader",
-    srcs = ["static_library_loader.c"],
-    hdrs = ["static_library_loader.h"],
-    defines = [
-        "IREE_HAL_HAVE_STATIC_LIBRARY_LOADER=1",
-    ],
-    deps = [
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:executable_environment",
-        "//iree/hal/local:executable_library",
-    ],
-)
-
-cc_library(
-    name = "system_library_loader",
-    srcs = ["system_library_loader.c"],
-    hdrs = ["system_library_loader.h"],
-    defines = [
-        "IREE_HAL_HAVE_SYSTEM_LIBRARY_LOADER=1",
-    ],
-    deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal:dynamic_library",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:executable_library",
-    ],
-)
-
-iree_cmake_extra_content(
-    content = """
-if(${IREE_HAL_DRIVER_VMVX} OR ${IREE_HAL_DRIVER_VMVX_SYNC})
-""",
-    inline = True,
-)
-
-cc_library(
-    name = "vmvx_module_loader",
-    srcs = ["vmvx_module_loader.c"],
-    hdrs = ["vmvx_module_loader.h"],
-    defines = [
-        "IREE_HAL_HAVE_VMVX_MODULE_LOADER=1",
-    ],
-    deps = [
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:executable_library",
-        "//iree/modules/vmvx",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
-    ],
-)
-
-iree_cmake_extra_content(
-    content = """
-endif()
-""",
-    inline = True,
-)
diff --git a/iree/hal/utils/BUILD b/iree/hal/utils/BUILD
deleted file mode 100644
index f47f1ff..0000000
--- a/iree/hal/utils/BUILD
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 2021 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-load("//build_tools/bazel:cc_binary_benchmark.bzl", "cc_binary_benchmark")
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-cc_library(
-    name = "buffer_transfer",
-    srcs = ["buffer_transfer.c"],
-    hdrs = ["buffer_transfer.h"],
-    visibility = ["//visibility:public"],
-    deps = [
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/hal",
-    ],
-)
-
-cc_library(
-    name = "deferred_command_buffer",
-    srcs = ["deferred_command_buffer.c"],
-    hdrs = ["deferred_command_buffer.h"],
-    visibility = ["//visibility:public"],
-    deps = [
-        ":resource_set",
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/base/internal:arena",
-        "//iree/hal",
-    ],
-)
-
-cc_library(
-    name = "resource_set",
-    srcs = ["resource_set.c"],
-    hdrs = ["resource_set.h"],
-    visibility = ["//visibility:public"],
-    deps = [
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/base/internal:arena",
-        "//iree/hal",
-    ],
-)
-
-cc_binary_benchmark(
-    name = "resource_set_benchmark",
-    srcs = ["resource_set_benchmark.c"],
-    deps = [
-        ":resource_set",
-        "//iree/base",
-        "//iree/base/internal:prng",
-        "//iree/hal",
-        "//iree/testing:benchmark",
-    ],
-)
-
-cc_test(
-    name = "resource_set_test",
-    srcs = ["resource_set_test.cc"],
-    deps = [
-        ":resource_set",
-        "//iree/base",
-        "//iree/hal",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
diff --git a/iree/hal/vmvx/registration/BUILD b/iree/hal/vmvx/registration/BUILD
deleted file mode 100644
index 764022f..0000000
--- a/iree/hal/vmvx/registration/BUILD
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 2021 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content")
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-iree_cmake_extra_content(
-    content = """
-if(${IREE_HAL_DRIVER_VMVX})
-""",
-    inline = True,
-)
-
-cc_library(
-    name = "registration",
-    srcs = ["driver_module.c"],
-    hdrs = ["driver_module.h"],
-    defines = [
-        "IREE_HAL_HAVE_VMVX_DRIVER_MODULE=1",
-    ],
-    deps = [
-        "//iree/base",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:task_driver",
-        "//iree/hal/local/loaders:vmvx_module_loader",
-        "//iree/task:api",
-        "//iree/vm",
-    ],
-)
-
-iree_cmake_extra_content(
-    content = """
-endif()
-
-if(${IREE_HAL_DRIVER_VMVX_SYNC})
-""",
-    inline = True,
-)
-
-cc_library(
-    name = "sync",
-    srcs = ["driver_module_sync.c"],
-    hdrs = ["driver_module_sync.h"],
-    defines = [
-        "IREE_HAL_HAVE_VMVX_SYNC_DRIVER_MODULE=1",
-    ],
-    deps = [
-        "//iree/base",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:sync_driver",
-        "//iree/hal/local/loaders:vmvx_module_loader",
-        "//iree/vm",
-    ],
-)
-
-iree_cmake_extra_content(
-    content = """
-endif()
-""",
-    inline = True,
-)
diff --git a/iree/hal/vulkan/util/BUILD b/iree/hal/vulkan/util/BUILD
deleted file mode 100644
index ebcd52f..0000000
--- a/iree/hal/vulkan/util/BUILD
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 2019 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-cc_library(
-    name = "arena",
-    srcs = ["arena.cc"],
-    hdrs = ["arena.h"],
-    deps = [
-        "//iree/base:core_headers",
-        "//iree/base:logging",
-    ],
-)
-
-cc_test(
-    name = "arena_test",
-    srcs = ["arena_test.cc"],
-    deps = [
-        ":arena",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
-
-cc_library(
-    name = "intrusive_list",
-    hdrs = [
-        "intrusive_list.h",
-        "intrusive_list_unique_ptr.inc",
-    ],
-    deps = [
-        "//iree/base:logging",
-    ],
-)
-
-cc_test(
-    name = "intrusive_list_test",
-    srcs = [
-        "intrusive_list_test.cc",
-        "intrusive_list_unique_ptr_test.cc",
-    ],
-    deps = [
-        ":intrusive_list",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
-
-cc_library(
-    name = "ref_ptr",
-    hdrs = ["ref_ptr.h"],
-    deps = [
-        "//iree/base:core_headers",
-        "//iree/base:logging",
-        "//iree/base/internal",
-    ],
-)
-
-cc_test(
-    name = "ref_ptr_test",
-    size = "small",
-    srcs = ["ref_ptr_test.cc"],
-    deps = [
-        ":ref_ptr",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
diff --git a/iree/lit.cfg.py b/iree/lit.cfg.py
index 77a0498..675e1db 100644
--- a/iree/lit.cfg.py
+++ b/iree/lit.cfg.py
@@ -10,6 +10,9 @@
 # runlit.site.cfg.py which in turn is evaluated by lit.py.
 # pylint: disable=undefined-variable
 
+# NOTE: Each top-level which includes lit tests needs a copy of this file.
+# Please keep up to date.
+
 import os
 import tempfile
 
diff --git a/iree/modules/CMakeLists.txt b/iree/modules/CMakeLists.txt
deleted file mode 100644
index a6b78f7..0000000
--- a/iree/modules/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/modules/BUILD                                                           #
-#                                                                              #
-# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
-# CMake-only content.                                                          #
-#                                                                              #
-# To disable autogeneration for this file entirely, delete this header.        #
-################################################################################
-
-iree_add_all_subdirs()
-
-### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
diff --git a/iree/modules/check/BUILD b/iree/modules/check/BUILD
deleted file mode 100644
index c378ab0..0000000
--- a/iree/modules/check/BUILD
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2020 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-cc_library(
-    name = "check",
-    testonly = True,
-    srcs = ["module.cc"],
-    hdrs = ["module.h"],
-    deps = [
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base/internal",
-        "//iree/hal",
-        "//iree/modules/hal",
-        "//iree/testing:gtest",
-        "//iree/vm",
-        "//iree/vm:cc",
-    ],
-)
-
-cc_test(
-    name = "check_test",
-    srcs = ["check_test.cc"],
-    deps = [
-        ":check",
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base/internal",
-        "//iree/base/internal:span",
-        "//iree/hal",
-        "//iree/hal/vmvx/registration",
-        "//iree/modules/hal",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
-        "//iree/vm:cc",
-    ],
-)
diff --git a/iree/samples/custom_modules/BUILD b/iree/samples/custom_modules/BUILD
index f588bde..0366248 100644
--- a/iree/samples/custom_modules/BUILD
+++ b/iree/samples/custom_modules/BUILD
@@ -18,12 +18,12 @@
     srcs = ["module.cc"],
     hdrs = ["module.h"],
     deps = [
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/hal",
-        "//iree/modules/hal",
-        "//iree/vm",
-        "//iree/vm:cc",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:cc",
     ],
 )
 
@@ -53,15 +53,15 @@
     deps = [
         ":custom_modules_test_module_c",
         ":module",
-        "//iree/base",
-        "//iree/base:logging",
-        "//iree/hal",
-        "//iree/hal/vmvx/registration",
-        "//iree/modules/hal",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
-        "//iree/vm:cc",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/vmvx/registration",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
+        "//runtime/src/iree/vm:cc",
     ],
 )
diff --git a/iree/samples/emitc_modules/CMakeLists.txt b/iree/samples/emitc_modules/CMakeLists.txt
index 9f0569e..6033299 100644
--- a/iree/samples/emitc_modules/CMakeLists.txt
+++ b/iree/samples/emitc_modules/CMakeLists.txt
@@ -4,7 +4,7 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-if(${IREE_ENABLE_EMITC})
+if(IREE_ENABLE_EMITC)
   iree_c_module(
     NAME
       add_module
diff --git a/iree/samples/simple_embedding/BUILD b/iree/samples/simple_embedding/BUILD
index 21911ee..3bd66ed 100644
--- a/iree/samples/simple_embedding/BUILD
+++ b/iree/samples/simple_embedding/BUILD
@@ -30,14 +30,14 @@
     ],
     deps = [
         ":simple_embedding_test_bytecode_module_vmvx_c",
-        "//iree/base",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:sync_driver",
-        "//iree/hal/local/loaders:vmvx_module_loader",
-        "//iree/modules/hal",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:sync_driver",
+        "//runtime/src/iree/hal/local/loaders:vmvx_module_loader",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
     ],
 )
 
@@ -84,14 +84,14 @@
         ":simple_embedding_test_bytecode_module_dylib_riscv_32_c",
         ":simple_embedding_test_bytecode_module_dylib_riscv_64_c",
         ":simple_embedding_test_bytecode_module_dylib_x86_64_c",
-        "//iree/base",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:sync_driver",
-        "//iree/hal/local/loaders:embedded_library_loader",
-        "//iree/modules/hal",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:sync_driver",
+        "//runtime/src/iree/hal/local/loaders:embedded_library_loader",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
     ],
 )
 
@@ -199,15 +199,15 @@
         ":simple_embedding_test_bytecode_module_dylib_arm_64_c",
         ":simple_embedding_test_bytecode_module_dylib_riscv_64_c",
         ":simple_embedding_test_bytecode_module_dylib_x86_64_c",
-        "//iree/base",
-        "//iree/hal",
-        "//iree/hal/local",
-        "//iree/hal/local:task_driver",
-        "//iree/hal/local/loaders:embedded_library_loader",
-        "//iree/modules/hal",
-        "//iree/task:api",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:task_driver",
+        "//runtime/src/iree/hal/local/loaders:embedded_library_loader",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/task:api",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
     ],
 )
 
@@ -240,12 +240,12 @@
     ],
     deps = [
         ":simple_embedding_test_bytecode_module_vulkan_c",
-        "//iree/base",
-        "//iree/hal",
-        "//iree/hal/vulkan/registration",
-        "//iree/modules/hal",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/vulkan/registration",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
     ],
 )
 
@@ -290,12 +290,12 @@
 #     ],
 #     deps = [
 #         ":simple_embedding_test_bytecode_module_cuda_c",
-#         "//iree/base",
-#         "//iree/hal",
-#         "//iree/hal/cuda/registration",
-#         "//iree/modules/hal",
-#         "//iree/vm",
-#         "//iree/vm:bytecode_module",
+#         "//runtime/src/iree/base",
+#         "//runtime/src/iree/hal",
+#         "//runtime/src/iree/hal/cuda/registration",
+#         "//runtime/src/iree/modules/hal",
+#         "//runtime/src/iree/vm",
+#         "//runtime/src/iree/vm:bytecode_module",
 #     ],
 # )
 
diff --git a/iree/samples/static_library/CMakeLists.txt b/iree/samples/static_library/CMakeLists.txt
index 804b41b..9e0c3a7 100644
--- a/iree/samples/static_library/CMakeLists.txt
+++ b/iree/samples/static_library/CMakeLists.txt
@@ -156,6 +156,10 @@
   SRCS
     "create_c_module.c"
     "static_library_demo.c"
+  COPTS
+    # TODO: Make emitc not generate unused variables.
+    # https://github.com/google/iree/issues/8954
+    "$<$<C_COMPILER_ID:Clang>:-Wno-unused-but-set-variable>"
   DEPS
     ::simple_mul_emitc
     iree::runtime
diff --git a/iree/samples/vision/CMakeLists.txt b/iree/samples/vision/CMakeLists.txt
index c1585fc..e44fd2b 100644
--- a/iree/samples/vision/CMakeLists.txt
+++ b/iree/samples/vision/CMakeLists.txt
@@ -31,7 +31,7 @@
   SRCS
     "iree-run-mnist-module.c"
   DATA
-    "iree::samples::vision::mnist_test.png"
+    "iree/samples/vision/mnist_test.png"
   DEPS
     ::mnist_bytecode_module_c
     iree::runtime
diff --git a/iree/task/BUILD b/iree/task/BUILD
deleted file mode 100644
index e134e85..0000000
--- a/iree/task/BUILD
+++ /dev/null
@@ -1,199 +0,0 @@
-# Copyright 2020 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content")
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-iree_cmake_extra_content(
-    content = """
-# Task-based executor requires threading support.
-if(NOT ${IREE_ENABLE_THREADING})
-  return()
-endif()
-
-# cpuinfo can be conditionally disabled when it is not supported.
-# If disabled then by default the task system will use 1 thread.
-set(IREE_CPUINFO_TARGET)
-if(IREE_ENABLE_CPUINFO)
-  set(IREE_CPUINFO_TARGET cpuinfo)
-endif()
-""",
-    inline = True,
-)
-
-cc_library(
-    name = "api",
-    srcs = ["api.c"],
-    hdrs = ["api.h"],
-    deps = [
-        ":task",
-        "//iree/base:tracing",
-        "//iree/base/internal:flags",
-    ],
-)
-
-cc_library(
-    name = "task",
-    srcs = [
-        "executor.c",
-        "executor_impl.h",
-        "list.c",
-        "poller.c",
-        "pool.c",
-        "post_batch.c",
-        "post_batch.h",
-        "queue.c",
-        "scope.c",
-        "submission.c",
-        "task.c",
-        "task_impl.h",
-        "topology.c",
-        "topology_cpuinfo.c",
-        "worker.c",
-        "worker.h",
-    ],
-    hdrs = [
-        "affinity_set.h",
-        "executor.h",
-        "list.h",
-        "poller.h",
-        "pool.h",
-        "queue.h",
-        "scope.h",
-        "submission.h",
-        "task.h",
-        "topology.h",
-        "tuning.h",
-    ],
-    deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal",
-        "//iree/base/internal:atomic_slist",
-        "//iree/base/internal:cpu",
-        "//iree/base/internal:event_pool",
-        "//iree/base/internal:fpu_state",
-        "//iree/base/internal:prng",
-        "//iree/base/internal:synchronization",
-        "//iree/base/internal:threading",
-        "//iree/base/internal:wait_handle",
-        "@cpuinfo",
-    ],
-)
-
-cc_test(
-    name = "executor_demo",
-    srcs = ["executor_demo.cc"],
-    deps = [
-        ":task",
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/base/internal:prng",
-        "//iree/task/testing:test_util",
-    ],
-)
-
-cc_test(
-    name = "executor_test",
-    srcs = ["executor_test.cc"],
-    deps = [
-        ":task",
-        "//iree/base",
-        "//iree/task/testing:test_util",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
-
-cc_test(
-    name = "list_test",
-    srcs = ["list_test.cc"],
-    deps = [
-        ":task",
-        "//iree/base",
-        "//iree/task/testing:test_util",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
-
-cc_test(
-    name = "pool_test",
-    srcs = ["pool_test.cc"],
-    deps = [
-        ":task",
-        "//iree/base",
-        "//iree/task/testing:test_util",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
-
-cc_test(
-    name = "queue_test",
-    srcs = ["queue_test.cc"],
-    deps = [
-        ":task",
-        "//iree/base",
-        "//iree/task/testing:test_util",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
-
-cc_test(
-    name = "scope_test",
-    srcs = [
-        "scope_test.cc",
-        "task_impl.h",
-    ],
-    deps = [
-        ":task",
-        "//iree/base",
-        "//iree/task/testing:test_util",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
-
-cc_test(
-    name = "task_tests",
-    srcs = [
-        "task_test_barrier.cc",
-        "task_test_call.cc",
-        "task_test_dispatch.cc",
-        "task_test_fence.cc",
-        "task_test_nop.cc",
-        "task_test_wait.cc",
-    ],
-    deps = [
-        ":task",
-        "//iree/base",
-        "//iree/task/testing:task_test",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
-
-cc_test(
-    name = "topology_test",
-    srcs = ["topology_test.cc"],
-    tags = [
-        "noasan",  # TODO(8469): Does not work on machines with large numbers of cores.
-    ],
-    deps = [
-        ":task",
-        "//iree/base",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-    ],
-)
diff --git a/iree/tools/BUILD b/iree/tools/BUILD
index c74ef04..d7554e4 100644
--- a/iree/tools/BUILD
+++ b/iree/tools/BUILD
@@ -17,18 +17,18 @@
     name = "iree-benchmark-module",
     srcs = ["iree-benchmark-module-main.cc"],
     deps = [
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base:tracing",
-        "//iree/base/internal:file_io",
-        "//iree/base/internal:flags",
-        "//iree/hal",
-        "//iree/hal/drivers",
-        "//iree/modules/hal",
         "//iree/tools/utils:vm_util",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
-        "//iree/vm:cc",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:file_io",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/drivers",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
+        "//runtime/src/iree/vm:cc",
         "@com_google_benchmark//:benchmark",
     ],
 )
@@ -37,17 +37,17 @@
     name = "iree-benchmark-trace",
     srcs = ["iree-benchmark-trace-main.c"],
     deps = [
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/base/internal:atomic_slist",
-        "//iree/base/internal:file_path",
-        "//iree/base/internal:flags",
-        "//iree/hal",
-        "//iree/hal/drivers",
-        "//iree/testing:benchmark",
         "//iree/tools/utils:trace_replay",
         "//iree/tools/utils:yaml_util",
-        "//iree/vm",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:atomic_slist",
+        "//runtime/src/iree/base/internal:file_path",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/drivers",
+        "//runtime/src/iree/testing:benchmark",
+        "//runtime/src/iree/vm",
         "@com_github_yaml_libyaml//:yaml",
     ],
 )
@@ -57,21 +57,21 @@
     testonly = True,
     srcs = ["iree-check-module-main.cc"],
     deps = [
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base:core_headers",
-        "//iree/base:logging",
-        "//iree/base:tracing",
-        "//iree/base/internal:file_io",
-        "//iree/base/internal:flags",
-        "//iree/hal",
-        "//iree/hal/drivers",
-        "//iree/modules/check",
-        "//iree/modules/hal",
-        "//iree/testing:gtest",
         "//iree/tools/utils:vm_util",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:file_io",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/drivers",
+        "//runtime/src/iree/modules/check",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
     ],
 )
 
@@ -79,10 +79,10 @@
     name = "iree-dump-module",
     srcs = ["iree-dump-module-main.c"],
     deps = [
-        "//iree/base",
-        "//iree/base/internal:file_io",
-        "//iree/base/internal/flatcc:debugging",
-        "//iree/schemas:bytecode_module_def_c_fbs",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base/internal:file_io",
+        "//runtime/src/iree/base/internal/flatcc:debugging",
+        "//runtime/src/iree/schemas:bytecode_module_def_c_fbs",
     ],
 )
 
@@ -302,22 +302,22 @@
     deps = [
         ":init_passes_and_dialects",
         ":init_targets",
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base:logging",
-        "//iree/base:tracing",
-        "//iree/base/internal:flags",
         "//iree/compiler/Dialect/HAL/Target",
         "//iree/compiler/Dialect/VM/Target:init_targets",
         "//iree/compiler/Dialect/VM/Target/Bytecode",
         "//iree/compiler/Translation:IREEVM",
-        "//iree/hal",
-        "//iree/hal/drivers",
-        "//iree/modules/hal",
         "//iree/tools/utils:vm_util",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
-        "//iree/vm:cc",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/drivers",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
+        "//runtime/src/iree/vm:cc",
         "@llvm-project//llvm:Support",
         "@llvm-project//mlir:IR",
         "@llvm-project//mlir:LLVMToLLVMIRTranslation",
@@ -332,18 +332,18 @@
     name = "iree-run-module",
     srcs = ["iree-run-module-main.cc"],
     deps = [
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base:tracing",
-        "//iree/base/internal:file_io",
-        "//iree/base/internal:flags",
-        "//iree/hal",
-        "//iree/hal/drivers",
-        "//iree/modules/hal",
         "//iree/tools/utils:vm_util",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
-        "//iree/vm:cc",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:file_io",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/drivers",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
+        "//runtime/src/iree/vm:cc",
     ],
 )
 
@@ -351,15 +351,15 @@
     name = "iree-run-trace",
     srcs = ["iree-run-trace-main.c"],
     deps = [
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/base/internal:file_path",
-        "//iree/base/internal:flags",
-        "//iree/hal",
-        "//iree/hal/drivers",
         "//iree/tools/utils:trace_replay",
         "//iree/tools/utils:yaml_util",
-        "//iree/vm",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:file_path",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/drivers",
+        "//runtime/src/iree/vm",
         "@com_github_yaml_libyaml//:yaml",
     ],
 )
@@ -368,18 +368,18 @@
     name = "iree-e2e-matmul-test",
     srcs = ["iree-e2e-matmul-test.c"],
     deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal:file_path",
-        "//iree/base/internal:flags",
-        "//iree/hal",
-        "//iree/hal/drivers",
-        "//iree/modules/hal",
         "//iree/tools/utils:cpu_features",
         "//iree/tools/utils:trace_replay",
         "//iree/tools/utils:yaml_util",
-        "//iree/vm",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:file_path",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/drivers",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
         "@com_github_yaml_libyaml//:yaml",
     ],
 )
diff --git a/iree/tools/utils/BUILD b/iree/tools/utils/BUILD
index c1d8de7..323c2f9 100644
--- a/iree/tools/utils/BUILD
+++ b/iree/tools/utils/BUILD
@@ -18,14 +18,14 @@
     hdrs = ["trace_replay.h"],
     deps = [
         ":yaml_util",
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/base/internal:file_io",
-        "//iree/base/internal:file_path",
-        "//iree/hal",
-        "//iree/modules/hal",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:file_io",
+        "//runtime/src/iree/base/internal:file_path",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
         "@com_github_yaml_libyaml//:yaml",
     ],
 )
@@ -36,16 +36,16 @@
     srcs = ["vm_util.cc"],
     hdrs = ["vm_util.h"],
     deps = [
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base:logging",
-        "//iree/base:tracing",
-        "//iree/base/internal:span",
-        "//iree/hal",
-        "//iree/modules/hal",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
-        "//iree/vm:cc",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:span",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
+        "//runtime/src/iree/vm:cc",
     ],
 )
 
@@ -61,14 +61,14 @@
     srcs = ["vm_util_test.cc"],
     deps = [
         ":vm_util",
-        "//iree/base",
-        "//iree/hal",
-        "//iree/hal/vmvx/registration",
-        "//iree/modules/hal",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-        "//iree/vm",
-        "//iree/vm:cc",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/vmvx/registration",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:cc",
     ],
 )
 
@@ -84,7 +84,7 @@
     srcs = ["yaml_util.c"],
     hdrs = ["yaml_util.h"],
     deps = [
-        "//iree/base",
+        "//runtime/src/iree/base",
         "@com_github_yaml_libyaml//:yaml",
     ],
 )
@@ -94,7 +94,7 @@
     srcs = ["cpu_features.c"],
     hdrs = ["cpu_features.h"],
     deps = [
-        "//iree/base",
-        "//iree/base:target_platform",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:target_platform",
     ],
 )
diff --git a/iree/builtins/device/BUILD b/runtime/BUILD.bazel
similarity index 66%
copy from iree/builtins/device/BUILD
copy to runtime/BUILD.bazel
index 69662e0..9da145a 100644
--- a/iree/builtins/device/BUILD
+++ b/runtime/BUILD.bazel
@@ -1,4 +1,4 @@
-# Copyright 2021 The IREE Authors
+# Copyright 2022 The IREE Authors
 #
 # Licensed under the Apache License v2.0 with LLVM Exceptions.
 # See https://llvm.org/LICENSE.txt for license information.
@@ -10,12 +10,4 @@
     licenses = ["notice"],  # Apache 2.0
 )
 
-cc_library(
-    name = "device",
-    srcs = [
-        "device_generic.c",
-    ],
-    hdrs = [
-        "device.h",
-    ],
-)
+exports_files(["lit.cfg.py"])
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index 8a3ce7a..de8151c 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -4,6 +4,8 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+add_subdirectory(src)
+
 if(IREE_BUILD_PYTHON_BINDINGS)
   # Copy Python packaging files to the build dir so that we can install from
   # there.
diff --git a/runtime/lit.cfg.py b/runtime/lit.cfg.py
new file mode 100644
index 0000000..77a0498
--- /dev/null
+++ b/runtime/lit.cfg.py
@@ -0,0 +1,32 @@
+# Copyright 2022 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+"""Lit config for IREE."""
+
+# Lint for undefined variables is disabled as config is not defined inside this
+# file, instead config is injected by way of evaluating runlit.cfg.py from
+# runlit.site.cfg.py which in turn is evaluated by lit.py.
+# pylint: disable=undefined-variable
+
+import os
+import tempfile
+
+import lit.formats
+
+config.name = "IREE"
+config.suffixes = [".mlir", ".txt"]
+config.test_format = lit.formats.ShTest(execute_external=True)
+# Forward all IREE environment variables
+passthrough_env_vars = ["VK_ICD_FILENAMES"]
+config.environment.update({
+    k: v
+    for k, v in os.environ.items()
+    if k.startswith("IREE_") or k in passthrough_env_vars
+})
+
+# Use the most preferred temp directory.
+config.test_exec_root = (os.environ.get("TEST_UNDECLARED_OUTPUTS_DIR") or
+                         os.environ.get("TEST_TMPDIR") or
+                         os.path.join(tempfile.gettempdir(), "lit"))
diff --git a/iree/builtins/device/BUILD b/runtime/src/BUILD
similarity index 71%
copy from iree/builtins/device/BUILD
copy to runtime/src/BUILD
index 69662e0..ad62c80 100644
--- a/iree/builtins/device/BUILD
+++ b/runtime/src/BUILD
@@ -1,4 +1,4 @@
-# Copyright 2021 The IREE Authors
+# Copyright 2022 The IREE Authors
 #
 # Licensed under the Apache License v2.0 with LLVM Exceptions.
 # See https://llvm.org/LICENSE.txt for license information.
@@ -11,11 +11,8 @@
 )
 
 cc_library(
-    name = "device",
-    srcs = [
-        "device_generic.c",
-    ],
-    hdrs = [
-        "device.h",
+    name = "runtime_defines",
+    includes = [
+        ".",
     ],
 )
diff --git a/runtime/src/CMakeLists.txt b/runtime/src/CMakeLists.txt
new file mode 100644
index 0000000..e19c964
--- /dev/null
+++ b/runtime/src/CMakeLists.txt
@@ -0,0 +1,18 @@
+# Copyright 2022 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+# Configures all iree_cc_* targets to take this implicit dep,
+# which provides common includes and copts for the tree.
+set(IREE_IMPLICIT_DEFS_CC_DEPS iree_defs_runtime)
+
+add_library(iree_defs_runtime INTERFACE)
+target_include_directories(
+  iree_defs_runtime INTERFACE
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+)
+
+add_subdirectory(iree)
diff --git a/runtime/src/iree/CMakeLists.txt b/runtime/src/iree/CMakeLists.txt
new file mode 100644
index 0000000..3b1f024
--- /dev/null
+++ b/runtime/src/iree/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Copyright 2022 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+add_subdirectory(base)
+add_subdirectory(builtins)
+add_subdirectory(hal)
+add_subdirectory(modules)
+add_subdirectory(runtime)
+add_subdirectory(schemas)
+add_subdirectory(task)
+add_subdirectory(testing)
+add_subdirectory(vm)
diff --git a/iree/base/BUILD b/runtime/src/iree/base/BUILD
similarity index 74%
rename from iree/base/BUILD
rename to runtime/src/iree/base/BUILD
index 5609666..b85f964 100644
--- a/iree/base/BUILD
+++ b/runtime/src/iree/base/BUILD
@@ -6,6 +6,8 @@
 
 # Common types and utilities used in the IREE codebase.
 
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library", "iree_runtime_cc_test")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
@@ -16,7 +18,7 @@
 # Public API
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "base",
     srcs = [
         "allocator.c",
@@ -49,7 +51,7 @@
 )
 
 # TODO(benvanik): make these srcs and only expose an api_cc.h.
-cc_library(
+iree_runtime_cc_library(
     name = "cc",
     srcs = [
         "status_cc.cc",
@@ -64,17 +66,17 @@
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "bitfield_test",
     srcs = ["bitfield_test.cc"],
     deps = [
         ":base",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "loop_inline_test",
     srcs = [
         "loop_inline_test.cc",
@@ -83,12 +85,12 @@
         ":base",
         ":cc",
         ":loop_test_hdrs",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "loop_test_hdrs",
     testonly = 1,
     hdrs = [
@@ -97,39 +99,39 @@
     deps = [
         ":base",
         ":tracing",
-        "//iree/base/internal:wait_handle",
-        "//iree/testing:gtest",
+        "//runtime/src/iree/base/internal:wait_handle",
+        "//runtime/src/iree/testing:gtest",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "status_test",
     srcs = ["status_test.cc"],
     deps = [
         ":base",
         ":cc",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "string_builder_test",
     srcs = ["string_builder_test.cc"],
     deps = [
         ":base",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "string_view_test",
     srcs = ["string_view_test.cc"],
     deps = [
         ":base",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
@@ -137,7 +139,7 @@
 # Core headers (platform detection, compiler compat, etc)
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "core_headers",
     hdrs = [
         "alignment.h",
@@ -147,7 +149,7 @@
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "target_platform",
     hdrs = ["target_platform.h"],
 )
@@ -156,7 +158,7 @@
 # Internal IREE C++ wrappers and utilities
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "logging",
     srcs = ["logging.cc"],
     hdrs = ["logging.h"],
@@ -169,23 +171,23 @@
     deps = [
         ":core_headers",
         ":tracing",
-        "//iree/base/internal:flags",
+        "//runtime/src/iree/base/internal:flags",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "loop_sync",
     srcs = ["loop_sync.c"],
     hdrs = ["loop_sync.h"],
     deps = [
         ":base",
         ":tracing",
-        "//iree/base/internal",
-        "//iree/base/internal:wait_handle",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal:wait_handle",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "loop_sync_test",
     srcs = [
         "loop_sync_test.cc",
@@ -195,12 +197,12 @@
         ":cc",
         ":loop_sync",
         ":loop_test_hdrs",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "tracing",
     hdrs = ["tracing.h"],
     deps = [
diff --git a/iree/base/CMakeLists.txt b/runtime/src/iree/base/CMakeLists.txt
similarity index 100%
rename from iree/base/CMakeLists.txt
rename to runtime/src/iree/base/CMakeLists.txt
diff --git a/iree/base/alignment.h b/runtime/src/iree/base/alignment.h
similarity index 100%
rename from iree/base/alignment.h
rename to runtime/src/iree/base/alignment.h
diff --git a/iree/base/allocator.c b/runtime/src/iree/base/allocator.c
similarity index 100%
rename from iree/base/allocator.c
rename to runtime/src/iree/base/allocator.c
diff --git a/iree/base/allocator.h b/runtime/src/iree/base/allocator.h
similarity index 100%
rename from iree/base/allocator.h
rename to runtime/src/iree/base/allocator.h
diff --git a/iree/base/api.c b/runtime/src/iree/base/api.c
similarity index 100%
rename from iree/base/api.c
rename to runtime/src/iree/base/api.c
diff --git a/iree/base/api.h b/runtime/src/iree/base/api.h
similarity index 100%
rename from iree/base/api.h
rename to runtime/src/iree/base/api.h
diff --git a/iree/base/assert.h b/runtime/src/iree/base/assert.h
similarity index 100%
rename from iree/base/assert.h
rename to runtime/src/iree/base/assert.h
diff --git a/iree/base/attributes.h b/runtime/src/iree/base/attributes.h
similarity index 100%
rename from iree/base/attributes.h
rename to runtime/src/iree/base/attributes.h
diff --git a/iree/base/bitfield.c b/runtime/src/iree/base/bitfield.c
similarity index 100%
rename from iree/base/bitfield.c
rename to runtime/src/iree/base/bitfield.c
diff --git a/iree/base/bitfield.h b/runtime/src/iree/base/bitfield.h
similarity index 100%
rename from iree/base/bitfield.h
rename to runtime/src/iree/base/bitfield.h
diff --git a/iree/base/bitfield_test.cc b/runtime/src/iree/base/bitfield_test.cc
similarity index 100%
rename from iree/base/bitfield_test.cc
rename to runtime/src/iree/base/bitfield_test.cc
diff --git a/iree/base/config.h b/runtime/src/iree/base/config.h
similarity index 100%
rename from iree/base/config.h
rename to runtime/src/iree/base/config.h
diff --git a/iree/base/internal/BUILD b/runtime/src/iree/base/internal/BUILD
similarity index 64%
rename from iree/base/internal/BUILD
rename to runtime/src/iree/base/internal/BUILD
index 26101d6..725bc0d 100644
--- a/iree/base/internal/BUILD
+++ b/runtime/src/iree/base/internal/BUILD
@@ -8,7 +8,7 @@
 # These are not part of the IREE API. Though they may be used by external
 # projects their API may change at any time.
 
-load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content")
+load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_runtime_cc_library", "iree_runtime_cc_test")
 load("//build_tools/bazel:iree_lit_test.bzl", "iree_lit_test_suite")
 load("//build_tools/bazel:cc_binary_benchmark.bzl", "cc_binary_benchmark")
 
@@ -24,7 +24,7 @@
 # Put files here that large percentages of the code include only; adding
 # infrequently used files here will cause extraneous large rebuilds.
 
-cc_library(
+iree_runtime_cc_library(
     name = "internal",
     srcs = [
         "atomics_clang.h",
@@ -39,28 +39,28 @@
         "math.h",
     ],
     deps = [
-        "//iree/base:core_headers",
+        "//runtime/src/iree/base:core_headers",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "atomics_test",
     srcs = ["atomics_test.cc"],
     deps = [
         ":internal",
-        "//iree/base:core_headers",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "math_test",
     srcs = ["math_test.cc"],
     deps = [
         ":internal",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
@@ -68,51 +68,51 @@
 # Utilities
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "arena",
     srcs = ["arena.c"],
     hdrs = ["arena.h"],
     deps = [
         ":atomic_slist",
         ":synchronization",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "atomic_slist",
     srcs = ["atomic_slist.c"],
     hdrs = ["atomic_slist.h"],
     deps = [
         ":internal",
         ":synchronization",
-        "//iree/base:core_headers",
+        "//runtime/src/iree/base:core_headers",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "atomic_slist_test",
     srcs = ["atomic_slist_test.cc"],
     deps = [
         ":atomic_slist",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "cpu",
     srcs = ["cpu.c"],
     hdrs = ["cpu.h"],
     deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "dynamic_library",
     srcs = [
         "dynamic_library_posix.c",
@@ -125,67 +125,67 @@
         ":synchronization",
         "//build_tools:default_linkopts",
         "//build_tools:dl",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "file_io",
     srcs = ["file_io.c"],
     hdrs = ["file_io.h"],
     deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "file_io_test",
     srcs = ["file_io_test.cc"],
     deps = [
         ":file_io",
-        "//iree/base:cc",
-        "//iree/base:core_headers",
-        "//iree/base:logging",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "file_path",
     srcs = ["file_path.c"],
     hdrs = ["file_path.h"],
     deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "file_path_test",
     srcs = [
         "file_path_test.cc",
     ],
     deps = [
         ":file_path",
-        "//iree/base:core_headers",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "flags",
     srcs = ["flags.c"],
     hdrs = ["flags.h"],
     deps = [
         ":file_io",
         ":internal",
-        "//iree/base",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
@@ -194,13 +194,14 @@
     srcs = ["flags_demo.c"],
     deps = [
         ":flags",
-        "//iree/base",
+        "//runtime/src/iree/base",
     ],
 )
 
 iree_lit_test_suite(
     name = "flags_test",
     srcs = ["flags_test.txt"],
+    cfg = "//runtime:lit.cfg.py",
     tags = ["hostonly"],
     tools = [
         ":flags_demo",
@@ -208,14 +209,14 @@
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "fpu_state",
     srcs = ["fpu_state.c"],
     hdrs = ["fpu_state.h"],
     deps = [
         ":internal",
-        "//iree/base",
-        "//iree/base:core_headers",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
     ],
 )
 
@@ -224,23 +225,23 @@
     srcs = ["fpu_state_benchmark.cc"],
     deps = [
         ":fpu_state",
-        "//iree/base",
-        "//iree/testing:benchmark_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/testing:benchmark_main",
         "@com_google_benchmark//:benchmark",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "fpu_state_test",
     srcs = ["fpu_state_test.cc"],
     deps = [
         ":fpu_state",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "main",
     srcs = [
         "main_posix.c",
@@ -248,35 +249,35 @@
     ],
     hdrs = ["main.h"],
     deps = [
-        "//iree/base:core_headers",
+        "//runtime/src/iree/base:core_headers",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "prng",
     hdrs = ["prng.h"],
     deps = [
         ":internal",
-        "//iree/base:core_headers",
+        "//runtime/src/iree/base:core_headers",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "prng_test",
     srcs = ["prng_test.cc"],
     deps = [
         ":prng",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "span",
     hdrs = ["span.h"],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "synchronization",
     srcs = [
         "synchronization.c",
@@ -288,9 +289,9 @@
     deps = [
         ":internal",
         "//build_tools:default_linkopts",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
@@ -300,22 +301,22 @@
     srcs = ["synchronization_benchmark.cc"],
     deps = [
         ":synchronization",
-        "//iree/testing:benchmark_main",
+        "//runtime/src/iree/testing:benchmark_main",
         "@com_google_benchmark//:benchmark",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "synchronization_test",
     srcs = ["synchronization_test.cc"],
     deps = [
         ":synchronization",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "wait_handle",
     srcs = [
         "wait_handle.c",
@@ -332,19 +333,19 @@
     hdrs = ["wait_handle.h"],
     deps = [
         ":synchronization",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "wait_handle_test",
     srcs = ["wait_handle_test.cc"],
     deps = [
         ":wait_handle",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
@@ -361,7 +362,7 @@
     inline = True,
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "event_pool",
     srcs = ["event_pool.c"],
     hdrs = ["event_pool.h"],
@@ -369,13 +370,13 @@
         ":internal",
         ":synchronization",
         ":wait_handle",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "threading",
     srcs = [
         "threading.c",
@@ -390,13 +391,13 @@
         ":synchronization",
         "//build_tools:default_linkopts",
         "//build_tools:dl",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "threading_test",
     srcs = [
         "threading_impl.h",
@@ -406,8 +407,8 @@
         ":internal",
         ":synchronization",
         ":threading",
-        "//iree/base:cc",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
diff --git a/iree/base/internal/CMakeLists.txt b/runtime/src/iree/base/internal/CMakeLists.txt
similarity index 98%
rename from iree/base/internal/CMakeLists.txt
rename to runtime/src/iree/base/internal/CMakeLists.txt
index 08c0e3b..d0e59ca 100644
--- a/iree/base/internal/CMakeLists.txt
+++ b/runtime/src/iree/base/internal/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/base/internal/BUILD                                                     #
+# runtime/src/iree/base/internal/BUILD                                         #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
@@ -291,6 +291,8 @@
     span
   HDRS
     "span.h"
+  DEPS
+
   PUBLIC
 )
 
diff --git a/iree/base/internal/arena.c b/runtime/src/iree/base/internal/arena.c
similarity index 100%
rename from iree/base/internal/arena.c
rename to runtime/src/iree/base/internal/arena.c
diff --git a/iree/base/internal/arena.h b/runtime/src/iree/base/internal/arena.h
similarity index 100%
rename from iree/base/internal/arena.h
rename to runtime/src/iree/base/internal/arena.h
diff --git a/iree/base/internal/atomic_slist.c b/runtime/src/iree/base/internal/atomic_slist.c
similarity index 100%
rename from iree/base/internal/atomic_slist.c
rename to runtime/src/iree/base/internal/atomic_slist.c
diff --git a/iree/base/internal/atomic_slist.h b/runtime/src/iree/base/internal/atomic_slist.h
similarity index 100%
rename from iree/base/internal/atomic_slist.h
rename to runtime/src/iree/base/internal/atomic_slist.h
diff --git a/iree/base/internal/atomic_slist_test.cc b/runtime/src/iree/base/internal/atomic_slist_test.cc
similarity index 100%
rename from iree/base/internal/atomic_slist_test.cc
rename to runtime/src/iree/base/internal/atomic_slist_test.cc
diff --git a/iree/base/internal/atomics.h b/runtime/src/iree/base/internal/atomics.h
similarity index 100%
rename from iree/base/internal/atomics.h
rename to runtime/src/iree/base/internal/atomics.h
diff --git a/iree/base/internal/atomics_clang.h b/runtime/src/iree/base/internal/atomics_clang.h
similarity index 100%
rename from iree/base/internal/atomics_clang.h
rename to runtime/src/iree/base/internal/atomics_clang.h
diff --git a/iree/base/internal/atomics_disabled.h b/runtime/src/iree/base/internal/atomics_disabled.h
similarity index 100%
rename from iree/base/internal/atomics_disabled.h
rename to runtime/src/iree/base/internal/atomics_disabled.h
diff --git a/iree/base/internal/atomics_gcc.h b/runtime/src/iree/base/internal/atomics_gcc.h
similarity index 100%
rename from iree/base/internal/atomics_gcc.h
rename to runtime/src/iree/base/internal/atomics_gcc.h
diff --git a/iree/base/internal/atomics_msvc.h b/runtime/src/iree/base/internal/atomics_msvc.h
similarity index 100%
rename from iree/base/internal/atomics_msvc.h
rename to runtime/src/iree/base/internal/atomics_msvc.h
diff --git a/iree/base/internal/atomics_test.cc b/runtime/src/iree/base/internal/atomics_test.cc
similarity index 100%
rename from iree/base/internal/atomics_test.cc
rename to runtime/src/iree/base/internal/atomics_test.cc
diff --git a/iree/base/internal/call_once.h b/runtime/src/iree/base/internal/call_once.h
similarity index 100%
rename from iree/base/internal/call_once.h
rename to runtime/src/iree/base/internal/call_once.h
diff --git a/iree/base/internal/cpu.c b/runtime/src/iree/base/internal/cpu.c
similarity index 100%
rename from iree/base/internal/cpu.c
rename to runtime/src/iree/base/internal/cpu.c
diff --git a/iree/base/internal/cpu.h b/runtime/src/iree/base/internal/cpu.h
similarity index 100%
rename from iree/base/internal/cpu.h
rename to runtime/src/iree/base/internal/cpu.h
diff --git a/iree/base/internal/debugging.h b/runtime/src/iree/base/internal/debugging.h
similarity index 100%
rename from iree/base/internal/debugging.h
rename to runtime/src/iree/base/internal/debugging.h
diff --git a/iree/base/internal/dynamic_library.h b/runtime/src/iree/base/internal/dynamic_library.h
similarity index 100%
rename from iree/base/internal/dynamic_library.h
rename to runtime/src/iree/base/internal/dynamic_library.h
diff --git a/iree/base/internal/dynamic_library_posix.c b/runtime/src/iree/base/internal/dynamic_library_posix.c
similarity index 100%
rename from iree/base/internal/dynamic_library_posix.c
rename to runtime/src/iree/base/internal/dynamic_library_posix.c
diff --git a/iree/base/internal/dynamic_library_win32.c b/runtime/src/iree/base/internal/dynamic_library_win32.c
similarity index 100%
rename from iree/base/internal/dynamic_library_win32.c
rename to runtime/src/iree/base/internal/dynamic_library_win32.c
diff --git a/iree/base/internal/event_pool.c b/runtime/src/iree/base/internal/event_pool.c
similarity index 100%
rename from iree/base/internal/event_pool.c
rename to runtime/src/iree/base/internal/event_pool.c
diff --git a/iree/base/internal/event_pool.h b/runtime/src/iree/base/internal/event_pool.h
similarity index 100%
rename from iree/base/internal/event_pool.h
rename to runtime/src/iree/base/internal/event_pool.h
diff --git a/iree/base/internal/file_io.c b/runtime/src/iree/base/internal/file_io.c
similarity index 100%
rename from iree/base/internal/file_io.c
rename to runtime/src/iree/base/internal/file_io.c
diff --git a/iree/base/internal/file_io.h b/runtime/src/iree/base/internal/file_io.h
similarity index 100%
rename from iree/base/internal/file_io.h
rename to runtime/src/iree/base/internal/file_io.h
diff --git a/iree/base/internal/file_io_test.cc b/runtime/src/iree/base/internal/file_io_test.cc
similarity index 100%
rename from iree/base/internal/file_io_test.cc
rename to runtime/src/iree/base/internal/file_io_test.cc
diff --git a/iree/base/internal/file_path.c b/runtime/src/iree/base/internal/file_path.c
similarity index 100%
rename from iree/base/internal/file_path.c
rename to runtime/src/iree/base/internal/file_path.c
diff --git a/iree/base/internal/file_path.h b/runtime/src/iree/base/internal/file_path.h
similarity index 100%
rename from iree/base/internal/file_path.h
rename to runtime/src/iree/base/internal/file_path.h
diff --git a/iree/base/internal/file_path_test.cc b/runtime/src/iree/base/internal/file_path_test.cc
similarity index 100%
rename from iree/base/internal/file_path_test.cc
rename to runtime/src/iree/base/internal/file_path_test.cc
diff --git a/iree/base/internal/flags.c b/runtime/src/iree/base/internal/flags.c
similarity index 100%
rename from iree/base/internal/flags.c
rename to runtime/src/iree/base/internal/flags.c
diff --git a/iree/base/internal/flags.h b/runtime/src/iree/base/internal/flags.h
similarity index 100%
rename from iree/base/internal/flags.h
rename to runtime/src/iree/base/internal/flags.h
diff --git a/iree/base/internal/flags_demo.c b/runtime/src/iree/base/internal/flags_demo.c
similarity index 100%
rename from iree/base/internal/flags_demo.c
rename to runtime/src/iree/base/internal/flags_demo.c
diff --git a/iree/base/internal/flags_test.txt b/runtime/src/iree/base/internal/flags_test.txt
similarity index 100%
rename from iree/base/internal/flags_test.txt
rename to runtime/src/iree/base/internal/flags_test.txt
diff --git a/iree/base/internal/flatcc/BUILD b/runtime/src/iree/base/internal/flatcc/BUILD
similarity index 88%
rename from iree/base/internal/flatcc/BUILD
rename to runtime/src/iree/base/internal/flatcc/BUILD
index 6312489..c7a93dd 100644
--- a/iree/base/internal/flatcc/BUILD
+++ b/runtime/src/iree/base/internal/flatcc/BUILD
@@ -5,6 +5,7 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 load("//build_tools/bazel:iree_flatcc.bzl", "iree_flatbuffer_c_library")
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library")
 
 package(
     default_visibility = ["//visibility:public"],
@@ -12,7 +13,7 @@
     licenses = ["notice"],  # Apache 2.0
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "building",
     hdrs = ["building.h"],
     deps = [
@@ -22,7 +23,7 @@
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "debugging",
     hdrs = ["debugging.h"],
     deps = [
@@ -31,7 +32,7 @@
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "parsing",
     hdrs = ["parsing.h"],
     deps = [
diff --git a/iree/base/internal/flatcc/CMakeLists.txt b/runtime/src/iree/base/internal/flatcc/CMakeLists.txt
similarity index 94%
rename from iree/base/internal/flatcc/CMakeLists.txt
rename to runtime/src/iree/base/internal/flatcc/CMakeLists.txt
index affb08f..92d2ee7 100644
--- a/iree/base/internal/flatcc/CMakeLists.txt
+++ b/runtime/src/iree/base/internal/flatcc/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/base/internal/flatcc/BUILD                                              #
+# runtime/src/iree/base/internal/flatcc/BUILD                                  #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/base/internal/flatcc/building.h b/runtime/src/iree/base/internal/flatcc/building.h
similarity index 100%
rename from iree/base/internal/flatcc/building.h
rename to runtime/src/iree/base/internal/flatcc/building.h
diff --git a/iree/base/internal/flatcc/debugging.h b/runtime/src/iree/base/internal/flatcc/debugging.h
similarity index 100%
rename from iree/base/internal/flatcc/debugging.h
rename to runtime/src/iree/base/internal/flatcc/debugging.h
diff --git a/iree/base/internal/flatcc/dummy.fbs b/runtime/src/iree/base/internal/flatcc/dummy.fbs
similarity index 100%
rename from iree/base/internal/flatcc/dummy.fbs
rename to runtime/src/iree/base/internal/flatcc/dummy.fbs
diff --git a/iree/base/internal/flatcc/parsing.h b/runtime/src/iree/base/internal/flatcc/parsing.h
similarity index 100%
rename from iree/base/internal/flatcc/parsing.h
rename to runtime/src/iree/base/internal/flatcc/parsing.h
diff --git a/iree/base/internal/fpu_state.c b/runtime/src/iree/base/internal/fpu_state.c
similarity index 100%
rename from iree/base/internal/fpu_state.c
rename to runtime/src/iree/base/internal/fpu_state.c
diff --git a/iree/base/internal/fpu_state.h b/runtime/src/iree/base/internal/fpu_state.h
similarity index 100%
rename from iree/base/internal/fpu_state.h
rename to runtime/src/iree/base/internal/fpu_state.h
diff --git a/iree/base/internal/fpu_state_benchmark.cc b/runtime/src/iree/base/internal/fpu_state_benchmark.cc
similarity index 100%
rename from iree/base/internal/fpu_state_benchmark.cc
rename to runtime/src/iree/base/internal/fpu_state_benchmark.cc
diff --git a/iree/base/internal/fpu_state_test.cc b/runtime/src/iree/base/internal/fpu_state_test.cc
similarity index 100%
rename from iree/base/internal/fpu_state_test.cc
rename to runtime/src/iree/base/internal/fpu_state_test.cc
diff --git a/iree/base/internal/inline_array.h b/runtime/src/iree/base/internal/inline_array.h
similarity index 100%
rename from iree/base/internal/inline_array.h
rename to runtime/src/iree/base/internal/inline_array.h
diff --git a/iree/base/internal/main.h b/runtime/src/iree/base/internal/main.h
similarity index 100%
rename from iree/base/internal/main.h
rename to runtime/src/iree/base/internal/main.h
diff --git a/iree/base/internal/main_posix.c b/runtime/src/iree/base/internal/main_posix.c
similarity index 100%
rename from iree/base/internal/main_posix.c
rename to runtime/src/iree/base/internal/main_posix.c
diff --git a/iree/base/internal/main_win32.c b/runtime/src/iree/base/internal/main_win32.c
similarity index 100%
rename from iree/base/internal/main_win32.c
rename to runtime/src/iree/base/internal/main_win32.c
diff --git a/iree/base/internal/math.h b/runtime/src/iree/base/internal/math.h
similarity index 100%
rename from iree/base/internal/math.h
rename to runtime/src/iree/base/internal/math.h
diff --git a/iree/base/internal/math_test.cc b/runtime/src/iree/base/internal/math_test.cc
similarity index 100%
rename from iree/base/internal/math_test.cc
rename to runtime/src/iree/base/internal/math_test.cc
diff --git a/iree/base/internal/prng.h b/runtime/src/iree/base/internal/prng.h
similarity index 100%
rename from iree/base/internal/prng.h
rename to runtime/src/iree/base/internal/prng.h
diff --git a/iree/base/internal/prng_test.cc b/runtime/src/iree/base/internal/prng_test.cc
similarity index 100%
rename from iree/base/internal/prng_test.cc
rename to runtime/src/iree/base/internal/prng_test.cc
diff --git a/iree/base/internal/span.h b/runtime/src/iree/base/internal/span.h
similarity index 100%
rename from iree/base/internal/span.h
rename to runtime/src/iree/base/internal/span.h
diff --git a/iree/base/internal/synchronization.c b/runtime/src/iree/base/internal/synchronization.c
similarity index 100%
rename from iree/base/internal/synchronization.c
rename to runtime/src/iree/base/internal/synchronization.c
diff --git a/iree/base/internal/synchronization.h b/runtime/src/iree/base/internal/synchronization.h
similarity index 100%
rename from iree/base/internal/synchronization.h
rename to runtime/src/iree/base/internal/synchronization.h
diff --git a/iree/base/internal/synchronization_benchmark.cc b/runtime/src/iree/base/internal/synchronization_benchmark.cc
similarity index 100%
rename from iree/base/internal/synchronization_benchmark.cc
rename to runtime/src/iree/base/internal/synchronization_benchmark.cc
diff --git a/iree/base/internal/synchronization_test.cc b/runtime/src/iree/base/internal/synchronization_test.cc
similarity index 100%
rename from iree/base/internal/synchronization_test.cc
rename to runtime/src/iree/base/internal/synchronization_test.cc
diff --git a/iree/base/internal/threading.c b/runtime/src/iree/base/internal/threading.c
similarity index 100%
rename from iree/base/internal/threading.c
rename to runtime/src/iree/base/internal/threading.c
diff --git a/iree/base/internal/threading.h b/runtime/src/iree/base/internal/threading.h
similarity index 100%
rename from iree/base/internal/threading.h
rename to runtime/src/iree/base/internal/threading.h
diff --git a/iree/base/internal/threading_darwin.c b/runtime/src/iree/base/internal/threading_darwin.c
similarity index 100%
rename from iree/base/internal/threading_darwin.c
rename to runtime/src/iree/base/internal/threading_darwin.c
diff --git a/iree/base/internal/threading_impl.h b/runtime/src/iree/base/internal/threading_impl.h
similarity index 100%
rename from iree/base/internal/threading_impl.h
rename to runtime/src/iree/base/internal/threading_impl.h
diff --git a/iree/base/internal/threading_pthreads.c b/runtime/src/iree/base/internal/threading_pthreads.c
similarity index 100%
rename from iree/base/internal/threading_pthreads.c
rename to runtime/src/iree/base/internal/threading_pthreads.c
diff --git a/iree/base/internal/threading_test.cc b/runtime/src/iree/base/internal/threading_test.cc
similarity index 100%
rename from iree/base/internal/threading_test.cc
rename to runtime/src/iree/base/internal/threading_test.cc
diff --git a/iree/base/internal/threading_win32.c b/runtime/src/iree/base/internal/threading_win32.c
similarity index 100%
rename from iree/base/internal/threading_win32.c
rename to runtime/src/iree/base/internal/threading_win32.c
diff --git a/iree/base/internal/wait_handle.c b/runtime/src/iree/base/internal/wait_handle.c
similarity index 100%
rename from iree/base/internal/wait_handle.c
rename to runtime/src/iree/base/internal/wait_handle.c
diff --git a/iree/base/internal/wait_handle.h b/runtime/src/iree/base/internal/wait_handle.h
similarity index 100%
rename from iree/base/internal/wait_handle.h
rename to runtime/src/iree/base/internal/wait_handle.h
diff --git a/iree/base/internal/wait_handle_epoll.c b/runtime/src/iree/base/internal/wait_handle_epoll.c
similarity index 100%
rename from iree/base/internal/wait_handle_epoll.c
rename to runtime/src/iree/base/internal/wait_handle_epoll.c
diff --git a/iree/base/internal/wait_handle_impl.h b/runtime/src/iree/base/internal/wait_handle_impl.h
similarity index 100%
rename from iree/base/internal/wait_handle_impl.h
rename to runtime/src/iree/base/internal/wait_handle_impl.h
diff --git a/iree/base/internal/wait_handle_inproc.c b/runtime/src/iree/base/internal/wait_handle_inproc.c
similarity index 100%
rename from iree/base/internal/wait_handle_inproc.c
rename to runtime/src/iree/base/internal/wait_handle_inproc.c
diff --git a/iree/base/internal/wait_handle_kqueue.c b/runtime/src/iree/base/internal/wait_handle_kqueue.c
similarity index 100%
rename from iree/base/internal/wait_handle_kqueue.c
rename to runtime/src/iree/base/internal/wait_handle_kqueue.c
diff --git a/iree/base/internal/wait_handle_null.c b/runtime/src/iree/base/internal/wait_handle_null.c
similarity index 100%
rename from iree/base/internal/wait_handle_null.c
rename to runtime/src/iree/base/internal/wait_handle_null.c
diff --git a/iree/base/internal/wait_handle_poll.c b/runtime/src/iree/base/internal/wait_handle_poll.c
similarity index 100%
rename from iree/base/internal/wait_handle_poll.c
rename to runtime/src/iree/base/internal/wait_handle_poll.c
diff --git a/iree/base/internal/wait_handle_posix.c b/runtime/src/iree/base/internal/wait_handle_posix.c
similarity index 100%
rename from iree/base/internal/wait_handle_posix.c
rename to runtime/src/iree/base/internal/wait_handle_posix.c
diff --git a/iree/base/internal/wait_handle_posix.h b/runtime/src/iree/base/internal/wait_handle_posix.h
similarity index 100%
rename from iree/base/internal/wait_handle_posix.h
rename to runtime/src/iree/base/internal/wait_handle_posix.h
diff --git a/iree/base/internal/wait_handle_test.cc b/runtime/src/iree/base/internal/wait_handle_test.cc
similarity index 100%
rename from iree/base/internal/wait_handle_test.cc
rename to runtime/src/iree/base/internal/wait_handle_test.cc
diff --git a/iree/base/internal/wait_handle_win32.c b/runtime/src/iree/base/internal/wait_handle_win32.c
similarity index 100%
rename from iree/base/internal/wait_handle_win32.c
rename to runtime/src/iree/base/internal/wait_handle_win32.c
diff --git a/iree/base/logging.cc b/runtime/src/iree/base/logging.cc
similarity index 100%
rename from iree/base/logging.cc
rename to runtime/src/iree/base/logging.cc
diff --git a/iree/base/logging.h b/runtime/src/iree/base/logging.h
similarity index 100%
rename from iree/base/logging.h
rename to runtime/src/iree/base/logging.h
diff --git a/iree/base/loop.c b/runtime/src/iree/base/loop.c
similarity index 100%
rename from iree/base/loop.c
rename to runtime/src/iree/base/loop.c
diff --git a/iree/base/loop.h b/runtime/src/iree/base/loop.h
similarity index 100%
rename from iree/base/loop.h
rename to runtime/src/iree/base/loop.h
diff --git a/iree/base/loop_inline.c b/runtime/src/iree/base/loop_inline.c
similarity index 100%
rename from iree/base/loop_inline.c
rename to runtime/src/iree/base/loop_inline.c
diff --git a/iree/base/loop_inline.h b/runtime/src/iree/base/loop_inline.h
similarity index 100%
rename from iree/base/loop_inline.h
rename to runtime/src/iree/base/loop_inline.h
diff --git a/iree/base/loop_inline_test.cc b/runtime/src/iree/base/loop_inline_test.cc
similarity index 100%
rename from iree/base/loop_inline_test.cc
rename to runtime/src/iree/base/loop_inline_test.cc
diff --git a/iree/base/loop_sync.c b/runtime/src/iree/base/loop_sync.c
similarity index 100%
rename from iree/base/loop_sync.c
rename to runtime/src/iree/base/loop_sync.c
diff --git a/iree/base/loop_sync.h b/runtime/src/iree/base/loop_sync.h
similarity index 100%
rename from iree/base/loop_sync.h
rename to runtime/src/iree/base/loop_sync.h
diff --git a/iree/base/loop_sync_test.cc b/runtime/src/iree/base/loop_sync_test.cc
similarity index 100%
rename from iree/base/loop_sync_test.cc
rename to runtime/src/iree/base/loop_sync_test.cc
diff --git a/iree/base/loop_test.h b/runtime/src/iree/base/loop_test.h
similarity index 100%
rename from iree/base/loop_test.h
rename to runtime/src/iree/base/loop_test.h
diff --git a/iree/base/status.c b/runtime/src/iree/base/status.c
similarity index 100%
rename from iree/base/status.c
rename to runtime/src/iree/base/status.c
diff --git a/iree/base/status.h b/runtime/src/iree/base/status.h
similarity index 100%
rename from iree/base/status.h
rename to runtime/src/iree/base/status.h
diff --git a/iree/base/status_cc.cc b/runtime/src/iree/base/status_cc.cc
similarity index 100%
rename from iree/base/status_cc.cc
rename to runtime/src/iree/base/status_cc.cc
diff --git a/iree/base/status_cc.h b/runtime/src/iree/base/status_cc.h
similarity index 100%
rename from iree/base/status_cc.h
rename to runtime/src/iree/base/status_cc.h
diff --git a/iree/base/status_test.cc b/runtime/src/iree/base/status_test.cc
similarity index 100%
rename from iree/base/status_test.cc
rename to runtime/src/iree/base/status_test.cc
diff --git a/iree/base/string_builder.c b/runtime/src/iree/base/string_builder.c
similarity index 100%
rename from iree/base/string_builder.c
rename to runtime/src/iree/base/string_builder.c
diff --git a/iree/base/string_builder.h b/runtime/src/iree/base/string_builder.h
similarity index 100%
rename from iree/base/string_builder.h
rename to runtime/src/iree/base/string_builder.h
diff --git a/iree/base/string_builder_test.cc b/runtime/src/iree/base/string_builder_test.cc
similarity index 100%
rename from iree/base/string_builder_test.cc
rename to runtime/src/iree/base/string_builder_test.cc
diff --git a/iree/base/string_view.c b/runtime/src/iree/base/string_view.c
similarity index 100%
rename from iree/base/string_view.c
rename to runtime/src/iree/base/string_view.c
diff --git a/iree/base/string_view.h b/runtime/src/iree/base/string_view.h
similarity index 100%
rename from iree/base/string_view.h
rename to runtime/src/iree/base/string_view.h
diff --git a/iree/base/string_view_test.cc b/runtime/src/iree/base/string_view_test.cc
similarity index 100%
rename from iree/base/string_view_test.cc
rename to runtime/src/iree/base/string_view_test.cc
diff --git a/iree/base/target_platform.h b/runtime/src/iree/base/target_platform.h
similarity index 100%
rename from iree/base/target_platform.h
rename to runtime/src/iree/base/target_platform.h
diff --git a/iree/base/testing/BUILD b/runtime/src/iree/base/testing/BUILD
similarity index 72%
rename from iree/base/testing/BUILD
rename to runtime/src/iree/base/testing/BUILD
index 55bdfe9..abc160b 100644
--- a/iree/base/testing/BUILD
+++ b/runtime/src/iree/base/testing/BUILD
@@ -5,6 +5,7 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 load("//build_tools/embed_data:build_defs.bzl", "c_embed_data")
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_test")
 
 package(
     default_visibility = ["//visibility:public"],
@@ -28,16 +29,16 @@
     h_file_output = "dynamic_library_test_library_embed.h",
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "dynamic_library_test",
     srcs = ["dynamic_library_test.cc"],
     deps = [
         ":dynamic_library_test_library",
-        "//iree/base",
-        "//iree/base:logging",
-        "//iree/base/internal:dynamic_library",
-        "//iree/base/internal:file_io",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/base/internal:dynamic_library",
+        "//runtime/src/iree/base/internal:file_io",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
diff --git a/iree/base/testing/CMakeLists.txt b/runtime/src/iree/base/testing/CMakeLists.txt
similarity index 100%
rename from iree/base/testing/CMakeLists.txt
rename to runtime/src/iree/base/testing/CMakeLists.txt
diff --git a/iree/base/testing/dynamic_library_test.cc b/runtime/src/iree/base/testing/dynamic_library_test.cc
similarity index 100%
rename from iree/base/testing/dynamic_library_test.cc
rename to runtime/src/iree/base/testing/dynamic_library_test.cc
diff --git a/iree/base/testing/dynamic_library_test_library.cc b/runtime/src/iree/base/testing/dynamic_library_test_library.cc
similarity index 100%
rename from iree/base/testing/dynamic_library_test_library.cc
rename to runtime/src/iree/base/testing/dynamic_library_test_library.cc
diff --git a/iree/base/time.c b/runtime/src/iree/base/time.c
similarity index 100%
rename from iree/base/time.c
rename to runtime/src/iree/base/time.c
diff --git a/iree/base/time.h b/runtime/src/iree/base/time.h
similarity index 100%
rename from iree/base/time.h
rename to runtime/src/iree/base/time.h
diff --git a/iree/base/tracing.cc b/runtime/src/iree/base/tracing.cc
similarity index 100%
rename from iree/base/tracing.cc
rename to runtime/src/iree/base/tracing.cc
diff --git a/iree/base/tracing.h b/runtime/src/iree/base/tracing.h
similarity index 100%
rename from iree/base/tracing.h
rename to runtime/src/iree/base/tracing.h
diff --git a/iree/base/wait_source.c b/runtime/src/iree/base/wait_source.c
similarity index 100%
rename from iree/base/wait_source.c
rename to runtime/src/iree/base/wait_source.c
diff --git a/iree/base/wait_source.h b/runtime/src/iree/base/wait_source.h
similarity index 100%
rename from iree/base/wait_source.h
rename to runtime/src/iree/base/wait_source.h
diff --git a/iree/builtins/BUILD b/runtime/src/iree/builtins/BUILD
similarity index 100%
rename from iree/builtins/BUILD
rename to runtime/src/iree/builtins/BUILD
diff --git a/iree/hal/vmvx/CMakeLists.txt b/runtime/src/iree/builtins/CMakeLists.txt
similarity index 91%
rename from iree/hal/vmvx/CMakeLists.txt
rename to runtime/src/iree/builtins/CMakeLists.txt
index 0866391..954e388 100644
--- a/iree/hal/vmvx/CMakeLists.txt
+++ b/runtime/src/iree/builtins/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vmvx/BUILD                                                          #
+# runtime/src/iree/builtins/BUILD                                              #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/builtins/device/BUILD b/runtime/src/iree/builtins/device/BUILD
similarity index 84%
rename from iree/builtins/device/BUILD
rename to runtime/src/iree/builtins/device/BUILD
index 69662e0..f670428 100644
--- a/iree/builtins/device/BUILD
+++ b/runtime/src/iree/builtins/device/BUILD
@@ -4,13 +4,15 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
     licenses = ["notice"],  # Apache 2.0
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "device",
     srcs = [
         "device_generic.c",
diff --git a/iree/builtins/device/CMakeLists.txt b/runtime/src/iree/builtins/device/CMakeLists.txt
similarity index 91%
rename from iree/builtins/device/CMakeLists.txt
rename to runtime/src/iree/builtins/device/CMakeLists.txt
index 9a89402..b16043e 100644
--- a/iree/builtins/device/CMakeLists.txt
+++ b/runtime/src/iree/builtins/device/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/builtins/device/BUILD                                                   #
+# runtime/src/iree/builtins/device/BUILD                                       #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
@@ -17,6 +17,8 @@
     "device.h"
   SRCS
     "device_generic.c"
+  DEPS
+
   PUBLIC
 )
 
diff --git a/iree/builtins/device/README.md b/runtime/src/iree/builtins/device/README.md
similarity index 100%
rename from iree/builtins/device/README.md
rename to runtime/src/iree/builtins/device/README.md
diff --git a/iree/builtins/device/bin/BUILD b/runtime/src/iree/builtins/device/bin/BUILD
similarity index 91%
rename from iree/builtins/device/bin/BUILD
rename to runtime/src/iree/builtins/device/bin/BUILD
index 29c7065..286e32a 100644
--- a/iree/builtins/device/bin/BUILD
+++ b/runtime/src/iree/builtins/device/bin/BUILD
@@ -22,4 +22,7 @@
     flatten = True,
     h_file_output = "libdevice.h",
     identifier = "iree_builtins_libdevice",
+    deps = [
+        "//runtime/src:runtime_defines",
+    ],
 )
diff --git a/iree/builtins/device/bin/CMakeLists.txt b/runtime/src/iree/builtins/device/bin/CMakeLists.txt
similarity index 92%
rename from iree/builtins/device/bin/CMakeLists.txt
rename to runtime/src/iree/builtins/device/bin/CMakeLists.txt
index e3976c8..105bf87 100644
--- a/iree/builtins/device/bin/CMakeLists.txt
+++ b/runtime/src/iree/builtins/device/bin/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/builtins/device/bin/BUILD                                               #
+# runtime/src/iree/builtins/device/bin/BUILD                                   #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
@@ -16,6 +16,8 @@
   SRCS
     "libdevice_wasm32_generic.bc"
     "libdevice_wasm64_generic.bc"
+  DEPS
+
   C_FILE_OUTPUT
     "libdevice.c"
   H_FILE_OUTPUT
diff --git a/iree/builtins/device/bin/build.sh b/runtime/src/iree/builtins/device/bin/build.sh
similarity index 100%
rename from iree/builtins/device/bin/build.sh
rename to runtime/src/iree/builtins/device/bin/build.sh
diff --git a/iree/builtins/device/bin/libdevice_wasm32_generic.bc b/runtime/src/iree/builtins/device/bin/libdevice_wasm32_generic.bc
similarity index 100%
rename from iree/builtins/device/bin/libdevice_wasm32_generic.bc
rename to runtime/src/iree/builtins/device/bin/libdevice_wasm32_generic.bc
Binary files differ
diff --git a/iree/builtins/device/bin/libdevice_wasm64_generic.bc b/runtime/src/iree/builtins/device/bin/libdevice_wasm64_generic.bc
similarity index 100%
rename from iree/builtins/device/bin/libdevice_wasm64_generic.bc
rename to runtime/src/iree/builtins/device/bin/libdevice_wasm64_generic.bc
Binary files differ
diff --git a/iree/builtins/device/device.h b/runtime/src/iree/builtins/device/device.h
similarity index 100%
rename from iree/builtins/device/device.h
rename to runtime/src/iree/builtins/device/device.h
diff --git a/iree/builtins/device/device_generic.c b/runtime/src/iree/builtins/device/device_generic.c
similarity index 100%
rename from iree/builtins/device/device_generic.c
rename to runtime/src/iree/builtins/device/device_generic.c
diff --git a/runtime/src/iree/builtins/device/tools/BUILD b/runtime/src/iree/builtins/device/tools/BUILD
new file mode 100644
index 0000000..de878d0
--- /dev/null
+++ b/runtime/src/iree/builtins/device/tools/BUILD
@@ -0,0 +1,37 @@
+# Copyright 2021 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+load("//build_tools/bazel:cc_binary_benchmark.bzl", "cc_binary_benchmark")
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_test")
+
+package(
+    default_visibility = ["//visibility:public"],
+    features = ["layering_check"],
+    licenses = ["notice"],  # Apache 2.0
+)
+
+cc_binary_benchmark(
+    name = "libdevice_benchmark",
+    srcs = ["libdevice_benchmark.c"],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/builtins/device",
+        "//runtime/src/iree/testing:benchmark",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "libdevice_test",
+    srcs = ["libdevice_test.cc"],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/builtins/device",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
diff --git a/iree/builtins/device/tools/CMakeLists.txt b/runtime/src/iree/builtins/device/tools/CMakeLists.txt
similarity index 94%
rename from iree/builtins/device/tools/CMakeLists.txt
rename to runtime/src/iree/builtins/device/tools/CMakeLists.txt
index e445a9b..70e68f0 100644
--- a/iree/builtins/device/tools/CMakeLists.txt
+++ b/runtime/src/iree/builtins/device/tools/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/builtins/device/tools/BUILD                                             #
+# runtime/src/iree/builtins/device/tools/BUILD                                 #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/builtins/device/tools/libdevice_benchmark.c b/runtime/src/iree/builtins/device/tools/libdevice_benchmark.c
similarity index 100%
rename from iree/builtins/device/tools/libdevice_benchmark.c
rename to runtime/src/iree/builtins/device/tools/libdevice_benchmark.c
diff --git a/iree/builtins/device/tools/libdevice_test.cc b/runtime/src/iree/builtins/device/tools/libdevice_test.cc
similarity index 100%
rename from iree/builtins/device/tools/libdevice_test.cc
rename to runtime/src/iree/builtins/device/tools/libdevice_test.cc
diff --git a/iree/builtins/musl/BUILD b/runtime/src/iree/builtins/musl/BUILD
similarity index 100%
rename from iree/builtins/musl/BUILD
rename to runtime/src/iree/builtins/musl/BUILD
diff --git a/iree/hal/vmvx/CMakeLists.txt b/runtime/src/iree/builtins/musl/CMakeLists.txt
similarity index 91%
copy from iree/hal/vmvx/CMakeLists.txt
copy to runtime/src/iree/builtins/musl/CMakeLists.txt
index 0866391..8da1a73 100644
--- a/iree/hal/vmvx/CMakeLists.txt
+++ b/runtime/src/iree/builtins/musl/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vmvx/BUILD                                                          #
+# runtime/src/iree/builtins/musl/BUILD                                         #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/builtins/musl/Makefile_wasm32.iree b/runtime/src/iree/builtins/musl/Makefile_wasm32.iree
similarity index 100%
rename from iree/builtins/musl/Makefile_wasm32.iree
rename to runtime/src/iree/builtins/musl/Makefile_wasm32.iree
diff --git a/iree/builtins/musl/Makefile_wasm64.iree b/runtime/src/iree/builtins/musl/Makefile_wasm64.iree
similarity index 100%
rename from iree/builtins/musl/Makefile_wasm64.iree
rename to runtime/src/iree/builtins/musl/Makefile_wasm64.iree
diff --git a/iree/builtins/musl/bin/BUILD b/runtime/src/iree/builtins/musl/bin/BUILD
similarity index 91%
rename from iree/builtins/musl/bin/BUILD
rename to runtime/src/iree/builtins/musl/bin/BUILD
index 4fad08b..d9a2529 100644
--- a/iree/builtins/musl/bin/BUILD
+++ b/runtime/src/iree/builtins/musl/bin/BUILD
@@ -22,4 +22,7 @@
     flatten = True,
     h_file_output = "libmusl.h",
     identifier = "iree_builtins_libmusl",
+    deps = [
+        "//runtime/src:runtime_defines",
+    ],
 )
diff --git a/iree/builtins/musl/bin/CMakeLists.txt b/runtime/src/iree/builtins/musl/bin/CMakeLists.txt
similarity index 92%
rename from iree/builtins/musl/bin/CMakeLists.txt
rename to runtime/src/iree/builtins/musl/bin/CMakeLists.txt
index 4705d0a..433fd58 100644
--- a/iree/builtins/musl/bin/CMakeLists.txt
+++ b/runtime/src/iree/builtins/musl/bin/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/builtins/musl/bin/BUILD                                                 #
+# runtime/src/iree/builtins/musl/bin/BUILD                                     #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
@@ -16,6 +16,8 @@
   SRCS
     "libmusl_wasm32_generic.bc"
     "libmusl_wasm64_generic.bc"
+  DEPS
+
   C_FILE_OUTPUT
     "libmusl.c"
   H_FILE_OUTPUT
diff --git a/iree/builtins/musl/bin/build.sh b/runtime/src/iree/builtins/musl/bin/build.sh
similarity index 100%
rename from iree/builtins/musl/bin/build.sh
rename to runtime/src/iree/builtins/musl/bin/build.sh
diff --git a/iree/builtins/musl/bin/libmusl_wasm32_generic.bc b/runtime/src/iree/builtins/musl/bin/libmusl_wasm32_generic.bc
similarity index 100%
rename from iree/builtins/musl/bin/libmusl_wasm32_generic.bc
rename to runtime/src/iree/builtins/musl/bin/libmusl_wasm32_generic.bc
Binary files differ
diff --git a/iree/builtins/musl/bin/libmusl_wasm64_generic.bc b/runtime/src/iree/builtins/musl/bin/libmusl_wasm64_generic.bc
similarity index 100%
rename from iree/builtins/musl/bin/libmusl_wasm64_generic.bc
rename to runtime/src/iree/builtins/musl/bin/libmusl_wasm64_generic.bc
Binary files differ
diff --git a/iree/hal/BUILD b/runtime/src/iree/hal/BUILD
similarity index 76%
rename from iree/hal/BUILD
rename to runtime/src/iree/hal/BUILD
index ece606e..97d9270 100644
--- a/iree/hal/BUILD
+++ b/runtime/src/iree/hal/BUILD
@@ -8,6 +8,8 @@
 # Subdirectories contain implementations for different hardware and
 # software backends.
 
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library", "iree_runtime_cc_test")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
@@ -18,7 +20,7 @@
 # Public API
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "hal",
     srcs = [
         "allocator.c",
@@ -66,23 +68,23 @@
     ],
     visibility = ["//visibility:public"],
     deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal",
-        "//iree/base/internal:synchronization",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal:synchronization",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "string_util_test",
     srcs = ["string_util_test.cc"],
     deps = [
         ":hal",
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base/internal:span",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base/internal:span",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
diff --git a/iree/hal/CMakeLists.txt b/runtime/src/iree/hal/CMakeLists.txt
similarity index 96%
rename from iree/hal/CMakeLists.txt
rename to runtime/src/iree/hal/CMakeLists.txt
index eb0afe7..a4e2bbb 100644
--- a/iree/hal/CMakeLists.txt
+++ b/runtime/src/iree/hal/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/BUILD                                                               #
+# runtime/src/iree/hal/BUILD                                                   #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/README.md b/runtime/src/iree/hal/README.md
similarity index 100%
rename from iree/hal/README.md
rename to runtime/src/iree/hal/README.md
diff --git a/iree/hal/allocator.c b/runtime/src/iree/hal/allocator.c
similarity index 100%
rename from iree/hal/allocator.c
rename to runtime/src/iree/hal/allocator.c
diff --git a/iree/hal/allocator.h b/runtime/src/iree/hal/allocator.h
similarity index 100%
rename from iree/hal/allocator.h
rename to runtime/src/iree/hal/allocator.h
diff --git a/iree/hal/allocator_heap.c b/runtime/src/iree/hal/allocator_heap.c
similarity index 100%
rename from iree/hal/allocator_heap.c
rename to runtime/src/iree/hal/allocator_heap.c
diff --git a/iree/hal/api.h b/runtime/src/iree/hal/api.h
similarity index 100%
rename from iree/hal/api.h
rename to runtime/src/iree/hal/api.h
diff --git a/iree/hal/buffer.c b/runtime/src/iree/hal/buffer.c
similarity index 100%
rename from iree/hal/buffer.c
rename to runtime/src/iree/hal/buffer.c
diff --git a/iree/hal/buffer.h b/runtime/src/iree/hal/buffer.h
similarity index 100%
rename from iree/hal/buffer.h
rename to runtime/src/iree/hal/buffer.h
diff --git a/iree/hal/buffer_heap.c b/runtime/src/iree/hal/buffer_heap.c
similarity index 100%
rename from iree/hal/buffer_heap.c
rename to runtime/src/iree/hal/buffer_heap.c
diff --git a/iree/hal/buffer_heap_impl.h b/runtime/src/iree/hal/buffer_heap_impl.h
similarity index 100%
rename from iree/hal/buffer_heap_impl.h
rename to runtime/src/iree/hal/buffer_heap_impl.h
diff --git a/iree/hal/buffer_view.c b/runtime/src/iree/hal/buffer_view.c
similarity index 100%
rename from iree/hal/buffer_view.c
rename to runtime/src/iree/hal/buffer_view.c
diff --git a/iree/hal/buffer_view.h b/runtime/src/iree/hal/buffer_view.h
similarity index 100%
rename from iree/hal/buffer_view.h
rename to runtime/src/iree/hal/buffer_view.h
diff --git a/iree/hal/buffer_view_util.c b/runtime/src/iree/hal/buffer_view_util.c
similarity index 100%
rename from iree/hal/buffer_view_util.c
rename to runtime/src/iree/hal/buffer_view_util.c
diff --git a/iree/hal/buffer_view_util.h b/runtime/src/iree/hal/buffer_view_util.h
similarity index 100%
rename from iree/hal/buffer_view_util.h
rename to runtime/src/iree/hal/buffer_view_util.h
diff --git a/iree/hal/command_buffer.c b/runtime/src/iree/hal/command_buffer.c
similarity index 100%
rename from iree/hal/command_buffer.c
rename to runtime/src/iree/hal/command_buffer.c
diff --git a/iree/hal/command_buffer.h b/runtime/src/iree/hal/command_buffer.h
similarity index 100%
rename from iree/hal/command_buffer.h
rename to runtime/src/iree/hal/command_buffer.h
diff --git a/iree/hal/command_buffer_validation.c b/runtime/src/iree/hal/command_buffer_validation.c
similarity index 100%
rename from iree/hal/command_buffer_validation.c
rename to runtime/src/iree/hal/command_buffer_validation.c
diff --git a/iree/hal/command_buffer_validation.h b/runtime/src/iree/hal/command_buffer_validation.h
similarity index 100%
rename from iree/hal/command_buffer_validation.h
rename to runtime/src/iree/hal/command_buffer_validation.h
diff --git a/iree/hal/cts/CMakeLists.txt b/runtime/src/iree/hal/cts/CMakeLists.txt
similarity index 100%
rename from iree/hal/cts/CMakeLists.txt
rename to runtime/src/iree/hal/cts/CMakeLists.txt
diff --git a/iree/hal/cts/README.md b/runtime/src/iree/hal/cts/README.md
similarity index 100%
rename from iree/hal/cts/README.md
rename to runtime/src/iree/hal/cts/README.md
diff --git a/iree/hal/cts/allocator_test.h b/runtime/src/iree/hal/cts/allocator_test.h
similarity index 100%
rename from iree/hal/cts/allocator_test.h
rename to runtime/src/iree/hal/cts/allocator_test.h
diff --git a/iree/hal/cts/buffer_mapping_test.h b/runtime/src/iree/hal/cts/buffer_mapping_test.h
similarity index 100%
rename from iree/hal/cts/buffer_mapping_test.h
rename to runtime/src/iree/hal/cts/buffer_mapping_test.h
diff --git a/iree/hal/cts/command_buffer_dispatch_test.h b/runtime/src/iree/hal/cts/command_buffer_dispatch_test.h
similarity index 100%
rename from iree/hal/cts/command_buffer_dispatch_test.h
rename to runtime/src/iree/hal/cts/command_buffer_dispatch_test.h
diff --git a/iree/hal/cts/command_buffer_test.h b/runtime/src/iree/hal/cts/command_buffer_test.h
similarity index 100%
rename from iree/hal/cts/command_buffer_test.h
rename to runtime/src/iree/hal/cts/command_buffer_test.h
diff --git a/iree/hal/cts/cts_test_base.h b/runtime/src/iree/hal/cts/cts_test_base.h
similarity index 100%
rename from iree/hal/cts/cts_test_base.h
rename to runtime/src/iree/hal/cts/cts_test_base.h
diff --git a/iree/hal/cts/cts_test_template.cc.in b/runtime/src/iree/hal/cts/cts_test_template.cc.in
similarity index 100%
rename from iree/hal/cts/cts_test_template.cc.in
rename to runtime/src/iree/hal/cts/cts_test_template.cc.in
diff --git a/iree/hal/cts/descriptor_set_layout_test.h b/runtime/src/iree/hal/cts/descriptor_set_layout_test.h
similarity index 100%
rename from iree/hal/cts/descriptor_set_layout_test.h
rename to runtime/src/iree/hal/cts/descriptor_set_layout_test.h
diff --git a/iree/hal/cts/descriptor_set_test.h b/runtime/src/iree/hal/cts/descriptor_set_test.h
similarity index 100%
rename from iree/hal/cts/descriptor_set_test.h
rename to runtime/src/iree/hal/cts/descriptor_set_test.h
diff --git a/iree/hal/cts/driver_test.h b/runtime/src/iree/hal/cts/driver_test.h
similarity index 100%
rename from iree/hal/cts/driver_test.h
rename to runtime/src/iree/hal/cts/driver_test.h
diff --git a/iree/hal/cts/event_test.h b/runtime/src/iree/hal/cts/event_test.h
similarity index 100%
rename from iree/hal/cts/event_test.h
rename to runtime/src/iree/hal/cts/event_test.h
diff --git a/iree/hal/cts/executable_cache_test.h b/runtime/src/iree/hal/cts/executable_cache_test.h
similarity index 100%
rename from iree/hal/cts/executable_cache_test.h
rename to runtime/src/iree/hal/cts/executable_cache_test.h
diff --git a/iree/hal/cts/executable_layout_test.h b/runtime/src/iree/hal/cts/executable_layout_test.h
similarity index 100%
rename from iree/hal/cts/executable_layout_test.h
rename to runtime/src/iree/hal/cts/executable_layout_test.h
diff --git a/iree/hal/cts/semaphore_submission_test.h b/runtime/src/iree/hal/cts/semaphore_submission_test.h
similarity index 100%
rename from iree/hal/cts/semaphore_submission_test.h
rename to runtime/src/iree/hal/cts/semaphore_submission_test.h
diff --git a/iree/hal/cts/semaphore_test.h b/runtime/src/iree/hal/cts/semaphore_test.h
similarity index 100%
rename from iree/hal/cts/semaphore_test.h
rename to runtime/src/iree/hal/cts/semaphore_test.h
diff --git a/iree/hal/cts/testdata/command_buffer_dispatch_test.mlir b/runtime/src/iree/hal/cts/testdata/command_buffer_dispatch_test.mlir
similarity index 100%
rename from iree/hal/cts/testdata/command_buffer_dispatch_test.mlir
rename to runtime/src/iree/hal/cts/testdata/command_buffer_dispatch_test.mlir
diff --git a/iree/hal/cts/testdata/executable_cache_test.mlir b/runtime/src/iree/hal/cts/testdata/executable_cache_test.mlir
similarity index 100%
rename from iree/hal/cts/testdata/executable_cache_test.mlir
rename to runtime/src/iree/hal/cts/testdata/executable_cache_test.mlir
diff --git a/iree/hal/cuda/CMakeLists.txt b/runtime/src/iree/hal/cuda/CMakeLists.txt
similarity index 100%
rename from iree/hal/cuda/CMakeLists.txt
rename to runtime/src/iree/hal/cuda/CMakeLists.txt
diff --git a/iree/hal/cuda/api.h b/runtime/src/iree/hal/cuda/api.h
similarity index 100%
rename from iree/hal/cuda/api.h
rename to runtime/src/iree/hal/cuda/api.h
diff --git a/iree/hal/cuda/context_wrapper.h b/runtime/src/iree/hal/cuda/context_wrapper.h
similarity index 100%
rename from iree/hal/cuda/context_wrapper.h
rename to runtime/src/iree/hal/cuda/context_wrapper.h
diff --git a/iree/hal/cuda/cts/CMakeLists.txt b/runtime/src/iree/hal/cuda/cts/CMakeLists.txt
similarity index 92%
rename from iree/hal/cuda/cts/CMakeLists.txt
rename to runtime/src/iree/hal/cuda/cts/CMakeLists.txt
index 487df5c..69754f7 100644
--- a/iree/hal/cuda/cts/CMakeLists.txt
+++ b/runtime/src/iree/hal/cuda/cts/CMakeLists.txt
@@ -8,7 +8,7 @@
   DRIVER_NAME
     cuda
   DRIVER_REGISTRATION_HDR
-    "iree/hal/cuda/registration/driver_module.h"
+    "runtime/src/iree/hal/cuda/registration/driver_module.h"
   DRIVER_REGISTRATION_FN
     "iree_hal_cuda_driver_module_register"
   COMPILER_TARGET_BACKEND
@@ -35,7 +35,7 @@
   VARIANT_SUFFIX
     graph
   DRIVER_REGISTRATION_HDR
-    "iree/hal/cuda/registration/driver_module.h"
+    "runtime/src/iree/hal/cuda/registration/driver_module.h"
   DRIVER_REGISTRATION_FN
     "iree_hal_cuda_driver_module_register"
   COMPILER_TARGET_BACKEND
diff --git a/iree/hal/cuda/cuda_allocator.c b/runtime/src/iree/hal/cuda/cuda_allocator.c
similarity index 100%
rename from iree/hal/cuda/cuda_allocator.c
rename to runtime/src/iree/hal/cuda/cuda_allocator.c
diff --git a/iree/hal/cuda/cuda_allocator.h b/runtime/src/iree/hal/cuda/cuda_allocator.h
similarity index 100%
rename from iree/hal/cuda/cuda_allocator.h
rename to runtime/src/iree/hal/cuda/cuda_allocator.h
diff --git a/iree/hal/cuda/cuda_buffer.c b/runtime/src/iree/hal/cuda/cuda_buffer.c
similarity index 100%
rename from iree/hal/cuda/cuda_buffer.c
rename to runtime/src/iree/hal/cuda/cuda_buffer.c
diff --git a/iree/hal/cuda/cuda_buffer.h b/runtime/src/iree/hal/cuda/cuda_buffer.h
similarity index 100%
rename from iree/hal/cuda/cuda_buffer.h
rename to runtime/src/iree/hal/cuda/cuda_buffer.h
diff --git a/iree/hal/cuda/cuda_device.c b/runtime/src/iree/hal/cuda/cuda_device.c
similarity index 100%
rename from iree/hal/cuda/cuda_device.c
rename to runtime/src/iree/hal/cuda/cuda_device.c
diff --git a/iree/hal/cuda/cuda_device.h b/runtime/src/iree/hal/cuda/cuda_device.h
similarity index 100%
rename from iree/hal/cuda/cuda_device.h
rename to runtime/src/iree/hal/cuda/cuda_device.h
diff --git a/iree/hal/cuda/cuda_driver.c b/runtime/src/iree/hal/cuda/cuda_driver.c
similarity index 100%
rename from iree/hal/cuda/cuda_driver.c
rename to runtime/src/iree/hal/cuda/cuda_driver.c
diff --git a/iree/hal/cuda/cuda_event.c b/runtime/src/iree/hal/cuda/cuda_event.c
similarity index 100%
rename from iree/hal/cuda/cuda_event.c
rename to runtime/src/iree/hal/cuda/cuda_event.c
diff --git a/iree/hal/cuda/cuda_event.h b/runtime/src/iree/hal/cuda/cuda_event.h
similarity index 100%
rename from iree/hal/cuda/cuda_event.h
rename to runtime/src/iree/hal/cuda/cuda_event.h
diff --git a/iree/hal/cuda/cuda_headers.h b/runtime/src/iree/hal/cuda/cuda_headers.h
similarity index 100%
rename from iree/hal/cuda/cuda_headers.h
rename to runtime/src/iree/hal/cuda/cuda_headers.h
diff --git a/iree/hal/cuda/descriptor_set_layout.c b/runtime/src/iree/hal/cuda/descriptor_set_layout.c
similarity index 100%
rename from iree/hal/cuda/descriptor_set_layout.c
rename to runtime/src/iree/hal/cuda/descriptor_set_layout.c
diff --git a/iree/hal/cuda/descriptor_set_layout.h b/runtime/src/iree/hal/cuda/descriptor_set_layout.h
similarity index 100%
rename from iree/hal/cuda/descriptor_set_layout.h
rename to runtime/src/iree/hal/cuda/descriptor_set_layout.h
diff --git a/iree/hal/cuda/dynamic_symbol_tables.h b/runtime/src/iree/hal/cuda/dynamic_symbol_tables.h
similarity index 100%
rename from iree/hal/cuda/dynamic_symbol_tables.h
rename to runtime/src/iree/hal/cuda/dynamic_symbol_tables.h
diff --git a/iree/hal/cuda/dynamic_symbols.c b/runtime/src/iree/hal/cuda/dynamic_symbols.c
similarity index 100%
rename from iree/hal/cuda/dynamic_symbols.c
rename to runtime/src/iree/hal/cuda/dynamic_symbols.c
diff --git a/iree/hal/cuda/dynamic_symbols.h b/runtime/src/iree/hal/cuda/dynamic_symbols.h
similarity index 100%
rename from iree/hal/cuda/dynamic_symbols.h
rename to runtime/src/iree/hal/cuda/dynamic_symbols.h
diff --git a/iree/hal/cuda/dynamic_symbols_test.cc b/runtime/src/iree/hal/cuda/dynamic_symbols_test.cc
similarity index 100%
rename from iree/hal/cuda/dynamic_symbols_test.cc
rename to runtime/src/iree/hal/cuda/dynamic_symbols_test.cc
diff --git a/iree/hal/cuda/event_semaphore.c b/runtime/src/iree/hal/cuda/event_semaphore.c
similarity index 100%
rename from iree/hal/cuda/event_semaphore.c
rename to runtime/src/iree/hal/cuda/event_semaphore.c
diff --git a/iree/hal/cuda/event_semaphore.h b/runtime/src/iree/hal/cuda/event_semaphore.h
similarity index 100%
rename from iree/hal/cuda/event_semaphore.h
rename to runtime/src/iree/hal/cuda/event_semaphore.h
diff --git a/iree/hal/cuda/executable_layout.c b/runtime/src/iree/hal/cuda/executable_layout.c
similarity index 100%
rename from iree/hal/cuda/executable_layout.c
rename to runtime/src/iree/hal/cuda/executable_layout.c
diff --git a/iree/hal/cuda/executable_layout.h b/runtime/src/iree/hal/cuda/executable_layout.h
similarity index 100%
rename from iree/hal/cuda/executable_layout.h
rename to runtime/src/iree/hal/cuda/executable_layout.h
diff --git a/iree/hal/cuda/graph_command_buffer.c b/runtime/src/iree/hal/cuda/graph_command_buffer.c
similarity index 100%
rename from iree/hal/cuda/graph_command_buffer.c
rename to runtime/src/iree/hal/cuda/graph_command_buffer.c
diff --git a/iree/hal/cuda/graph_command_buffer.h b/runtime/src/iree/hal/cuda/graph_command_buffer.h
similarity index 100%
rename from iree/hal/cuda/graph_command_buffer.h
rename to runtime/src/iree/hal/cuda/graph_command_buffer.h
diff --git a/iree/hal/cuda/native_executable.c b/runtime/src/iree/hal/cuda/native_executable.c
similarity index 100%
rename from iree/hal/cuda/native_executable.c
rename to runtime/src/iree/hal/cuda/native_executable.c
diff --git a/iree/hal/cuda/native_executable.h b/runtime/src/iree/hal/cuda/native_executable.h
similarity index 100%
rename from iree/hal/cuda/native_executable.h
rename to runtime/src/iree/hal/cuda/native_executable.h
diff --git a/iree/hal/cuda/nop_executable_cache.c b/runtime/src/iree/hal/cuda/nop_executable_cache.c
similarity index 100%
rename from iree/hal/cuda/nop_executable_cache.c
rename to runtime/src/iree/hal/cuda/nop_executable_cache.c
diff --git a/iree/hal/cuda/nop_executable_cache.h b/runtime/src/iree/hal/cuda/nop_executable_cache.h
similarity index 100%
rename from iree/hal/cuda/nop_executable_cache.h
rename to runtime/src/iree/hal/cuda/nop_executable_cache.h
diff --git a/iree/hal/cuda/registration/CMakeLists.txt b/runtime/src/iree/hal/cuda/registration/CMakeLists.txt
similarity index 100%
rename from iree/hal/cuda/registration/CMakeLists.txt
rename to runtime/src/iree/hal/cuda/registration/CMakeLists.txt
diff --git a/iree/hal/cuda/registration/driver_module.c b/runtime/src/iree/hal/cuda/registration/driver_module.c
similarity index 100%
rename from iree/hal/cuda/registration/driver_module.c
rename to runtime/src/iree/hal/cuda/registration/driver_module.c
diff --git a/iree/hal/cuda/registration/driver_module.h b/runtime/src/iree/hal/cuda/registration/driver_module.h
similarity index 100%
rename from iree/hal/cuda/registration/driver_module.h
rename to runtime/src/iree/hal/cuda/registration/driver_module.h
diff --git a/iree/hal/cuda/status_util.c b/runtime/src/iree/hal/cuda/status_util.c
similarity index 100%
rename from iree/hal/cuda/status_util.c
rename to runtime/src/iree/hal/cuda/status_util.c
diff --git a/iree/hal/cuda/status_util.h b/runtime/src/iree/hal/cuda/status_util.h
similarity index 100%
rename from iree/hal/cuda/status_util.h
rename to runtime/src/iree/hal/cuda/status_util.h
diff --git a/iree/hal/cuda/stream_command_buffer.c b/runtime/src/iree/hal/cuda/stream_command_buffer.c
similarity index 100%
rename from iree/hal/cuda/stream_command_buffer.c
rename to runtime/src/iree/hal/cuda/stream_command_buffer.c
diff --git a/iree/hal/cuda/stream_command_buffer.h b/runtime/src/iree/hal/cuda/stream_command_buffer.h
similarity index 100%
rename from iree/hal/cuda/stream_command_buffer.h
rename to runtime/src/iree/hal/cuda/stream_command_buffer.h
diff --git a/iree/hal/descriptor_set.c b/runtime/src/iree/hal/descriptor_set.c
similarity index 100%
rename from iree/hal/descriptor_set.c
rename to runtime/src/iree/hal/descriptor_set.c
diff --git a/iree/hal/descriptor_set.h b/runtime/src/iree/hal/descriptor_set.h
similarity index 100%
rename from iree/hal/descriptor_set.h
rename to runtime/src/iree/hal/descriptor_set.h
diff --git a/iree/hal/descriptor_set_layout.c b/runtime/src/iree/hal/descriptor_set_layout.c
similarity index 100%
rename from iree/hal/descriptor_set_layout.c
rename to runtime/src/iree/hal/descriptor_set_layout.c
diff --git a/iree/hal/descriptor_set_layout.h b/runtime/src/iree/hal/descriptor_set_layout.h
similarity index 100%
rename from iree/hal/descriptor_set_layout.h
rename to runtime/src/iree/hal/descriptor_set_layout.h
diff --git a/iree/hal/detail.h b/runtime/src/iree/hal/detail.h
similarity index 100%
rename from iree/hal/detail.h
rename to runtime/src/iree/hal/detail.h
diff --git a/iree/hal/device.c b/runtime/src/iree/hal/device.c
similarity index 100%
rename from iree/hal/device.c
rename to runtime/src/iree/hal/device.c
diff --git a/iree/hal/device.h b/runtime/src/iree/hal/device.h
similarity index 100%
rename from iree/hal/device.h
rename to runtime/src/iree/hal/device.h
diff --git a/iree/hal/driver.c b/runtime/src/iree/hal/driver.c
similarity index 100%
rename from iree/hal/driver.c
rename to runtime/src/iree/hal/driver.c
diff --git a/iree/hal/driver.h b/runtime/src/iree/hal/driver.h
similarity index 100%
rename from iree/hal/driver.h
rename to runtime/src/iree/hal/driver.h
diff --git a/iree/hal/driver_registry.c b/runtime/src/iree/hal/driver_registry.c
similarity index 100%
rename from iree/hal/driver_registry.c
rename to runtime/src/iree/hal/driver_registry.c
diff --git a/iree/hal/driver_registry.h b/runtime/src/iree/hal/driver_registry.h
similarity index 100%
rename from iree/hal/driver_registry.h
rename to runtime/src/iree/hal/driver_registry.h
diff --git a/iree/hal/drivers/BUILD b/runtime/src/iree/hal/drivers/BUILD
similarity index 68%
rename from iree/hal/drivers/BUILD
rename to runtime/src/iree/hal/drivers/BUILD
index f474292..cdf2b78 100644
--- a/iree/hal/drivers/BUILD
+++ b/runtime/src/iree/hal/drivers/BUILD
@@ -5,6 +5,7 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 load("@bazel_skylib//rules:common_settings.bzl", "string_list_flag")
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library")
 
 package(
     default_visibility = ["//visibility:public"],
@@ -42,35 +43,35 @@
     for driver in ALL_DRIVERS
 ]
 
-cc_library(
+iree_runtime_cc_library(
     name = "drivers",
     srcs = ["init.c"],
     hdrs = ["init.h"],
     deps = [
-               "//iree/base",
-               "//iree/base:tracing",
+               "//runtime/src/iree/base",
+               "//runtime/src/iree/base:tracing",
            ] + select({
-               ":dylib_enabled": ["//iree/hal/dylib/registration"],
+               ":dylib_enabled": ["//runtime/src/iree/hal/dylib/registration"],
                "//conditions:default": [],
            }) +
            select({
-               ":dylib-sync_enabled": ["//iree/hal/dylib/registration:sync"],
+               ":dylib-sync_enabled": ["//runtime/src/iree/hal/dylib/registration:sync"],
                "//conditions:default": [],
            }) +
            select({
-               ":vmvx_enabled": ["//iree/hal/vmvx/registration"],
+               ":vmvx_enabled": ["//runtime/src/iree/hal/vmvx/registration"],
                "//conditions:default": [],
            }) +
            select({
-               ":vmvx-sync_enabled": ["//iree/hal/vmvx/registration:sync"],
+               ":vmvx-sync_enabled": ["//runtime/src/iree/hal/vmvx/registration:sync"],
                "//conditions:default": [],
            }) +
            select({
-               ":vulkan_enabled": ["//iree/hal/vulkan/registration"],
+               ":vulkan_enabled": ["//runtime/src/iree/hal/vulkan/registration"],
                "//conditions:default": [],
            }) +
            select({
-               ":cuda_enabled": ["//iree/hal/cuda/registration"],
+               ":cuda_enabled": ["//runtime/src/iree/hal/cuda/registration"],
                "//conditions:default": [],
            }),
 )
diff --git a/iree/hal/drivers/CMakeLists.txt b/runtime/src/iree/hal/drivers/CMakeLists.txt
similarity index 100%
rename from iree/hal/drivers/CMakeLists.txt
rename to runtime/src/iree/hal/drivers/CMakeLists.txt
diff --git a/iree/hal/drivers/init.c b/runtime/src/iree/hal/drivers/init.c
similarity index 100%
rename from iree/hal/drivers/init.c
rename to runtime/src/iree/hal/drivers/init.c
diff --git a/iree/hal/drivers/init.h b/runtime/src/iree/hal/drivers/init.h
similarity index 100%
rename from iree/hal/drivers/init.h
rename to runtime/src/iree/hal/drivers/init.h
diff --git a/iree/hal/dylib/BUILD b/runtime/src/iree/hal/dylib/BUILD
similarity index 100%
rename from iree/hal/dylib/BUILD
rename to runtime/src/iree/hal/dylib/BUILD
diff --git a/iree/hal/vmvx/CMakeLists.txt b/runtime/src/iree/hal/dylib/CMakeLists.txt
similarity index 91%
copy from iree/hal/vmvx/CMakeLists.txt
copy to runtime/src/iree/hal/dylib/CMakeLists.txt
index 0866391..c6326d7 100644
--- a/iree/hal/vmvx/CMakeLists.txt
+++ b/runtime/src/iree/hal/dylib/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vmvx/BUILD                                                          #
+# runtime/src/iree/hal/dylib/BUILD                                             #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/dylib/cts/CMakeLists.txt b/runtime/src/iree/hal/dylib/cts/CMakeLists.txt
similarity index 89%
rename from iree/hal/dylib/cts/CMakeLists.txt
rename to runtime/src/iree/hal/dylib/cts/CMakeLists.txt
index 13905b9..5bc7537 100644
--- a/iree/hal/dylib/cts/CMakeLists.txt
+++ b/runtime/src/iree/hal/dylib/cts/CMakeLists.txt
@@ -16,7 +16,7 @@
   DRIVER_NAME
     dylib
   DRIVER_REGISTRATION_HDR
-    "iree/hal/dylib/registration/driver_module.h"
+    "runtime/src/iree/hal/dylib/registration/driver_module.h"
   DRIVER_REGISTRATION_FN
     "iree_hal_dylib_driver_module_register"
   COMPILER_TARGET_BACKEND
@@ -31,7 +31,7 @@
   DRIVER_NAME
     dylib-sync
   DRIVER_REGISTRATION_HDR
-    "iree/hal/dylib/registration/driver_module_sync.h"
+    "runtime/src/iree/hal/dylib/registration/driver_module_sync.h"
   DRIVER_REGISTRATION_FN
     "iree_hal_dylib_sync_driver_module_register"
   COMPILER_TARGET_BACKEND
diff --git a/runtime/src/iree/hal/dylib/registration/BUILD b/runtime/src/iree/hal/dylib/registration/BUILD
new file mode 100644
index 0000000..44bda46
--- /dev/null
+++ b/runtime/src/iree/hal/dylib/registration/BUILD
@@ -0,0 +1,71 @@
+# Copyright 2020 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_runtime_cc_library")
+
+package(
+    default_visibility = ["//visibility:public"],
+    features = ["layering_check"],
+    licenses = ["notice"],  # Apache 2.0
+)
+
+iree_cmake_extra_content(
+    content = """
+if(${IREE_HAL_DRIVER_DYLIB})
+""",
+    inline = True,
+)
+
+iree_runtime_cc_library(
+    name = "registration",
+    srcs = ["driver_module.c"],
+    hdrs = ["driver_module.h"],
+    defines = [
+        "IREE_HAL_HAVE_DYLIB_DRIVER_MODULE=1",
+    ],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:task_driver",
+        "//runtime/src/iree/hal/local/loaders:embedded_library_loader",
+        "//runtime/src/iree/hal/local/loaders:system_library_loader",
+        "//runtime/src/iree/task:api",
+    ],
+)
+
+iree_cmake_extra_content(
+    content = """
+endif()
+
+if(${IREE_HAL_DRIVER_DYLIB_SYNC})
+""",
+    inline = True,
+)
+
+iree_runtime_cc_library(
+    name = "sync",
+    srcs = ["driver_module_sync.c"],
+    hdrs = ["driver_module_sync.h"],
+    defines = [
+        "IREE_HAL_HAVE_DYLIB_SYNC_DRIVER_MODULE=1",
+    ],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:sync_driver",
+        "//runtime/src/iree/hal/local/loaders:embedded_library_loader",
+    ],
+)
+
+iree_cmake_extra_content(
+    content = """
+endif()
+""",
+    inline = True,
+)
diff --git a/iree/hal/dylib/registration/CMakeLists.txt b/runtime/src/iree/hal/dylib/registration/CMakeLists.txt
similarity index 95%
rename from iree/hal/dylib/registration/CMakeLists.txt
rename to runtime/src/iree/hal/dylib/registration/CMakeLists.txt
index 761607f..edee5dc 100644
--- a/iree/hal/dylib/registration/CMakeLists.txt
+++ b/runtime/src/iree/hal/dylib/registration/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/dylib/registration/BUILD                                            #
+# runtime/src/iree/hal/dylib/registration/BUILD                                #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/dylib/registration/driver_module.c b/runtime/src/iree/hal/dylib/registration/driver_module.c
similarity index 100%
rename from iree/hal/dylib/registration/driver_module.c
rename to runtime/src/iree/hal/dylib/registration/driver_module.c
diff --git a/iree/hal/dylib/registration/driver_module.h b/runtime/src/iree/hal/dylib/registration/driver_module.h
similarity index 100%
rename from iree/hal/dylib/registration/driver_module.h
rename to runtime/src/iree/hal/dylib/registration/driver_module.h
diff --git a/iree/hal/dylib/registration/driver_module_sync.c b/runtime/src/iree/hal/dylib/registration/driver_module_sync.c
similarity index 100%
rename from iree/hal/dylib/registration/driver_module_sync.c
rename to runtime/src/iree/hal/dylib/registration/driver_module_sync.c
diff --git a/iree/hal/dylib/registration/driver_module_sync.h b/runtime/src/iree/hal/dylib/registration/driver_module_sync.h
similarity index 100%
rename from iree/hal/dylib/registration/driver_module_sync.h
rename to runtime/src/iree/hal/dylib/registration/driver_module_sync.h
diff --git a/iree/hal/event.c b/runtime/src/iree/hal/event.c
similarity index 100%
rename from iree/hal/event.c
rename to runtime/src/iree/hal/event.c
diff --git a/iree/hal/event.h b/runtime/src/iree/hal/event.h
similarity index 100%
rename from iree/hal/event.h
rename to runtime/src/iree/hal/event.h
diff --git a/iree/hal/executable.c b/runtime/src/iree/hal/executable.c
similarity index 100%
rename from iree/hal/executable.c
rename to runtime/src/iree/hal/executable.c
diff --git a/iree/hal/executable.h b/runtime/src/iree/hal/executable.h
similarity index 100%
rename from iree/hal/executable.h
rename to runtime/src/iree/hal/executable.h
diff --git a/iree/hal/executable_cache.c b/runtime/src/iree/hal/executable_cache.c
similarity index 100%
rename from iree/hal/executable_cache.c
rename to runtime/src/iree/hal/executable_cache.c
diff --git a/iree/hal/executable_cache.h b/runtime/src/iree/hal/executable_cache.h
similarity index 100%
rename from iree/hal/executable_cache.h
rename to runtime/src/iree/hal/executable_cache.h
diff --git a/iree/hal/executable_layout.c b/runtime/src/iree/hal/executable_layout.c
similarity index 100%
rename from iree/hal/executable_layout.c
rename to runtime/src/iree/hal/executable_layout.c
diff --git a/iree/hal/executable_layout.h b/runtime/src/iree/hal/executable_layout.h
similarity index 100%
rename from iree/hal/executable_layout.h
rename to runtime/src/iree/hal/executable_layout.h
diff --git a/iree/hal/local/BUILD b/runtime/src/iree/hal/local/BUILD
similarity index 62%
rename from iree/hal/local/BUILD
rename to runtime/src/iree/hal/local/BUILD
index f3dd9de..c2927ef 100644
--- a/iree/hal/local/BUILD
+++ b/runtime/src/iree/hal/local/BUILD
@@ -7,7 +7,7 @@
 # Default implementations for HAL types that use the host resources.
 # These are generally just wrappers around host heap memory and host threads.
 
-load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content")
+load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_runtime_cc_library", "iree_runtime_cc_test")
 load("//build_tools/bazel:cc_binary_benchmark.bzl", "cc_binary_benchmark")
 
 package(
@@ -16,20 +16,20 @@
     licenses = ["notice"],  # Apache 2.0
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "executable_environment",
     srcs = ["executable_environment.c"],
     hdrs = ["executable_environment.h"],
     deps = [
         ":executable_library",
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/base/internal:cpu",
-        "//iree/hal",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:cpu",
+        "//runtime/src/iree/hal",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "executable_library",
     hdrs = ["executable_library.h"],
 )
@@ -41,17 +41,17 @@
         ":executable_environment",
         ":executable_library",
         ":local",
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/base/internal:file_io",
-        "//iree/base/internal:flags",
-        "//iree/hal",
-        "//iree/hal/local/loaders:embedded_library_loader",
-        "//iree/testing:benchmark",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:file_io",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local/loaders:embedded_library_loader",
+        "//runtime/src/iree/testing:benchmark",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "executable_library_test",
     srcs = [
         "executable_library_demo.c",
@@ -61,12 +61,12 @@
     deps = [
         ":executable_environment",
         ":executable_library",
-        "//iree/base",
-        "//iree/base:core_headers",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "local",
     srcs = [
         "executable_loader.c",
@@ -89,16 +89,16 @@
     deps = [
         ":executable_environment",
         ":executable_library",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal",
-        "//iree/base/internal:fpu_state",
-        "//iree/hal",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal:fpu_state",
+        "//runtime/src/iree/hal",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "sync_driver",
     srcs = [
         "sync_device.c",
@@ -114,14 +114,14 @@
     ],
     deps = [
         ":local",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal",
-        "//iree/base/internal:arena",
-        "//iree/base/internal:synchronization",
-        "//iree/hal",
-        "//iree/hal/utils:buffer_transfer",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal:arena",
+        "//runtime/src/iree/base/internal:synchronization",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/utils:buffer_transfer",
     ],
 )
 
@@ -141,7 +141,7 @@
     inline = True,
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "task_driver",
     srcs = [
         "task_command_buffer.c",
@@ -165,17 +165,17 @@
         ":executable_environment",
         ":executable_library",
         ":local",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal",
-        "//iree/base/internal:arena",
-        "//iree/base/internal:event_pool",
-        "//iree/base/internal:synchronization",
-        "//iree/base/internal:wait_handle",
-        "//iree/hal",
-        "//iree/hal/utils:buffer_transfer",
-        "//iree/hal/utils:resource_set",
-        "//iree/task",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal:arena",
+        "//runtime/src/iree/base/internal:event_pool",
+        "//runtime/src/iree/base/internal:synchronization",
+        "//runtime/src/iree/base/internal:wait_handle",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/utils:buffer_transfer",
+        "//runtime/src/iree/hal/utils:resource_set",
+        "//runtime/src/iree/task",
     ],
 )
diff --git a/iree/hal/local/CMakeLists.txt b/runtime/src/iree/hal/local/CMakeLists.txt
similarity index 97%
rename from iree/hal/local/CMakeLists.txt
rename to runtime/src/iree/hal/local/CMakeLists.txt
index b403d01..693f722 100644
--- a/iree/hal/local/CMakeLists.txt
+++ b/runtime/src/iree/hal/local/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/local/BUILD                                                         #
+# runtime/src/iree/hal/local/BUILD                                             #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
@@ -31,6 +31,8 @@
     executable_library
   HDRS
     "executable_library.h"
+  DEPS
+
   PUBLIC
 )
 
diff --git a/iree/hal/local/elf/BUILD b/runtime/src/iree/hal/local/elf/BUILD
similarity index 68%
rename from iree/hal/local/elf/BUILD
rename to runtime/src/iree/hal/local/elf/BUILD
index a55763b..f5400f9 100644
--- a/iree/hal/local/elf/BUILD
+++ b/runtime/src/iree/hal/local/elf/BUILD
@@ -5,6 +5,7 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
 load("//build_tools/bazel:native_binary.bzl", "native_test")
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library")
 
 package(
     default_visibility = ["//visibility:public"],
@@ -16,7 +17,7 @@
 # Runtime ELF module loader/linker
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "elf_module",
     srcs = [
         "elf_module.c",
@@ -28,9 +29,9 @@
     deps = [
         ":arch",
         ":platform",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
@@ -39,11 +40,11 @@
     srcs = ["elf_module_test_main.c"],
     deps = [
         ":elf_module",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/hal/local:executable_environment",
-        "//iree/hal/local:executable_library",
-        "//iree/hal/local/elf/testdata:elementwise_mul",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/hal/local:executable_environment",
+        "//runtime/src/iree/hal/local:executable_library",
+        "//runtime/src/iree/hal/local/elf/testdata:elementwise_mul",
     ],
 )
 
@@ -56,7 +57,7 @@
 # Architecture and platform support
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "arch",
     srcs = [
         "arch/arm_32.c",
@@ -70,13 +71,13 @@
         "arch.h",
     ],
     deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "platform",
     srcs = [
         "platform/apple.c",
@@ -88,8 +89,8 @@
         "platform.h",
     ],
     deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
     ],
 )
diff --git a/iree/hal/local/elf/CMakeLists.txt b/runtime/src/iree/hal/local/elf/CMakeLists.txt
similarity index 97%
rename from iree/hal/local/elf/CMakeLists.txt
rename to runtime/src/iree/hal/local/elf/CMakeLists.txt
index 1350aa3..67e67b2 100644
--- a/iree/hal/local/elf/CMakeLists.txt
+++ b/runtime/src/iree/hal/local/elf/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/local/elf/BUILD                                                     #
+# runtime/src/iree/hal/local/elf/BUILD                                         #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/local/elf/arch.h b/runtime/src/iree/hal/local/elf/arch.h
similarity index 100%
rename from iree/hal/local/elf/arch.h
rename to runtime/src/iree/hal/local/elf/arch.h
diff --git a/iree/hal/local/elf/arch/arm_32.c b/runtime/src/iree/hal/local/elf/arch/arm_32.c
similarity index 100%
rename from iree/hal/local/elf/arch/arm_32.c
rename to runtime/src/iree/hal/local/elf/arch/arm_32.c
diff --git a/iree/hal/local/elf/arch/arm_64.c b/runtime/src/iree/hal/local/elf/arch/arm_64.c
similarity index 100%
rename from iree/hal/local/elf/arch/arm_64.c
rename to runtime/src/iree/hal/local/elf/arch/arm_64.c
diff --git a/iree/hal/local/elf/arch/riscv.c b/runtime/src/iree/hal/local/elf/arch/riscv.c
similarity index 100%
rename from iree/hal/local/elf/arch/riscv.c
rename to runtime/src/iree/hal/local/elf/arch/riscv.c
diff --git a/iree/hal/local/elf/arch/x86_32.c b/runtime/src/iree/hal/local/elf/arch/x86_32.c
similarity index 100%
rename from iree/hal/local/elf/arch/x86_32.c
rename to runtime/src/iree/hal/local/elf/arch/x86_32.c
diff --git a/iree/hal/local/elf/arch/x86_64.c b/runtime/src/iree/hal/local/elf/arch/x86_64.c
similarity index 100%
rename from iree/hal/local/elf/arch/x86_64.c
rename to runtime/src/iree/hal/local/elf/arch/x86_64.c
diff --git a/iree/hal/local/elf/arch/x86_64_msvc.asm b/runtime/src/iree/hal/local/elf/arch/x86_64_msvc.asm
similarity index 100%
rename from iree/hal/local/elf/arch/x86_64_msvc.asm
rename to runtime/src/iree/hal/local/elf/arch/x86_64_msvc.asm
diff --git a/iree/hal/local/elf/elf_module.c b/runtime/src/iree/hal/local/elf/elf_module.c
similarity index 100%
rename from iree/hal/local/elf/elf_module.c
rename to runtime/src/iree/hal/local/elf/elf_module.c
diff --git a/iree/hal/local/elf/elf_module.h b/runtime/src/iree/hal/local/elf/elf_module.h
similarity index 100%
rename from iree/hal/local/elf/elf_module.h
rename to runtime/src/iree/hal/local/elf/elf_module.h
diff --git a/iree/hal/local/elf/elf_module_test_main.c b/runtime/src/iree/hal/local/elf/elf_module_test_main.c
similarity index 100%
rename from iree/hal/local/elf/elf_module_test_main.c
rename to runtime/src/iree/hal/local/elf/elf_module_test_main.c
diff --git a/iree/hal/local/elf/elf_types.h b/runtime/src/iree/hal/local/elf/elf_types.h
similarity index 100%
rename from iree/hal/local/elf/elf_types.h
rename to runtime/src/iree/hal/local/elf/elf_types.h
diff --git a/iree/hal/local/elf/platform.h b/runtime/src/iree/hal/local/elf/platform.h
similarity index 100%
rename from iree/hal/local/elf/platform.h
rename to runtime/src/iree/hal/local/elf/platform.h
diff --git a/iree/hal/local/elf/platform/apple.c b/runtime/src/iree/hal/local/elf/platform/apple.c
similarity index 100%
rename from iree/hal/local/elf/platform/apple.c
rename to runtime/src/iree/hal/local/elf/platform/apple.c
diff --git a/iree/hal/local/elf/platform/generic.c b/runtime/src/iree/hal/local/elf/platform/generic.c
similarity index 100%
rename from iree/hal/local/elf/platform/generic.c
rename to runtime/src/iree/hal/local/elf/platform/generic.c
diff --git a/iree/hal/local/elf/platform/linux.c b/runtime/src/iree/hal/local/elf/platform/linux.c
similarity index 100%
rename from iree/hal/local/elf/platform/linux.c
rename to runtime/src/iree/hal/local/elf/platform/linux.c
diff --git a/iree/hal/local/elf/platform/windows.c b/runtime/src/iree/hal/local/elf/platform/windows.c
similarity index 100%
rename from iree/hal/local/elf/platform/windows.c
rename to runtime/src/iree/hal/local/elf/platform/windows.c
diff --git a/iree/hal/local/elf/testdata/BUILD b/runtime/src/iree/hal/local/elf/testdata/BUILD
similarity index 100%
rename from iree/hal/local/elf/testdata/BUILD
rename to runtime/src/iree/hal/local/elf/testdata/BUILD
diff --git a/iree/hal/local/elf/testdata/CMakeLists.txt b/runtime/src/iree/hal/local/elf/testdata/CMakeLists.txt
similarity index 94%
rename from iree/hal/local/elf/testdata/CMakeLists.txt
rename to runtime/src/iree/hal/local/elf/testdata/CMakeLists.txt
index d3b461a..4e53175 100644
--- a/iree/hal/local/elf/testdata/CMakeLists.txt
+++ b/runtime/src/iree/hal/local/elf/testdata/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/local/elf/testdata/BUILD                                            #
+# runtime/src/iree/hal/local/elf/testdata/BUILD                                #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/local/elf/testdata/elementwise_mul.mlir b/runtime/src/iree/hal/local/elf/testdata/elementwise_mul.mlir
similarity index 100%
rename from iree/hal/local/elf/testdata/elementwise_mul.mlir
rename to runtime/src/iree/hal/local/elf/testdata/elementwise_mul.mlir
diff --git a/iree/hal/local/elf/testdata/elementwise_mul_arm_32.so b/runtime/src/iree/hal/local/elf/testdata/elementwise_mul_arm_32.so
similarity index 100%
rename from iree/hal/local/elf/testdata/elementwise_mul_arm_32.so
rename to runtime/src/iree/hal/local/elf/testdata/elementwise_mul_arm_32.so
Binary files differ
diff --git a/iree/hal/local/elf/testdata/elementwise_mul_arm_64.so b/runtime/src/iree/hal/local/elf/testdata/elementwise_mul_arm_64.so
similarity index 100%
rename from iree/hal/local/elf/testdata/elementwise_mul_arm_64.so
rename to runtime/src/iree/hal/local/elf/testdata/elementwise_mul_arm_64.so
Binary files differ
diff --git a/iree/hal/local/elf/testdata/elementwise_mul_benchmark.txt b/runtime/src/iree/hal/local/elf/testdata/elementwise_mul_benchmark.txt
similarity index 100%
rename from iree/hal/local/elf/testdata/elementwise_mul_benchmark.txt
rename to runtime/src/iree/hal/local/elf/testdata/elementwise_mul_benchmark.txt
diff --git a/iree/hal/local/elf/testdata/elementwise_mul_riscv_32.so b/runtime/src/iree/hal/local/elf/testdata/elementwise_mul_riscv_32.so
similarity index 100%
rename from iree/hal/local/elf/testdata/elementwise_mul_riscv_32.so
rename to runtime/src/iree/hal/local/elf/testdata/elementwise_mul_riscv_32.so
Binary files differ
diff --git a/iree/hal/local/elf/testdata/elementwise_mul_riscv_64.so b/runtime/src/iree/hal/local/elf/testdata/elementwise_mul_riscv_64.so
similarity index 100%
rename from iree/hal/local/elf/testdata/elementwise_mul_riscv_64.so
rename to runtime/src/iree/hal/local/elf/testdata/elementwise_mul_riscv_64.so
Binary files differ
diff --git a/iree/hal/local/elf/testdata/elementwise_mul_x86_32.so b/runtime/src/iree/hal/local/elf/testdata/elementwise_mul_x86_32.so
similarity index 100%
rename from iree/hal/local/elf/testdata/elementwise_mul_x86_32.so
rename to runtime/src/iree/hal/local/elf/testdata/elementwise_mul_x86_32.so
Binary files differ
diff --git a/iree/hal/local/elf/testdata/elementwise_mul_x86_64.so b/runtime/src/iree/hal/local/elf/testdata/elementwise_mul_x86_64.so
similarity index 100%
rename from iree/hal/local/elf/testdata/elementwise_mul_x86_64.so
rename to runtime/src/iree/hal/local/elf/testdata/elementwise_mul_x86_64.so
Binary files differ
diff --git a/iree/hal/local/elf/testdata/generate.sh b/runtime/src/iree/hal/local/elf/testdata/generate.sh
similarity index 100%
rename from iree/hal/local/elf/testdata/generate.sh
rename to runtime/src/iree/hal/local/elf/testdata/generate.sh
diff --git a/iree/hal/local/executable_environment.c b/runtime/src/iree/hal/local/executable_environment.c
similarity index 100%
rename from iree/hal/local/executable_environment.c
rename to runtime/src/iree/hal/local/executable_environment.c
diff --git a/iree/hal/local/executable_environment.h b/runtime/src/iree/hal/local/executable_environment.h
similarity index 100%
rename from iree/hal/local/executable_environment.h
rename to runtime/src/iree/hal/local/executable_environment.h
diff --git a/iree/hal/local/executable_library.h b/runtime/src/iree/hal/local/executable_library.h
similarity index 100%
rename from iree/hal/local/executable_library.h
rename to runtime/src/iree/hal/local/executable_library.h
diff --git a/iree/hal/local/executable_library_benchmark.c b/runtime/src/iree/hal/local/executable_library_benchmark.c
similarity index 100%
rename from iree/hal/local/executable_library_benchmark.c
rename to runtime/src/iree/hal/local/executable_library_benchmark.c
diff --git a/iree/hal/local/executable_library_benchmark.md b/runtime/src/iree/hal/local/executable_library_benchmark.md
similarity index 100%
rename from iree/hal/local/executable_library_benchmark.md
rename to runtime/src/iree/hal/local/executable_library_benchmark.md
diff --git a/iree/hal/local/executable_library_demo.c b/runtime/src/iree/hal/local/executable_library_demo.c
similarity index 100%
rename from iree/hal/local/executable_library_demo.c
rename to runtime/src/iree/hal/local/executable_library_demo.c
diff --git a/iree/hal/local/executable_library_demo.h b/runtime/src/iree/hal/local/executable_library_demo.h
similarity index 100%
rename from iree/hal/local/executable_library_demo.h
rename to runtime/src/iree/hal/local/executable_library_demo.h
diff --git a/iree/hal/local/executable_library_test.c b/runtime/src/iree/hal/local/executable_library_test.c
similarity index 100%
rename from iree/hal/local/executable_library_test.c
rename to runtime/src/iree/hal/local/executable_library_test.c
diff --git a/iree/hal/local/executable_loader.c b/runtime/src/iree/hal/local/executable_loader.c
similarity index 100%
rename from iree/hal/local/executable_loader.c
rename to runtime/src/iree/hal/local/executable_loader.c
diff --git a/iree/hal/local/executable_loader.h b/runtime/src/iree/hal/local/executable_loader.h
similarity index 100%
rename from iree/hal/local/executable_loader.h
rename to runtime/src/iree/hal/local/executable_loader.h
diff --git a/iree/hal/local/inline_command_buffer.c b/runtime/src/iree/hal/local/inline_command_buffer.c
similarity index 100%
rename from iree/hal/local/inline_command_buffer.c
rename to runtime/src/iree/hal/local/inline_command_buffer.c
diff --git a/iree/hal/local/inline_command_buffer.h b/runtime/src/iree/hal/local/inline_command_buffer.h
similarity index 100%
rename from iree/hal/local/inline_command_buffer.h
rename to runtime/src/iree/hal/local/inline_command_buffer.h
diff --git a/runtime/src/iree/hal/local/loaders/BUILD b/runtime/src/iree/hal/local/loaders/BUILD
new file mode 100644
index 0000000..ac48f01
--- /dev/null
+++ b/runtime/src/iree/hal/local/loaders/BUILD
@@ -0,0 +1,102 @@
+# Copyright 2020 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+# Default implementations for HAL types that use the host resources.
+# These are generally just wrappers around host heap memory and host threads.
+
+load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_runtime_cc_library")
+
+package(
+    default_visibility = ["//visibility:public"],
+    features = ["layering_check"],
+    licenses = ["notice"],  # Apache 2.0
+)
+
+iree_runtime_cc_library(
+    name = "embedded_library_loader",
+    srcs = ["embedded_library_loader.c"],
+    hdrs = ["embedded_library_loader.h"],
+    defines = [
+        "IREE_HAL_HAVE_EMBEDDED_LIBRARY_LOADER=1",
+    ],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:executable_library",
+        "//runtime/src/iree/hal/local/elf:elf_module",
+    ],
+)
+
+iree_runtime_cc_library(
+    name = "static_library_loader",
+    srcs = ["static_library_loader.c"],
+    hdrs = ["static_library_loader.h"],
+    defines = [
+        "IREE_HAL_HAVE_STATIC_LIBRARY_LOADER=1",
+    ],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:executable_environment",
+        "//runtime/src/iree/hal/local:executable_library",
+    ],
+)
+
+iree_runtime_cc_library(
+    name = "system_library_loader",
+    srcs = ["system_library_loader.c"],
+    hdrs = ["system_library_loader.h"],
+    defines = [
+        "IREE_HAL_HAVE_SYSTEM_LIBRARY_LOADER=1",
+    ],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:dynamic_library",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:executable_library",
+    ],
+)
+
+iree_cmake_extra_content(
+    content = """
+if(${IREE_HAL_DRIVER_VMVX} OR ${IREE_HAL_DRIVER_VMVX_SYNC})
+""",
+    inline = True,
+)
+
+iree_runtime_cc_library(
+    name = "vmvx_module_loader",
+    srcs = ["vmvx_module_loader.c"],
+    hdrs = ["vmvx_module_loader.h"],
+    defines = [
+        "IREE_HAL_HAVE_VMVX_MODULE_LOADER=1",
+    ],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:executable_library",
+        "//runtime/src/iree/modules/vmvx",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
+    ],
+)
+
+iree_cmake_extra_content(
+    content = """
+endif()
+""",
+    inline = True,
+)
diff --git a/iree/hal/local/loaders/CMakeLists.txt b/runtime/src/iree/hal/local/loaders/CMakeLists.txt
similarity index 96%
rename from iree/hal/local/loaders/CMakeLists.txt
rename to runtime/src/iree/hal/local/loaders/CMakeLists.txt
index a2a1c3d..71c8b03 100644
--- a/iree/hal/local/loaders/CMakeLists.txt
+++ b/runtime/src/iree/hal/local/loaders/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/local/loaders/BUILD                                                 #
+# runtime/src/iree/hal/local/loaders/BUILD                                     #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/local/loaders/embedded_library_loader.c b/runtime/src/iree/hal/local/loaders/embedded_library_loader.c
similarity index 100%
rename from iree/hal/local/loaders/embedded_library_loader.c
rename to runtime/src/iree/hal/local/loaders/embedded_library_loader.c
diff --git a/iree/hal/local/loaders/embedded_library_loader.h b/runtime/src/iree/hal/local/loaders/embedded_library_loader.h
similarity index 100%
rename from iree/hal/local/loaders/embedded_library_loader.h
rename to runtime/src/iree/hal/local/loaders/embedded_library_loader.h
diff --git a/iree/hal/local/loaders/static_library_loader.c b/runtime/src/iree/hal/local/loaders/static_library_loader.c
similarity index 100%
rename from iree/hal/local/loaders/static_library_loader.c
rename to runtime/src/iree/hal/local/loaders/static_library_loader.c
diff --git a/iree/hal/local/loaders/static_library_loader.h b/runtime/src/iree/hal/local/loaders/static_library_loader.h
similarity index 100%
rename from iree/hal/local/loaders/static_library_loader.h
rename to runtime/src/iree/hal/local/loaders/static_library_loader.h
diff --git a/iree/hal/local/loaders/system_library_loader.c b/runtime/src/iree/hal/local/loaders/system_library_loader.c
similarity index 100%
rename from iree/hal/local/loaders/system_library_loader.c
rename to runtime/src/iree/hal/local/loaders/system_library_loader.c
diff --git a/iree/hal/local/loaders/system_library_loader.h b/runtime/src/iree/hal/local/loaders/system_library_loader.h
similarity index 100%
rename from iree/hal/local/loaders/system_library_loader.h
rename to runtime/src/iree/hal/local/loaders/system_library_loader.h
diff --git a/iree/hal/local/loaders/vmvx_module_loader.c b/runtime/src/iree/hal/local/loaders/vmvx_module_loader.c
similarity index 100%
rename from iree/hal/local/loaders/vmvx_module_loader.c
rename to runtime/src/iree/hal/local/loaders/vmvx_module_loader.c
diff --git a/iree/hal/local/loaders/vmvx_module_loader.h b/runtime/src/iree/hal/local/loaders/vmvx_module_loader.h
similarity index 100%
rename from iree/hal/local/loaders/vmvx_module_loader.h
rename to runtime/src/iree/hal/local/loaders/vmvx_module_loader.h
diff --git a/iree/hal/local/local_descriptor_set.c b/runtime/src/iree/hal/local/local_descriptor_set.c
similarity index 100%
rename from iree/hal/local/local_descriptor_set.c
rename to runtime/src/iree/hal/local/local_descriptor_set.c
diff --git a/iree/hal/local/local_descriptor_set.h b/runtime/src/iree/hal/local/local_descriptor_set.h
similarity index 100%
rename from iree/hal/local/local_descriptor_set.h
rename to runtime/src/iree/hal/local/local_descriptor_set.h
diff --git a/iree/hal/local/local_descriptor_set_layout.c b/runtime/src/iree/hal/local/local_descriptor_set_layout.c
similarity index 100%
rename from iree/hal/local/local_descriptor_set_layout.c
rename to runtime/src/iree/hal/local/local_descriptor_set_layout.c
diff --git a/iree/hal/local/local_descriptor_set_layout.h b/runtime/src/iree/hal/local/local_descriptor_set_layout.h
similarity index 100%
rename from iree/hal/local/local_descriptor_set_layout.h
rename to runtime/src/iree/hal/local/local_descriptor_set_layout.h
diff --git a/iree/hal/local/local_executable.c b/runtime/src/iree/hal/local/local_executable.c
similarity index 100%
rename from iree/hal/local/local_executable.c
rename to runtime/src/iree/hal/local/local_executable.c
diff --git a/iree/hal/local/local_executable.h b/runtime/src/iree/hal/local/local_executable.h
similarity index 100%
rename from iree/hal/local/local_executable.h
rename to runtime/src/iree/hal/local/local_executable.h
diff --git a/iree/hal/local/local_executable_cache.c b/runtime/src/iree/hal/local/local_executable_cache.c
similarity index 100%
rename from iree/hal/local/local_executable_cache.c
rename to runtime/src/iree/hal/local/local_executable_cache.c
diff --git a/iree/hal/local/local_executable_cache.h b/runtime/src/iree/hal/local/local_executable_cache.h
similarity index 100%
rename from iree/hal/local/local_executable_cache.h
rename to runtime/src/iree/hal/local/local_executable_cache.h
diff --git a/iree/hal/local/local_executable_layout.c b/runtime/src/iree/hal/local/local_executable_layout.c
similarity index 100%
rename from iree/hal/local/local_executable_layout.c
rename to runtime/src/iree/hal/local/local_executable_layout.c
diff --git a/iree/hal/local/local_executable_layout.h b/runtime/src/iree/hal/local/local_executable_layout.h
similarity index 100%
rename from iree/hal/local/local_executable_layout.h
rename to runtime/src/iree/hal/local/local_executable_layout.h
diff --git a/iree/hal/local/sync_device.c b/runtime/src/iree/hal/local/sync_device.c
similarity index 100%
rename from iree/hal/local/sync_device.c
rename to runtime/src/iree/hal/local/sync_device.c
diff --git a/iree/hal/local/sync_device.h b/runtime/src/iree/hal/local/sync_device.h
similarity index 100%
rename from iree/hal/local/sync_device.h
rename to runtime/src/iree/hal/local/sync_device.h
diff --git a/iree/hal/local/sync_driver.c b/runtime/src/iree/hal/local/sync_driver.c
similarity index 100%
rename from iree/hal/local/sync_driver.c
rename to runtime/src/iree/hal/local/sync_driver.c
diff --git a/iree/hal/local/sync_driver.h b/runtime/src/iree/hal/local/sync_driver.h
similarity index 100%
rename from iree/hal/local/sync_driver.h
rename to runtime/src/iree/hal/local/sync_driver.h
diff --git a/iree/hal/local/sync_event.c b/runtime/src/iree/hal/local/sync_event.c
similarity index 100%
rename from iree/hal/local/sync_event.c
rename to runtime/src/iree/hal/local/sync_event.c
diff --git a/iree/hal/local/sync_event.h b/runtime/src/iree/hal/local/sync_event.h
similarity index 100%
rename from iree/hal/local/sync_event.h
rename to runtime/src/iree/hal/local/sync_event.h
diff --git a/iree/hal/local/sync_semaphore.c b/runtime/src/iree/hal/local/sync_semaphore.c
similarity index 100%
rename from iree/hal/local/sync_semaphore.c
rename to runtime/src/iree/hal/local/sync_semaphore.c
diff --git a/iree/hal/local/sync_semaphore.h b/runtime/src/iree/hal/local/sync_semaphore.h
similarity index 100%
rename from iree/hal/local/sync_semaphore.h
rename to runtime/src/iree/hal/local/sync_semaphore.h
diff --git a/iree/hal/local/task_command_buffer.c b/runtime/src/iree/hal/local/task_command_buffer.c
similarity index 100%
rename from iree/hal/local/task_command_buffer.c
rename to runtime/src/iree/hal/local/task_command_buffer.c
diff --git a/iree/hal/local/task_command_buffer.h b/runtime/src/iree/hal/local/task_command_buffer.h
similarity index 100%
rename from iree/hal/local/task_command_buffer.h
rename to runtime/src/iree/hal/local/task_command_buffer.h
diff --git a/iree/hal/local/task_device.c b/runtime/src/iree/hal/local/task_device.c
similarity index 100%
rename from iree/hal/local/task_device.c
rename to runtime/src/iree/hal/local/task_device.c
diff --git a/iree/hal/local/task_device.h b/runtime/src/iree/hal/local/task_device.h
similarity index 100%
rename from iree/hal/local/task_device.h
rename to runtime/src/iree/hal/local/task_device.h
diff --git a/iree/hal/local/task_driver.c b/runtime/src/iree/hal/local/task_driver.c
similarity index 100%
rename from iree/hal/local/task_driver.c
rename to runtime/src/iree/hal/local/task_driver.c
diff --git a/iree/hal/local/task_driver.h b/runtime/src/iree/hal/local/task_driver.h
similarity index 100%
rename from iree/hal/local/task_driver.h
rename to runtime/src/iree/hal/local/task_driver.h
diff --git a/iree/hal/local/task_event.c b/runtime/src/iree/hal/local/task_event.c
similarity index 100%
rename from iree/hal/local/task_event.c
rename to runtime/src/iree/hal/local/task_event.c
diff --git a/iree/hal/local/task_event.h b/runtime/src/iree/hal/local/task_event.h
similarity index 100%
rename from iree/hal/local/task_event.h
rename to runtime/src/iree/hal/local/task_event.h
diff --git a/iree/hal/local/task_queue.c b/runtime/src/iree/hal/local/task_queue.c
similarity index 100%
rename from iree/hal/local/task_queue.c
rename to runtime/src/iree/hal/local/task_queue.c
diff --git a/iree/hal/local/task_queue.h b/runtime/src/iree/hal/local/task_queue.h
similarity index 100%
rename from iree/hal/local/task_queue.h
rename to runtime/src/iree/hal/local/task_queue.h
diff --git a/iree/hal/local/task_queue_state.c b/runtime/src/iree/hal/local/task_queue_state.c
similarity index 100%
rename from iree/hal/local/task_queue_state.c
rename to runtime/src/iree/hal/local/task_queue_state.c
diff --git a/iree/hal/local/task_queue_state.h b/runtime/src/iree/hal/local/task_queue_state.h
similarity index 100%
rename from iree/hal/local/task_queue_state.h
rename to runtime/src/iree/hal/local/task_queue_state.h
diff --git a/iree/hal/local/task_semaphore.c b/runtime/src/iree/hal/local/task_semaphore.c
similarity index 100%
rename from iree/hal/local/task_semaphore.c
rename to runtime/src/iree/hal/local/task_semaphore.c
diff --git a/iree/hal/local/task_semaphore.h b/runtime/src/iree/hal/local/task_semaphore.h
similarity index 100%
rename from iree/hal/local/task_semaphore.h
rename to runtime/src/iree/hal/local/task_semaphore.h
diff --git a/iree/hal/resource.h b/runtime/src/iree/hal/resource.h
similarity index 100%
rename from iree/hal/resource.h
rename to runtime/src/iree/hal/resource.h
diff --git a/iree/hal/semaphore.c b/runtime/src/iree/hal/semaphore.c
similarity index 100%
rename from iree/hal/semaphore.c
rename to runtime/src/iree/hal/semaphore.c
diff --git a/iree/hal/semaphore.h b/runtime/src/iree/hal/semaphore.h
similarity index 100%
rename from iree/hal/semaphore.h
rename to runtime/src/iree/hal/semaphore.h
diff --git a/iree/hal/string_util.c b/runtime/src/iree/hal/string_util.c
similarity index 100%
rename from iree/hal/string_util.c
rename to runtime/src/iree/hal/string_util.c
diff --git a/iree/hal/string_util.h b/runtime/src/iree/hal/string_util.h
similarity index 100%
rename from iree/hal/string_util.h
rename to runtime/src/iree/hal/string_util.h
diff --git a/iree/hal/string_util_test.cc b/runtime/src/iree/hal/string_util_test.cc
similarity index 100%
rename from iree/hal/string_util_test.cc
rename to runtime/src/iree/hal/string_util_test.cc
diff --git a/runtime/src/iree/hal/utils/BUILD b/runtime/src/iree/hal/utils/BUILD
new file mode 100644
index 0000000..e01552a
--- /dev/null
+++ b/runtime/src/iree/hal/utils/BUILD
@@ -0,0 +1,77 @@
+# Copyright 2021 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+load("//build_tools/bazel:cc_binary_benchmark.bzl", "cc_binary_benchmark")
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library", "iree_runtime_cc_test")
+
+package(
+    default_visibility = ["//visibility:public"],
+    features = ["layering_check"],
+    licenses = ["notice"],  # Apache 2.0
+)
+
+iree_runtime_cc_library(
+    name = "buffer_transfer",
+    srcs = ["buffer_transfer.c"],
+    hdrs = ["buffer_transfer.h"],
+    visibility = ["//visibility:public"],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/hal",
+    ],
+)
+
+iree_runtime_cc_library(
+    name = "deferred_command_buffer",
+    srcs = ["deferred_command_buffer.c"],
+    hdrs = ["deferred_command_buffer.h"],
+    visibility = ["//visibility:public"],
+    deps = [
+        ":resource_set",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:arena",
+        "//runtime/src/iree/hal",
+    ],
+)
+
+iree_runtime_cc_library(
+    name = "resource_set",
+    srcs = ["resource_set.c"],
+    hdrs = ["resource_set.h"],
+    visibility = ["//visibility:public"],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:arena",
+        "//runtime/src/iree/hal",
+    ],
+)
+
+cc_binary_benchmark(
+    name = "resource_set_benchmark",
+    srcs = ["resource_set_benchmark.c"],
+    deps = [
+        ":resource_set",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base/internal:prng",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/testing:benchmark",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "resource_set_test",
+    srcs = ["resource_set_test.cc"],
+    deps = [
+        ":resource_set",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
diff --git a/iree/hal/utils/CMakeLists.txt b/runtime/src/iree/hal/utils/CMakeLists.txt
similarity index 96%
rename from iree/hal/utils/CMakeLists.txt
rename to runtime/src/iree/hal/utils/CMakeLists.txt
index 3c60c69..1f589f5 100644
--- a/iree/hal/utils/CMakeLists.txt
+++ b/runtime/src/iree/hal/utils/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/utils/BUILD                                                         #
+# runtime/src/iree/hal/utils/BUILD                                             #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/utils/buffer_transfer.c b/runtime/src/iree/hal/utils/buffer_transfer.c
similarity index 100%
rename from iree/hal/utils/buffer_transfer.c
rename to runtime/src/iree/hal/utils/buffer_transfer.c
diff --git a/iree/hal/utils/buffer_transfer.h b/runtime/src/iree/hal/utils/buffer_transfer.h
similarity index 100%
rename from iree/hal/utils/buffer_transfer.h
rename to runtime/src/iree/hal/utils/buffer_transfer.h
diff --git a/iree/hal/utils/deferred_command_buffer.c b/runtime/src/iree/hal/utils/deferred_command_buffer.c
similarity index 100%
rename from iree/hal/utils/deferred_command_buffer.c
rename to runtime/src/iree/hal/utils/deferred_command_buffer.c
diff --git a/iree/hal/utils/deferred_command_buffer.h b/runtime/src/iree/hal/utils/deferred_command_buffer.h
similarity index 100%
rename from iree/hal/utils/deferred_command_buffer.h
rename to runtime/src/iree/hal/utils/deferred_command_buffer.h
diff --git a/iree/hal/utils/resource_set.c b/runtime/src/iree/hal/utils/resource_set.c
similarity index 100%
rename from iree/hal/utils/resource_set.c
rename to runtime/src/iree/hal/utils/resource_set.c
diff --git a/iree/hal/utils/resource_set.h b/runtime/src/iree/hal/utils/resource_set.h
similarity index 100%
rename from iree/hal/utils/resource_set.h
rename to runtime/src/iree/hal/utils/resource_set.h
diff --git a/iree/hal/utils/resource_set_benchmark.c b/runtime/src/iree/hal/utils/resource_set_benchmark.c
similarity index 100%
rename from iree/hal/utils/resource_set_benchmark.c
rename to runtime/src/iree/hal/utils/resource_set_benchmark.c
diff --git a/iree/hal/utils/resource_set_test.cc b/runtime/src/iree/hal/utils/resource_set_test.cc
similarity index 100%
rename from iree/hal/utils/resource_set_test.cc
rename to runtime/src/iree/hal/utils/resource_set_test.cc
diff --git a/iree/hal/vmvx/BUILD b/runtime/src/iree/hal/vmvx/BUILD
similarity index 100%
rename from iree/hal/vmvx/BUILD
rename to runtime/src/iree/hal/vmvx/BUILD
diff --git a/iree/hal/vmvx/CMakeLists.txt b/runtime/src/iree/hal/vmvx/CMakeLists.txt
similarity index 91%
copy from iree/hal/vmvx/CMakeLists.txt
copy to runtime/src/iree/hal/vmvx/CMakeLists.txt
index 0866391..b1096fc 100644
--- a/iree/hal/vmvx/CMakeLists.txt
+++ b/runtime/src/iree/hal/vmvx/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vmvx/BUILD                                                          #
+# runtime/src/iree/hal/vmvx/BUILD                                              #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/vmvx/cts/CMakeLists.txt b/runtime/src/iree/hal/vmvx/cts/CMakeLists.txt
similarity index 87%
rename from iree/hal/vmvx/cts/CMakeLists.txt
rename to runtime/src/iree/hal/vmvx/cts/CMakeLists.txt
index f85ae45..8a116f9 100644
--- a/iree/hal/vmvx/cts/CMakeLists.txt
+++ b/runtime/src/iree/hal/vmvx/cts/CMakeLists.txt
@@ -8,7 +8,7 @@
   DRIVER_NAME
     vmvx
   DRIVER_REGISTRATION_HDR
-    "iree/hal/vmvx/registration/driver_module.h"
+    "runtime/src/iree/hal/vmvx/registration/driver_module.h"
   DRIVER_REGISTRATION_FN
     "iree_hal_vmvx_driver_module_register"
   COMPILER_TARGET_BACKEND
@@ -23,7 +23,7 @@
   DRIVER_NAME
     vmvx-sync
   DRIVER_REGISTRATION_HDR
-    "iree/hal/vmvx/registration/driver_module_sync.h"
+    "runtime/src/iree/hal/vmvx/registration/driver_module_sync.h"
   DRIVER_REGISTRATION_FN
     "iree_hal_vmvx_sync_driver_module_register"
   COMPILER_TARGET_BACKEND
diff --git a/runtime/src/iree/hal/vmvx/registration/BUILD b/runtime/src/iree/hal/vmvx/registration/BUILD
new file mode 100644
index 0000000..2bbe131
--- /dev/null
+++ b/runtime/src/iree/hal/vmvx/registration/BUILD
@@ -0,0 +1,71 @@
+# Copyright 2021 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_runtime_cc_library")
+
+package(
+    default_visibility = ["//visibility:public"],
+    features = ["layering_check"],
+    licenses = ["notice"],  # Apache 2.0
+)
+
+iree_cmake_extra_content(
+    content = """
+if(${IREE_HAL_DRIVER_VMVX})
+""",
+    inline = True,
+)
+
+iree_runtime_cc_library(
+    name = "registration",
+    srcs = ["driver_module.c"],
+    hdrs = ["driver_module.h"],
+    defines = [
+        "IREE_HAL_HAVE_VMVX_DRIVER_MODULE=1",
+    ],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:task_driver",
+        "//runtime/src/iree/hal/local/loaders:vmvx_module_loader",
+        "//runtime/src/iree/task:api",
+        "//runtime/src/iree/vm",
+    ],
+)
+
+iree_cmake_extra_content(
+    content = """
+endif()
+
+if(${IREE_HAL_DRIVER_VMVX_SYNC})
+""",
+    inline = True,
+)
+
+iree_runtime_cc_library(
+    name = "sync",
+    srcs = ["driver_module_sync.c"],
+    hdrs = ["driver_module_sync.h"],
+    defines = [
+        "IREE_HAL_HAVE_VMVX_SYNC_DRIVER_MODULE=1",
+    ],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/local",
+        "//runtime/src/iree/hal/local:sync_driver",
+        "//runtime/src/iree/hal/local/loaders:vmvx_module_loader",
+        "//runtime/src/iree/vm",
+    ],
+)
+
+iree_cmake_extra_content(
+    content = """
+endif()
+""",
+    inline = True,
+)
diff --git a/iree/hal/vmvx/registration/CMakeLists.txt b/runtime/src/iree/hal/vmvx/registration/CMakeLists.txt
similarity index 95%
rename from iree/hal/vmvx/registration/CMakeLists.txt
rename to runtime/src/iree/hal/vmvx/registration/CMakeLists.txt
index 0067ef0..66ea6d2 100644
--- a/iree/hal/vmvx/registration/CMakeLists.txt
+++ b/runtime/src/iree/hal/vmvx/registration/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vmvx/registration/BUILD                                             #
+# runtime/src/iree/hal/vmvx/registration/BUILD                                 #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/vmvx/registration/driver_module.c b/runtime/src/iree/hal/vmvx/registration/driver_module.c
similarity index 100%
rename from iree/hal/vmvx/registration/driver_module.c
rename to runtime/src/iree/hal/vmvx/registration/driver_module.c
diff --git a/iree/hal/vmvx/registration/driver_module.h b/runtime/src/iree/hal/vmvx/registration/driver_module.h
similarity index 100%
rename from iree/hal/vmvx/registration/driver_module.h
rename to runtime/src/iree/hal/vmvx/registration/driver_module.h
diff --git a/iree/hal/vmvx/registration/driver_module_sync.c b/runtime/src/iree/hal/vmvx/registration/driver_module_sync.c
similarity index 100%
rename from iree/hal/vmvx/registration/driver_module_sync.c
rename to runtime/src/iree/hal/vmvx/registration/driver_module_sync.c
diff --git a/iree/hal/vmvx/registration/driver_module_sync.h b/runtime/src/iree/hal/vmvx/registration/driver_module_sync.h
similarity index 100%
rename from iree/hal/vmvx/registration/driver_module_sync.h
rename to runtime/src/iree/hal/vmvx/registration/driver_module_sync.h
diff --git a/iree/hal/vulkan/BUILD b/runtime/src/iree/hal/vulkan/BUILD
similarity index 66%
rename from iree/hal/vulkan/BUILD
rename to runtime/src/iree/hal/vulkan/BUILD
index 40b56c1..743310a 100644
--- a/iree/hal/vulkan/BUILD
+++ b/runtime/src/iree/hal/vulkan/BUILD
@@ -6,7 +6,7 @@
 
 # HAL implementation using Vulkan and (likely) SPIR-V executables.
 
-load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content")
+load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_runtime_cc_library", "iree_runtime_cc_test")
 
 package(
     default_visibility = ["//visibility:public"],
@@ -22,7 +22,7 @@
 """,
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "vulkan",
     srcs = [
         "api.cc",
@@ -85,29 +85,29 @@
     visibility = ["//visibility:public"],
     deps = [
         ":dynamic_symbols",
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base:core_headers",
-        "//iree/base:logging",
-        "//iree/base:tracing",
-        "//iree/base/internal",
-        "//iree/base/internal:arena",
-        "//iree/base/internal:synchronization",
-        "//iree/base/internal/flatcc:parsing",
-        "//iree/hal",
-        "//iree/hal/utils:buffer_transfer",
-        "//iree/hal/utils:resource_set",
-        "//iree/hal/vulkan/builtin",
-        "//iree/hal/vulkan/util:arena",
-        "//iree/hal/vulkan/util:intrusive_list",
-        "//iree/hal/vulkan/util:ref_ptr",
-        "//iree/schemas:spirv_executable_def_c_fbs",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal:arena",
+        "//runtime/src/iree/base/internal:synchronization",
+        "//runtime/src/iree/base/internal/flatcc:parsing",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/utils:buffer_transfer",
+        "//runtime/src/iree/hal/utils:resource_set",
+        "//runtime/src/iree/hal/vulkan/builtin",
+        "//runtime/src/iree/hal/vulkan/util:arena",
+        "//runtime/src/iree/hal/vulkan/util:intrusive_list",
+        "//runtime/src/iree/hal/vulkan/util:ref_ptr",
+        "//runtime/src/iree/schemas:spirv_executable_def_c_fbs",
         "@vulkan_headers",
         "@vulkan_memory_allocator//:impl_header_only",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "dynamic_symbols",
     srcs = [
         "dynamic_symbols.cc",
@@ -120,24 +120,24 @@
         "dynamic_symbol_tables.h",
     ],
     deps = [
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal:dynamic_library",
-        "//iree/hal/vulkan/util:ref_ptr",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:dynamic_library",
+        "//runtime/src/iree/hal/vulkan/util:ref_ptr",
         "@vulkan_headers",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "dynamic_symbols_test",
     srcs = ["dynamic_symbols_test.cc"],
     tags = ["driver=vulkan"],
     deps = [
         ":dynamic_symbols",
-        "//iree/base",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
diff --git a/iree/hal/vulkan/CMakeLists.txt b/runtime/src/iree/hal/vulkan/CMakeLists.txt
similarity index 97%
rename from iree/hal/vulkan/CMakeLists.txt
rename to runtime/src/iree/hal/vulkan/CMakeLists.txt
index 37fe297..17862ee 100644
--- a/iree/hal/vulkan/CMakeLists.txt
+++ b/runtime/src/iree/hal/vulkan/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vulkan/BUILD                                                        #
+# runtime/src/iree/hal/vulkan/BUILD                                            #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/vulkan/api.cc b/runtime/src/iree/hal/vulkan/api.cc
similarity index 100%
rename from iree/hal/vulkan/api.cc
rename to runtime/src/iree/hal/vulkan/api.cc
diff --git a/iree/hal/vulkan/api.h b/runtime/src/iree/hal/vulkan/api.h
similarity index 100%
rename from iree/hal/vulkan/api.h
rename to runtime/src/iree/hal/vulkan/api.h
diff --git a/iree/hal/vulkan/builtin/BUILD b/runtime/src/iree/hal/vulkan/builtin/BUILD
similarity index 100%
rename from iree/hal/vulkan/builtin/BUILD
rename to runtime/src/iree/hal/vulkan/builtin/BUILD
diff --git a/iree/hal/vulkan/builtin/CMakeLists.txt b/runtime/src/iree/hal/vulkan/builtin/CMakeLists.txt
similarity index 93%
rename from iree/hal/vulkan/builtin/CMakeLists.txt
rename to runtime/src/iree/hal/vulkan/builtin/CMakeLists.txt
index 2514196..b2c5b2e 100644
--- a/iree/hal/vulkan/builtin/CMakeLists.txt
+++ b/runtime/src/iree/hal/vulkan/builtin/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vulkan/builtin/BUILD                                                #
+# runtime/src/iree/hal/vulkan/builtin/BUILD                                    #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/vulkan/builtin/compile_shaders.sh b/runtime/src/iree/hal/vulkan/builtin/compile_shaders.sh
similarity index 100%
rename from iree/hal/vulkan/builtin/compile_shaders.sh
rename to runtime/src/iree/hal/vulkan/builtin/compile_shaders.sh
diff --git a/iree/hal/vulkan/builtin/fill_unaligned.glsl b/runtime/src/iree/hal/vulkan/builtin/fill_unaligned.glsl
similarity index 100%
rename from iree/hal/vulkan/builtin/fill_unaligned.glsl
rename to runtime/src/iree/hal/vulkan/builtin/fill_unaligned.glsl
diff --git a/iree/hal/vulkan/builtin/fill_unaligned.spv b/runtime/src/iree/hal/vulkan/builtin/fill_unaligned.spv
similarity index 100%
rename from iree/hal/vulkan/builtin/fill_unaligned.spv
rename to runtime/src/iree/hal/vulkan/builtin/fill_unaligned.spv
Binary files differ
diff --git a/iree/hal/vulkan/builtin_executables.cc b/runtime/src/iree/hal/vulkan/builtin_executables.cc
similarity index 100%
rename from iree/hal/vulkan/builtin_executables.cc
rename to runtime/src/iree/hal/vulkan/builtin_executables.cc
diff --git a/iree/hal/vulkan/builtin_executables.h b/runtime/src/iree/hal/vulkan/builtin_executables.h
similarity index 100%
rename from iree/hal/vulkan/builtin_executables.h
rename to runtime/src/iree/hal/vulkan/builtin_executables.h
diff --git a/iree/hal/vulkan/command_queue.h b/runtime/src/iree/hal/vulkan/command_queue.h
similarity index 100%
rename from iree/hal/vulkan/command_queue.h
rename to runtime/src/iree/hal/vulkan/command_queue.h
diff --git a/iree/hal/vulkan/cts/CMakeLists.txt b/runtime/src/iree/hal/vulkan/cts/CMakeLists.txt
similarity index 90%
rename from iree/hal/vulkan/cts/CMakeLists.txt
rename to runtime/src/iree/hal/vulkan/cts/CMakeLists.txt
index 67ef4df..17faa3b 100644
--- a/iree/hal/vulkan/cts/CMakeLists.txt
+++ b/runtime/src/iree/hal/vulkan/cts/CMakeLists.txt
@@ -8,7 +8,7 @@
   DRIVER_NAME
     vulkan
   DRIVER_REGISTRATION_HDR
-    "iree/hal/vulkan/registration/driver_module.h"
+    "runtime/src/iree/hal/vulkan/registration/driver_module.h"
   DRIVER_REGISTRATION_FN
     "iree_hal_vulkan_driver_module_register"
   COMPILER_TARGET_BACKEND
diff --git a/iree/hal/vulkan/debug_reporter.cc b/runtime/src/iree/hal/vulkan/debug_reporter.cc
similarity index 100%
rename from iree/hal/vulkan/debug_reporter.cc
rename to runtime/src/iree/hal/vulkan/debug_reporter.cc
diff --git a/iree/hal/vulkan/debug_reporter.h b/runtime/src/iree/hal/vulkan/debug_reporter.h
similarity index 100%
rename from iree/hal/vulkan/debug_reporter.h
rename to runtime/src/iree/hal/vulkan/debug_reporter.h
diff --git a/iree/hal/vulkan/descriptor_pool_cache.cc b/runtime/src/iree/hal/vulkan/descriptor_pool_cache.cc
similarity index 100%
rename from iree/hal/vulkan/descriptor_pool_cache.cc
rename to runtime/src/iree/hal/vulkan/descriptor_pool_cache.cc
diff --git a/iree/hal/vulkan/descriptor_pool_cache.h b/runtime/src/iree/hal/vulkan/descriptor_pool_cache.h
similarity index 100%
rename from iree/hal/vulkan/descriptor_pool_cache.h
rename to runtime/src/iree/hal/vulkan/descriptor_pool_cache.h
diff --git a/iree/hal/vulkan/descriptor_set_arena.cc b/runtime/src/iree/hal/vulkan/descriptor_set_arena.cc
similarity index 100%
rename from iree/hal/vulkan/descriptor_set_arena.cc
rename to runtime/src/iree/hal/vulkan/descriptor_set_arena.cc
diff --git a/iree/hal/vulkan/descriptor_set_arena.h b/runtime/src/iree/hal/vulkan/descriptor_set_arena.h
similarity index 100%
rename from iree/hal/vulkan/descriptor_set_arena.h
rename to runtime/src/iree/hal/vulkan/descriptor_set_arena.h
diff --git a/iree/hal/vulkan/direct_command_buffer.cc b/runtime/src/iree/hal/vulkan/direct_command_buffer.cc
similarity index 100%
rename from iree/hal/vulkan/direct_command_buffer.cc
rename to runtime/src/iree/hal/vulkan/direct_command_buffer.cc
diff --git a/iree/hal/vulkan/direct_command_buffer.h b/runtime/src/iree/hal/vulkan/direct_command_buffer.h
similarity index 100%
rename from iree/hal/vulkan/direct_command_buffer.h
rename to runtime/src/iree/hal/vulkan/direct_command_buffer.h
diff --git a/iree/hal/vulkan/direct_command_queue.cc b/runtime/src/iree/hal/vulkan/direct_command_queue.cc
similarity index 100%
rename from iree/hal/vulkan/direct_command_queue.cc
rename to runtime/src/iree/hal/vulkan/direct_command_queue.cc
diff --git a/iree/hal/vulkan/direct_command_queue.h b/runtime/src/iree/hal/vulkan/direct_command_queue.h
similarity index 100%
rename from iree/hal/vulkan/direct_command_queue.h
rename to runtime/src/iree/hal/vulkan/direct_command_queue.h
diff --git a/iree/hal/vulkan/dynamic_symbol_tables.h b/runtime/src/iree/hal/vulkan/dynamic_symbol_tables.h
similarity index 100%
rename from iree/hal/vulkan/dynamic_symbol_tables.h
rename to runtime/src/iree/hal/vulkan/dynamic_symbol_tables.h
diff --git a/iree/hal/vulkan/dynamic_symbols.cc b/runtime/src/iree/hal/vulkan/dynamic_symbols.cc
similarity index 100%
rename from iree/hal/vulkan/dynamic_symbols.cc
rename to runtime/src/iree/hal/vulkan/dynamic_symbols.cc
diff --git a/iree/hal/vulkan/dynamic_symbols.h b/runtime/src/iree/hal/vulkan/dynamic_symbols.h
similarity index 100%
rename from iree/hal/vulkan/dynamic_symbols.h
rename to runtime/src/iree/hal/vulkan/dynamic_symbols.h
diff --git a/iree/hal/vulkan/dynamic_symbols_test.cc b/runtime/src/iree/hal/vulkan/dynamic_symbols_test.cc
similarity index 100%
rename from iree/hal/vulkan/dynamic_symbols_test.cc
rename to runtime/src/iree/hal/vulkan/dynamic_symbols_test.cc
diff --git a/iree/hal/vulkan/emulated_semaphore.cc b/runtime/src/iree/hal/vulkan/emulated_semaphore.cc
similarity index 100%
rename from iree/hal/vulkan/emulated_semaphore.cc
rename to runtime/src/iree/hal/vulkan/emulated_semaphore.cc
diff --git a/iree/hal/vulkan/emulated_semaphore.h b/runtime/src/iree/hal/vulkan/emulated_semaphore.h
similarity index 100%
rename from iree/hal/vulkan/emulated_semaphore.h
rename to runtime/src/iree/hal/vulkan/emulated_semaphore.h
diff --git a/iree/hal/vulkan/extensibility_util.cc b/runtime/src/iree/hal/vulkan/extensibility_util.cc
similarity index 100%
rename from iree/hal/vulkan/extensibility_util.cc
rename to runtime/src/iree/hal/vulkan/extensibility_util.cc
diff --git a/iree/hal/vulkan/extensibility_util.h b/runtime/src/iree/hal/vulkan/extensibility_util.h
similarity index 100%
rename from iree/hal/vulkan/extensibility_util.h
rename to runtime/src/iree/hal/vulkan/extensibility_util.h
diff --git a/iree/hal/vulkan/handle_util.h b/runtime/src/iree/hal/vulkan/handle_util.h
similarity index 100%
rename from iree/hal/vulkan/handle_util.h
rename to runtime/src/iree/hal/vulkan/handle_util.h
diff --git a/iree/hal/vulkan/internal_vk_mem_alloc.cc b/runtime/src/iree/hal/vulkan/internal_vk_mem_alloc.cc
similarity index 100%
rename from iree/hal/vulkan/internal_vk_mem_alloc.cc
rename to runtime/src/iree/hal/vulkan/internal_vk_mem_alloc.cc
diff --git a/iree/hal/vulkan/internal_vk_mem_alloc.h b/runtime/src/iree/hal/vulkan/internal_vk_mem_alloc.h
similarity index 100%
rename from iree/hal/vulkan/internal_vk_mem_alloc.h
rename to runtime/src/iree/hal/vulkan/internal_vk_mem_alloc.h
diff --git a/iree/hal/vulkan/native_descriptor_set.cc b/runtime/src/iree/hal/vulkan/native_descriptor_set.cc
similarity index 100%
rename from iree/hal/vulkan/native_descriptor_set.cc
rename to runtime/src/iree/hal/vulkan/native_descriptor_set.cc
diff --git a/iree/hal/vulkan/native_descriptor_set.h b/runtime/src/iree/hal/vulkan/native_descriptor_set.h
similarity index 100%
rename from iree/hal/vulkan/native_descriptor_set.h
rename to runtime/src/iree/hal/vulkan/native_descriptor_set.h
diff --git a/iree/hal/vulkan/native_descriptor_set_layout.cc b/runtime/src/iree/hal/vulkan/native_descriptor_set_layout.cc
similarity index 100%
rename from iree/hal/vulkan/native_descriptor_set_layout.cc
rename to runtime/src/iree/hal/vulkan/native_descriptor_set_layout.cc
diff --git a/iree/hal/vulkan/native_descriptor_set_layout.h b/runtime/src/iree/hal/vulkan/native_descriptor_set_layout.h
similarity index 100%
rename from iree/hal/vulkan/native_descriptor_set_layout.h
rename to runtime/src/iree/hal/vulkan/native_descriptor_set_layout.h
diff --git a/iree/hal/vulkan/native_event.cc b/runtime/src/iree/hal/vulkan/native_event.cc
similarity index 100%
rename from iree/hal/vulkan/native_event.cc
rename to runtime/src/iree/hal/vulkan/native_event.cc
diff --git a/iree/hal/vulkan/native_event.h b/runtime/src/iree/hal/vulkan/native_event.h
similarity index 100%
rename from iree/hal/vulkan/native_event.h
rename to runtime/src/iree/hal/vulkan/native_event.h
diff --git a/iree/hal/vulkan/native_executable.cc b/runtime/src/iree/hal/vulkan/native_executable.cc
similarity index 100%
rename from iree/hal/vulkan/native_executable.cc
rename to runtime/src/iree/hal/vulkan/native_executable.cc
diff --git a/iree/hal/vulkan/native_executable.h b/runtime/src/iree/hal/vulkan/native_executable.h
similarity index 100%
rename from iree/hal/vulkan/native_executable.h
rename to runtime/src/iree/hal/vulkan/native_executable.h
diff --git a/iree/hal/vulkan/native_executable_layout.cc b/runtime/src/iree/hal/vulkan/native_executable_layout.cc
similarity index 100%
rename from iree/hal/vulkan/native_executable_layout.cc
rename to runtime/src/iree/hal/vulkan/native_executable_layout.cc
diff --git a/iree/hal/vulkan/native_executable_layout.h b/runtime/src/iree/hal/vulkan/native_executable_layout.h
similarity index 100%
rename from iree/hal/vulkan/native_executable_layout.h
rename to runtime/src/iree/hal/vulkan/native_executable_layout.h
diff --git a/iree/hal/vulkan/native_semaphore.cc b/runtime/src/iree/hal/vulkan/native_semaphore.cc
similarity index 100%
rename from iree/hal/vulkan/native_semaphore.cc
rename to runtime/src/iree/hal/vulkan/native_semaphore.cc
diff --git a/iree/hal/vulkan/native_semaphore.h b/runtime/src/iree/hal/vulkan/native_semaphore.h
similarity index 100%
rename from iree/hal/vulkan/native_semaphore.h
rename to runtime/src/iree/hal/vulkan/native_semaphore.h
diff --git a/iree/hal/vulkan/nop_executable_cache.cc b/runtime/src/iree/hal/vulkan/nop_executable_cache.cc
similarity index 100%
rename from iree/hal/vulkan/nop_executable_cache.cc
rename to runtime/src/iree/hal/vulkan/nop_executable_cache.cc
diff --git a/iree/hal/vulkan/nop_executable_cache.h b/runtime/src/iree/hal/vulkan/nop_executable_cache.h
similarity index 100%
rename from iree/hal/vulkan/nop_executable_cache.h
rename to runtime/src/iree/hal/vulkan/nop_executable_cache.h
diff --git a/iree/hal/vulkan/registration/BUILD b/runtime/src/iree/hal/vulkan/registration/BUILD
similarity index 64%
rename from iree/hal/vulkan/registration/BUILD
rename to runtime/src/iree/hal/vulkan/registration/BUILD
index 303f719..8706fbb 100644
--- a/iree/hal/vulkan/registration/BUILD
+++ b/runtime/src/iree/hal/vulkan/registration/BUILD
@@ -4,7 +4,7 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content")
+load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_runtime_cc_library")
 
 package(
     default_visibility = ["//visibility:public"],
@@ -19,7 +19,7 @@
     inline = True,
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "registration",
     srcs = ["driver_module.cc"],
     hdrs = ["driver_module.h"],
@@ -27,13 +27,13 @@
         "IREE_HAL_HAVE_VULKAN_DRIVER_MODULE=1",
     ],
     deps = [
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal:flags",
-        "//iree/hal",
-        "//iree/hal/vulkan",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:flags",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/vulkan",
     ],
 )
 
diff --git a/iree/hal/vulkan/registration/CMakeLists.txt b/runtime/src/iree/hal/vulkan/registration/CMakeLists.txt
similarity index 94%
rename from iree/hal/vulkan/registration/CMakeLists.txt
rename to runtime/src/iree/hal/vulkan/registration/CMakeLists.txt
index d1f2adb..14854c0 100644
--- a/iree/hal/vulkan/registration/CMakeLists.txt
+++ b/runtime/src/iree/hal/vulkan/registration/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vulkan/registration/BUILD                                           #
+# runtime/src/iree/hal/vulkan/registration/BUILD                               #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/vulkan/registration/driver_module.cc b/runtime/src/iree/hal/vulkan/registration/driver_module.cc
similarity index 100%
rename from iree/hal/vulkan/registration/driver_module.cc
rename to runtime/src/iree/hal/vulkan/registration/driver_module.cc
diff --git a/iree/hal/vulkan/registration/driver_module.h b/runtime/src/iree/hal/vulkan/registration/driver_module.h
similarity index 100%
rename from iree/hal/vulkan/registration/driver_module.h
rename to runtime/src/iree/hal/vulkan/registration/driver_module.h
diff --git a/iree/hal/vulkan/serializing_command_queue.cc b/runtime/src/iree/hal/vulkan/serializing_command_queue.cc
similarity index 100%
rename from iree/hal/vulkan/serializing_command_queue.cc
rename to runtime/src/iree/hal/vulkan/serializing_command_queue.cc
diff --git a/iree/hal/vulkan/serializing_command_queue.h b/runtime/src/iree/hal/vulkan/serializing_command_queue.h
similarity index 100%
rename from iree/hal/vulkan/serializing_command_queue.h
rename to runtime/src/iree/hal/vulkan/serializing_command_queue.h
diff --git a/iree/hal/vulkan/status_util.c b/runtime/src/iree/hal/vulkan/status_util.c
similarity index 100%
rename from iree/hal/vulkan/status_util.c
rename to runtime/src/iree/hal/vulkan/status_util.c
diff --git a/iree/hal/vulkan/status_util.h b/runtime/src/iree/hal/vulkan/status_util.h
similarity index 100%
rename from iree/hal/vulkan/status_util.h
rename to runtime/src/iree/hal/vulkan/status_util.h
diff --git a/iree/hal/vulkan/timepoint_util.cc b/runtime/src/iree/hal/vulkan/timepoint_util.cc
similarity index 100%
rename from iree/hal/vulkan/timepoint_util.cc
rename to runtime/src/iree/hal/vulkan/timepoint_util.cc
diff --git a/iree/hal/vulkan/timepoint_util.h b/runtime/src/iree/hal/vulkan/timepoint_util.h
similarity index 100%
rename from iree/hal/vulkan/timepoint_util.h
rename to runtime/src/iree/hal/vulkan/timepoint_util.h
diff --git a/iree/hal/vulkan/tracing.cc b/runtime/src/iree/hal/vulkan/tracing.cc
similarity index 100%
rename from iree/hal/vulkan/tracing.cc
rename to runtime/src/iree/hal/vulkan/tracing.cc
diff --git a/iree/hal/vulkan/tracing.h b/runtime/src/iree/hal/vulkan/tracing.h
similarity index 100%
rename from iree/hal/vulkan/tracing.h
rename to runtime/src/iree/hal/vulkan/tracing.h
diff --git a/runtime/src/iree/hal/vulkan/util/BUILD b/runtime/src/iree/hal/vulkan/util/BUILD
new file mode 100644
index 0000000..c57de01
--- /dev/null
+++ b/runtime/src/iree/hal/vulkan/util/BUILD
@@ -0,0 +1,78 @@
+# Copyright 2019 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library", "iree_runtime_cc_test")
+
+package(
+    default_visibility = ["//visibility:public"],
+    features = ["layering_check"],
+    licenses = ["notice"],  # Apache 2.0
+)
+
+iree_runtime_cc_library(
+    name = "arena",
+    srcs = ["arena.cc"],
+    hdrs = ["arena.h"],
+    deps = [
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:logging",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "arena_test",
+    srcs = ["arena_test.cc"],
+    deps = [
+        ":arena",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
+
+iree_runtime_cc_library(
+    name = "intrusive_list",
+    hdrs = [
+        "intrusive_list.h",
+        "intrusive_list_unique_ptr.inc",
+    ],
+    deps = [
+        "//runtime/src/iree/base:logging",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "intrusive_list_test",
+    srcs = [
+        "intrusive_list_test.cc",
+        "intrusive_list_unique_ptr_test.cc",
+    ],
+    deps = [
+        ":intrusive_list",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
+
+iree_runtime_cc_library(
+    name = "ref_ptr",
+    hdrs = ["ref_ptr.h"],
+    deps = [
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/base/internal",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "ref_ptr_test",
+    size = "small",
+    srcs = ["ref_ptr_test.cc"],
+    deps = [
+        ":ref_ptr",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
diff --git a/iree/hal/vulkan/util/CMakeLists.txt b/runtime/src/iree/hal/vulkan/util/CMakeLists.txt
similarity index 96%
rename from iree/hal/vulkan/util/CMakeLists.txt
rename to runtime/src/iree/hal/vulkan/util/CMakeLists.txt
index 9391d1c..1f7c7c4 100644
--- a/iree/hal/vulkan/util/CMakeLists.txt
+++ b/runtime/src/iree/hal/vulkan/util/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vulkan/util/BUILD                                                   #
+# runtime/src/iree/hal/vulkan/util/BUILD                                       #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/hal/vulkan/util/arena.cc b/runtime/src/iree/hal/vulkan/util/arena.cc
similarity index 100%
rename from iree/hal/vulkan/util/arena.cc
rename to runtime/src/iree/hal/vulkan/util/arena.cc
diff --git a/iree/hal/vulkan/util/arena.h b/runtime/src/iree/hal/vulkan/util/arena.h
similarity index 100%
rename from iree/hal/vulkan/util/arena.h
rename to runtime/src/iree/hal/vulkan/util/arena.h
diff --git a/iree/hal/vulkan/util/arena_test.cc b/runtime/src/iree/hal/vulkan/util/arena_test.cc
similarity index 100%
rename from iree/hal/vulkan/util/arena_test.cc
rename to runtime/src/iree/hal/vulkan/util/arena_test.cc
diff --git a/iree/hal/vulkan/util/intrusive_list.h b/runtime/src/iree/hal/vulkan/util/intrusive_list.h
similarity index 100%
rename from iree/hal/vulkan/util/intrusive_list.h
rename to runtime/src/iree/hal/vulkan/util/intrusive_list.h
diff --git a/iree/hal/vulkan/util/intrusive_list_test.cc b/runtime/src/iree/hal/vulkan/util/intrusive_list_test.cc
similarity index 100%
rename from iree/hal/vulkan/util/intrusive_list_test.cc
rename to runtime/src/iree/hal/vulkan/util/intrusive_list_test.cc
diff --git a/iree/hal/vulkan/util/intrusive_list_unique_ptr.inc b/runtime/src/iree/hal/vulkan/util/intrusive_list_unique_ptr.inc
similarity index 100%
rename from iree/hal/vulkan/util/intrusive_list_unique_ptr.inc
rename to runtime/src/iree/hal/vulkan/util/intrusive_list_unique_ptr.inc
diff --git a/iree/hal/vulkan/util/intrusive_list_unique_ptr_test.cc b/runtime/src/iree/hal/vulkan/util/intrusive_list_unique_ptr_test.cc
similarity index 100%
rename from iree/hal/vulkan/util/intrusive_list_unique_ptr_test.cc
rename to runtime/src/iree/hal/vulkan/util/intrusive_list_unique_ptr_test.cc
diff --git a/iree/hal/vulkan/util/ref_ptr.h b/runtime/src/iree/hal/vulkan/util/ref_ptr.h
similarity index 100%
rename from iree/hal/vulkan/util/ref_ptr.h
rename to runtime/src/iree/hal/vulkan/util/ref_ptr.h
diff --git a/iree/hal/vulkan/util/ref_ptr_test.cc b/runtime/src/iree/hal/vulkan/util/ref_ptr_test.cc
similarity index 100%
rename from iree/hal/vulkan/util/ref_ptr_test.cc
rename to runtime/src/iree/hal/vulkan/util/ref_ptr_test.cc
diff --git a/iree/hal/vulkan/vma_allocator.cc b/runtime/src/iree/hal/vulkan/vma_allocator.cc
similarity index 100%
rename from iree/hal/vulkan/vma_allocator.cc
rename to runtime/src/iree/hal/vulkan/vma_allocator.cc
diff --git a/iree/hal/vulkan/vma_allocator.h b/runtime/src/iree/hal/vulkan/vma_allocator.h
similarity index 100%
rename from iree/hal/vulkan/vma_allocator.h
rename to runtime/src/iree/hal/vulkan/vma_allocator.h
diff --git a/iree/hal/vulkan/vma_buffer.cc b/runtime/src/iree/hal/vulkan/vma_buffer.cc
similarity index 100%
rename from iree/hal/vulkan/vma_buffer.cc
rename to runtime/src/iree/hal/vulkan/vma_buffer.cc
diff --git a/iree/hal/vulkan/vma_buffer.h b/runtime/src/iree/hal/vulkan/vma_buffer.h
similarity index 100%
rename from iree/hal/vulkan/vma_buffer.h
rename to runtime/src/iree/hal/vulkan/vma_buffer.h
diff --git a/iree/hal/vulkan/vulkan_device.cc b/runtime/src/iree/hal/vulkan/vulkan_device.cc
similarity index 100%
rename from iree/hal/vulkan/vulkan_device.cc
rename to runtime/src/iree/hal/vulkan/vulkan_device.cc
diff --git a/iree/hal/vulkan/vulkan_device.h b/runtime/src/iree/hal/vulkan/vulkan_device.h
similarity index 100%
rename from iree/hal/vulkan/vulkan_device.h
rename to runtime/src/iree/hal/vulkan/vulkan_device.h
diff --git a/iree/hal/vulkan/vulkan_driver.cc b/runtime/src/iree/hal/vulkan/vulkan_driver.cc
similarity index 100%
rename from iree/hal/vulkan/vulkan_driver.cc
rename to runtime/src/iree/hal/vulkan/vulkan_driver.cc
diff --git a/iree/hal/vulkan/vulkan_driver.h b/runtime/src/iree/hal/vulkan/vulkan_driver.h
similarity index 100%
rename from iree/hal/vulkan/vulkan_driver.h
rename to runtime/src/iree/hal/vulkan/vulkan_driver.h
diff --git a/iree/hal/vulkan/vulkan_headers.h b/runtime/src/iree/hal/vulkan/vulkan_headers.h
similarity index 100%
rename from iree/hal/vulkan/vulkan_headers.h
rename to runtime/src/iree/hal/vulkan/vulkan_headers.h
diff --git a/iree/modules/BUILD b/runtime/src/iree/modules/BUILD
similarity index 100%
rename from iree/modules/BUILD
rename to runtime/src/iree/modules/BUILD
diff --git a/iree/hal/vmvx/CMakeLists.txt b/runtime/src/iree/modules/CMakeLists.txt
similarity index 91%
copy from iree/hal/vmvx/CMakeLists.txt
copy to runtime/src/iree/modules/CMakeLists.txt
index 0866391..a913b35 100644
--- a/iree/hal/vmvx/CMakeLists.txt
+++ b/runtime/src/iree/modules/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/hal/vmvx/BUILD                                                          #
+# runtime/src/iree/modules/BUILD                                               #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/runtime/src/iree/modules/check/BUILD b/runtime/src/iree/modules/check/BUILD
new file mode 100644
index 0000000..d80f0de
--- /dev/null
+++ b/runtime/src/iree/modules/check/BUILD
@@ -0,0 +1,50 @@
+# Copyright 2020 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library", "iree_runtime_cc_test")
+
+package(
+    default_visibility = ["//visibility:public"],
+    features = ["layering_check"],
+    licenses = ["notice"],  # Apache 2.0
+)
+
+iree_runtime_cc_library(
+    name = "check",
+    testonly = True,
+    srcs = ["module.cc"],
+    hdrs = ["module.h"],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:cc",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "check_test",
+    srcs = ["check_test.cc"],
+    deps = [
+        ":check",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal:span",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/vmvx/registration",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
+        "//runtime/src/iree/vm:cc",
+    ],
+)
diff --git a/iree/modules/check/CMakeLists.txt b/runtime/src/iree/modules/check/CMakeLists.txt
similarity index 100%
rename from iree/modules/check/CMakeLists.txt
rename to runtime/src/iree/modules/check/CMakeLists.txt
diff --git a/iree/modules/check/check_test.cc b/runtime/src/iree/modules/check/check_test.cc
similarity index 100%
rename from iree/modules/check/check_test.cc
rename to runtime/src/iree/modules/check/check_test.cc
diff --git a/iree/modules/check/module.cc b/runtime/src/iree/modules/check/module.cc
similarity index 100%
rename from iree/modules/check/module.cc
rename to runtime/src/iree/modules/check/module.cc
diff --git a/iree/modules/check/module.h b/runtime/src/iree/modules/check/module.h
similarity index 100%
rename from iree/modules/check/module.h
rename to runtime/src/iree/modules/check/module.h
diff --git a/iree/modules/check/test/BUILD b/runtime/src/iree/modules/check/test/BUILD
similarity index 97%
rename from iree/modules/check/test/BUILD
rename to runtime/src/iree/modules/check/test/BUILD
index 2790855..a834f60 100644
--- a/iree/modules/check/test/BUILD
+++ b/runtime/src/iree/modules/check/test/BUILD
@@ -24,6 +24,7 @@
         ],
         include = ["*.mlir"],
     ),
+    cfg = "//runtime:lit.cfg.py",
     tags = ["hostonly"],
     tools = [
         "//iree/tools:iree-check-module",
diff --git a/iree/modules/check/test/CMakeLists.txt b/runtime/src/iree/modules/check/test/CMakeLists.txt
similarity index 94%
rename from iree/modules/check/test/CMakeLists.txt
rename to runtime/src/iree/modules/check/test/CMakeLists.txt
index 99976bd..f41dae2 100644
--- a/iree/modules/check/test/CMakeLists.txt
+++ b/runtime/src/iree/modules/check/test/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/modules/check/test/BUILD                                                #
+# runtime/src/iree/modules/check/test/BUILD                                    #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/modules/check/test/failure.mlir b/runtime/src/iree/modules/check/test/failure.mlir
similarity index 100%
rename from iree/modules/check/test/failure.mlir
rename to runtime/src/iree/modules/check/test/failure.mlir
diff --git a/iree/modules/check/test/success.mlir b/runtime/src/iree/modules/check/test/success.mlir
similarity index 100%
rename from iree/modules/check/test/success.mlir
rename to runtime/src/iree/modules/check/test/success.mlir
diff --git a/iree/modules/check/test/unavailable.mlir b/runtime/src/iree/modules/check/test/unavailable.mlir
similarity index 100%
rename from iree/modules/check/test/unavailable.mlir
rename to runtime/src/iree/modules/check/test/unavailable.mlir
diff --git a/iree/modules/hal/BUILD b/runtime/src/iree/modules/hal/BUILD
similarity index 69%
rename from iree/modules/hal/BUILD
rename to runtime/src/iree/modules/hal/BUILD
index 3003cfb..9afa643 100644
--- a/iree/modules/hal/BUILD
+++ b/runtime/src/iree/modules/hal/BUILD
@@ -4,13 +4,15 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
     licenses = ["notice"],  # Apache 2.0
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "hal",
     srcs = [
         "module.c",
@@ -22,9 +24,9 @@
         "exports.inl",
     ],
     deps = [
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/hal",
-        "//iree/vm",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/vm",
     ],
 )
diff --git a/iree/modules/hal/CMakeLists.txt b/runtime/src/iree/modules/hal/CMakeLists.txt
similarity index 93%
rename from iree/modules/hal/CMakeLists.txt
rename to runtime/src/iree/modules/hal/CMakeLists.txt
index 903a3a6..14b2612 100644
--- a/iree/modules/hal/CMakeLists.txt
+++ b/runtime/src/iree/modules/hal/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/modules/hal/BUILD                                                       #
+# runtime/src/iree/modules/hal/BUILD                                           #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/modules/hal/exports.inl b/runtime/src/iree/modules/hal/exports.inl
similarity index 100%
rename from iree/modules/hal/exports.inl
rename to runtime/src/iree/modules/hal/exports.inl
diff --git a/iree/modules/hal/module.c b/runtime/src/iree/modules/hal/module.c
similarity index 100%
rename from iree/modules/hal/module.c
rename to runtime/src/iree/modules/hal/module.c
diff --git a/iree/modules/hal/module.h b/runtime/src/iree/modules/hal/module.h
similarity index 100%
rename from iree/modules/hal/module.h
rename to runtime/src/iree/modules/hal/module.h
diff --git a/iree/modules/vmvx/BUILD b/runtime/src/iree/modules/vmvx/BUILD
similarity index 72%
rename from iree/modules/vmvx/BUILD
rename to runtime/src/iree/modules/vmvx/BUILD
index 07462c7..1a49b24 100644
--- a/iree/modules/vmvx/BUILD
+++ b/runtime/src/iree/modules/vmvx/BUILD
@@ -4,13 +4,15 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
     licenses = ["notice"],  # Apache 2.0
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "vmvx",
     srcs = [
         "module.c",
@@ -22,8 +24,8 @@
         "exports.inl",
     ],
     deps = [
-        "//iree/base",
-        "//iree/base:tracing",
-        "//iree/vm",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/vm",
     ],
 )
diff --git a/iree/modules/vmvx/CMakeLists.txt b/runtime/src/iree/modules/vmvx/CMakeLists.txt
similarity index 93%
rename from iree/modules/vmvx/CMakeLists.txt
rename to runtime/src/iree/modules/vmvx/CMakeLists.txt
index 2bfe9af..5b6bcf9 100644
--- a/iree/modules/vmvx/CMakeLists.txt
+++ b/runtime/src/iree/modules/vmvx/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/modules/vmvx/BUILD                                                      #
+# runtime/src/iree/modules/vmvx/BUILD                                          #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/modules/vmvx/exports.inl b/runtime/src/iree/modules/vmvx/exports.inl
similarity index 100%
rename from iree/modules/vmvx/exports.inl
rename to runtime/src/iree/modules/vmvx/exports.inl
diff --git a/iree/modules/vmvx/module.c b/runtime/src/iree/modules/vmvx/module.c
similarity index 100%
rename from iree/modules/vmvx/module.c
rename to runtime/src/iree/modules/vmvx/module.c
diff --git a/iree/modules/vmvx/module.h b/runtime/src/iree/modules/vmvx/module.h
similarity index 100%
rename from iree/modules/vmvx/module.h
rename to runtime/src/iree/modules/vmvx/module.h
diff --git a/iree/runtime/BUILD.bazel b/runtime/src/iree/runtime/BUILD.bazel
similarity index 64%
rename from iree/runtime/BUILD.bazel
rename to runtime/src/iree/runtime/BUILD.bazel
index 1fbfe4c..2c435fb 100644
--- a/iree/runtime/BUILD.bazel
+++ b/runtime/src/iree/runtime/BUILD.bazel
@@ -4,6 +4,8 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
@@ -14,14 +16,14 @@
 # Public API
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "runtime",
     hdrs = [
         "api.h",
     ],
     deps = [
         ":impl",
-        "//iree/base",
+        "//runtime/src/iree/base",
     ],
 )
 
@@ -29,7 +31,7 @@
 # Implementation
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "impl",
     srcs = [
         "call.c",
@@ -42,15 +44,15 @@
         "session.h",
     ],
     deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal",
-        "//iree/base/internal:file_io",
-        "//iree/hal",
-        "//iree/hal/drivers",
-        "//iree/modules/hal",
-        "//iree/vm",
-        "//iree/vm:bytecode_module",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal:file_io",
+        "//runtime/src/iree/hal",
+        "//runtime/src/iree/hal/drivers",
+        "//runtime/src/iree/modules/hal",
+        "//runtime/src/iree/vm",
+        "//runtime/src/iree/vm:bytecode_module",
     ],
 )
diff --git a/iree/runtime/CMakeLists.txt b/runtime/src/iree/runtime/CMakeLists.txt
similarity index 100%
rename from iree/runtime/CMakeLists.txt
rename to runtime/src/iree/runtime/CMakeLists.txt
diff --git a/iree/runtime/README.md b/runtime/src/iree/runtime/README.md
similarity index 100%
rename from iree/runtime/README.md
rename to runtime/src/iree/runtime/README.md
diff --git a/iree/runtime/api.h b/runtime/src/iree/runtime/api.h
similarity index 100%
rename from iree/runtime/api.h
rename to runtime/src/iree/runtime/api.h
diff --git a/iree/runtime/call.c b/runtime/src/iree/runtime/call.c
similarity index 100%
rename from iree/runtime/call.c
rename to runtime/src/iree/runtime/call.c
diff --git a/iree/runtime/call.h b/runtime/src/iree/runtime/call.h
similarity index 100%
rename from iree/runtime/call.h
rename to runtime/src/iree/runtime/call.h
diff --git a/iree/runtime/demo/BUILD b/runtime/src/iree/runtime/demo/BUILD
similarity index 87%
rename from iree/runtime/demo/BUILD
rename to runtime/src/iree/runtime/demo/BUILD
index c465e1e..84a5f73 100644
--- a/iree/runtime/demo/BUILD
+++ b/runtime/src/iree/runtime/demo/BUILD
@@ -25,7 +25,7 @@
         "IREE_RUNTIME_DEMO_LOAD_FILE_FROM_COMMAND_LINE_ARG",
     ],
     deps = [
-        "//iree/runtime",
+        "//runtime/src/iree/runtime",
     ],
 )
 
@@ -50,8 +50,8 @@
         "IREE_RUNTIME_DEMO_LOAD_FILE_FROM_EMBEDDED_DATA",
     ],
     deps = [
-        "//iree/runtime",
-        "//iree/runtime/testdata:simple_mul_module_c",
+        "//runtime/src/iree/runtime",
+        "//runtime/src/iree/runtime/testdata:simple_mul_module_c",
     ],
 )
 
@@ -64,8 +64,8 @@
     name = "hello_world_terse",
     srcs = ["hello_world_terse.c"],
     deps = [
-        "//iree/runtime",
-        "//iree/runtime/testdata:simple_mul_module_c",
+        "//runtime/src/iree/runtime",
+        "//runtime/src/iree/runtime/testdata:simple_mul_module_c",
     ],
 )
 
diff --git a/iree/runtime/demo/CMakeLists.txt b/runtime/src/iree/runtime/demo/CMakeLists.txt
similarity index 100%
rename from iree/runtime/demo/CMakeLists.txt
rename to runtime/src/iree/runtime/demo/CMakeLists.txt
diff --git a/iree/runtime/demo/README.md b/runtime/src/iree/runtime/demo/README.md
similarity index 100%
rename from iree/runtime/demo/README.md
rename to runtime/src/iree/runtime/demo/README.md
diff --git a/iree/runtime/demo/hello_world_explained.c b/runtime/src/iree/runtime/demo/hello_world_explained.c
similarity index 100%
rename from iree/runtime/demo/hello_world_explained.c
rename to runtime/src/iree/runtime/demo/hello_world_explained.c
diff --git a/iree/runtime/demo/hello_world_terse.c b/runtime/src/iree/runtime/demo/hello_world_terse.c
similarity index 100%
rename from iree/runtime/demo/hello_world_terse.c
rename to runtime/src/iree/runtime/demo/hello_world_terse.c
diff --git a/iree/runtime/instance.c b/runtime/src/iree/runtime/instance.c
similarity index 100%
rename from iree/runtime/instance.c
rename to runtime/src/iree/runtime/instance.c
diff --git a/iree/runtime/instance.h b/runtime/src/iree/runtime/instance.h
similarity index 100%
rename from iree/runtime/instance.h
rename to runtime/src/iree/runtime/instance.h
diff --git a/iree/runtime/session.c b/runtime/src/iree/runtime/session.c
similarity index 100%
rename from iree/runtime/session.c
rename to runtime/src/iree/runtime/session.c
diff --git a/iree/runtime/session.h b/runtime/src/iree/runtime/session.h
similarity index 100%
rename from iree/runtime/session.h
rename to runtime/src/iree/runtime/session.h
diff --git a/iree/runtime/testdata/BUILD b/runtime/src/iree/runtime/testdata/BUILD
similarity index 100%
rename from iree/runtime/testdata/BUILD
rename to runtime/src/iree/runtime/testdata/BUILD
diff --git a/iree/runtime/testdata/CMakeLists.txt b/runtime/src/iree/runtime/testdata/CMakeLists.txt
similarity index 94%
rename from iree/runtime/testdata/CMakeLists.txt
rename to runtime/src/iree/runtime/testdata/CMakeLists.txt
index 7090198..8278eea 100644
--- a/iree/runtime/testdata/CMakeLists.txt
+++ b/runtime/src/iree/runtime/testdata/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/runtime/testdata/BUILD                                                  #
+# runtime/src/iree/runtime/testdata/BUILD                                      #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/runtime/testdata/simple_mul.mlir b/runtime/src/iree/runtime/testdata/simple_mul.mlir
similarity index 100%
rename from iree/runtime/testdata/simple_mul.mlir
rename to runtime/src/iree/runtime/testdata/simple_mul.mlir
diff --git a/iree/schemas/BUILD b/runtime/src/iree/schemas/BUILD
similarity index 100%
rename from iree/schemas/BUILD
rename to runtime/src/iree/schemas/BUILD
diff --git a/iree/schemas/CMakeLists.txt b/runtime/src/iree/schemas/CMakeLists.txt
similarity index 96%
rename from iree/schemas/CMakeLists.txt
rename to runtime/src/iree/schemas/CMakeLists.txt
index d95fca1..bc0b4f5 100644
--- a/iree/schemas/CMakeLists.txt
+++ b/runtime/src/iree/schemas/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/schemas/BUILD                                                           #
+# runtime/src/iree/schemas/BUILD                                               #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/schemas/bytecode_module_def.fbs b/runtime/src/iree/schemas/bytecode_module_def.fbs
similarity index 100%
rename from iree/schemas/bytecode_module_def.fbs
rename to runtime/src/iree/schemas/bytecode_module_def.fbs
diff --git a/iree/schemas/cuda_executable_def.fbs b/runtime/src/iree/schemas/cuda_executable_def.fbs
similarity index 100%
rename from iree/schemas/cuda_executable_def.fbs
rename to runtime/src/iree/schemas/cuda_executable_def.fbs
diff --git a/iree/schemas/metal_executable_def.fbs b/runtime/src/iree/schemas/metal_executable_def.fbs
similarity index 100%
rename from iree/schemas/metal_executable_def.fbs
rename to runtime/src/iree/schemas/metal_executable_def.fbs
diff --git a/iree/schemas/rocm_executable_def.fbs b/runtime/src/iree/schemas/rocm_executable_def.fbs
similarity index 100%
rename from iree/schemas/rocm_executable_def.fbs
rename to runtime/src/iree/schemas/rocm_executable_def.fbs
diff --git a/iree/schemas/spirv_executable_def.fbs b/runtime/src/iree/schemas/spirv_executable_def.fbs
similarity index 100%
rename from iree/schemas/spirv_executable_def.fbs
rename to runtime/src/iree/schemas/spirv_executable_def.fbs
diff --git a/iree/schemas/wgsl_executable_def.fbs b/runtime/src/iree/schemas/wgsl_executable_def.fbs
similarity index 100%
rename from iree/schemas/wgsl_executable_def.fbs
rename to runtime/src/iree/schemas/wgsl_executable_def.fbs
diff --git a/runtime/src/iree/task/BUILD b/runtime/src/iree/task/BUILD
new file mode 100644
index 0000000..6ef13e3
--- /dev/null
+++ b/runtime/src/iree/task/BUILD
@@ -0,0 +1,199 @@
+# Copyright 2020 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_runtime_cc_library", "iree_runtime_cc_test")
+
+package(
+    default_visibility = ["//visibility:public"],
+    features = ["layering_check"],
+    licenses = ["notice"],  # Apache 2.0
+)
+
+iree_cmake_extra_content(
+    content = """
+# Task-based executor requires threading support.
+if(NOT ${IREE_ENABLE_THREADING})
+  return()
+endif()
+
+# cpuinfo can be conditionally disabled when it is not supported.
+# If disabled then by default the task system will use 1 thread.
+set(IREE_CPUINFO_TARGET)
+if(IREE_ENABLE_CPUINFO)
+  set(IREE_CPUINFO_TARGET cpuinfo)
+endif()
+""",
+    inline = True,
+)
+
+iree_runtime_cc_library(
+    name = "api",
+    srcs = ["api.c"],
+    hdrs = ["api.h"],
+    deps = [
+        ":task",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:flags",
+    ],
+)
+
+iree_runtime_cc_library(
+    name = "task",
+    srcs = [
+        "executor.c",
+        "executor_impl.h",
+        "list.c",
+        "poller.c",
+        "pool.c",
+        "post_batch.c",
+        "post_batch.h",
+        "queue.c",
+        "scope.c",
+        "submission.c",
+        "task.c",
+        "task_impl.h",
+        "topology.c",
+        "topology_cpuinfo.c",
+        "worker.c",
+        "worker.h",
+    ],
+    hdrs = [
+        "affinity_set.h",
+        "executor.h",
+        "list.h",
+        "poller.h",
+        "pool.h",
+        "queue.h",
+        "scope.h",
+        "submission.h",
+        "task.h",
+        "topology.h",
+        "tuning.h",
+    ],
+    deps = [
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal:atomic_slist",
+        "//runtime/src/iree/base/internal:cpu",
+        "//runtime/src/iree/base/internal:event_pool",
+        "//runtime/src/iree/base/internal:fpu_state",
+        "//runtime/src/iree/base/internal:prng",
+        "//runtime/src/iree/base/internal:synchronization",
+        "//runtime/src/iree/base/internal:threading",
+        "//runtime/src/iree/base/internal:wait_handle",
+        "@cpuinfo",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "executor_demo",
+    srcs = ["executor_demo.cc"],
+    deps = [
+        ":task",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal:prng",
+        "//runtime/src/iree/task/testing:test_util",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "executor_test",
+    srcs = ["executor_test.cc"],
+    deps = [
+        ":task",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/task/testing:test_util",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "list_test",
+    srcs = ["list_test.cc"],
+    deps = [
+        ":task",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/task/testing:test_util",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "pool_test",
+    srcs = ["pool_test.cc"],
+    deps = [
+        ":task",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/task/testing:test_util",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "queue_test",
+    srcs = ["queue_test.cc"],
+    deps = [
+        ":task",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/task/testing:test_util",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "scope_test",
+    srcs = [
+        "scope_test.cc",
+        "task_impl.h",
+    ],
+    deps = [
+        ":task",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/task/testing:test_util",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "task_tests",
+    srcs = [
+        "task_test_barrier.cc",
+        "task_test_call.cc",
+        "task_test_dispatch.cc",
+        "task_test_fence.cc",
+        "task_test_nop.cc",
+        "task_test_wait.cc",
+    ],
+    deps = [
+        ":task",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/task/testing:task_test",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
+
+iree_runtime_cc_test(
+    name = "topology_test",
+    srcs = ["topology_test.cc"],
+    tags = [
+        "noasan",  # TODO(8469): Does not work on machines with large numbers of cores.
+    ],
+    deps = [
+        ":task",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+    ],
+)
diff --git a/iree/task/CMakeLists.txt b/runtime/src/iree/task/CMakeLists.txt
similarity index 98%
rename from iree/task/CMakeLists.txt
rename to runtime/src/iree/task/CMakeLists.txt
index 084fdcd..0e55722 100644
--- a/iree/task/CMakeLists.txt
+++ b/runtime/src/iree/task/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/task/BUILD                                                              #
+# runtime/src/iree/task/BUILD                                                  #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/task/affinity_set.h b/runtime/src/iree/task/affinity_set.h
similarity index 100%
rename from iree/task/affinity_set.h
rename to runtime/src/iree/task/affinity_set.h
diff --git a/iree/task/api.c b/runtime/src/iree/task/api.c
similarity index 100%
rename from iree/task/api.c
rename to runtime/src/iree/task/api.c
diff --git a/iree/task/api.h b/runtime/src/iree/task/api.h
similarity index 100%
rename from iree/task/api.h
rename to runtime/src/iree/task/api.h
diff --git a/iree/task/executor.c b/runtime/src/iree/task/executor.c
similarity index 100%
rename from iree/task/executor.c
rename to runtime/src/iree/task/executor.c
diff --git a/iree/task/executor.h b/runtime/src/iree/task/executor.h
similarity index 100%
rename from iree/task/executor.h
rename to runtime/src/iree/task/executor.h
diff --git a/iree/task/executor_demo.cc b/runtime/src/iree/task/executor_demo.cc
similarity index 100%
rename from iree/task/executor_demo.cc
rename to runtime/src/iree/task/executor_demo.cc
diff --git a/iree/task/executor_impl.h b/runtime/src/iree/task/executor_impl.h
similarity index 100%
rename from iree/task/executor_impl.h
rename to runtime/src/iree/task/executor_impl.h
diff --git a/iree/task/executor_test.cc b/runtime/src/iree/task/executor_test.cc
similarity index 100%
rename from iree/task/executor_test.cc
rename to runtime/src/iree/task/executor_test.cc
diff --git a/iree/task/list.c b/runtime/src/iree/task/list.c
similarity index 100%
rename from iree/task/list.c
rename to runtime/src/iree/task/list.c
diff --git a/iree/task/list.h b/runtime/src/iree/task/list.h
similarity index 100%
rename from iree/task/list.h
rename to runtime/src/iree/task/list.h
diff --git a/iree/task/list_test.cc b/runtime/src/iree/task/list_test.cc
similarity index 100%
rename from iree/task/list_test.cc
rename to runtime/src/iree/task/list_test.cc
diff --git a/iree/task/poller.c b/runtime/src/iree/task/poller.c
similarity index 100%
rename from iree/task/poller.c
rename to runtime/src/iree/task/poller.c
diff --git a/iree/task/poller.h b/runtime/src/iree/task/poller.h
similarity index 100%
rename from iree/task/poller.h
rename to runtime/src/iree/task/poller.h
diff --git a/iree/task/pool.c b/runtime/src/iree/task/pool.c
similarity index 100%
rename from iree/task/pool.c
rename to runtime/src/iree/task/pool.c
diff --git a/iree/task/pool.h b/runtime/src/iree/task/pool.h
similarity index 100%
rename from iree/task/pool.h
rename to runtime/src/iree/task/pool.h
diff --git a/iree/task/pool_test.cc b/runtime/src/iree/task/pool_test.cc
similarity index 100%
rename from iree/task/pool_test.cc
rename to runtime/src/iree/task/pool_test.cc
diff --git a/iree/task/post_batch.c b/runtime/src/iree/task/post_batch.c
similarity index 100%
rename from iree/task/post_batch.c
rename to runtime/src/iree/task/post_batch.c
diff --git a/iree/task/post_batch.h b/runtime/src/iree/task/post_batch.h
similarity index 100%
rename from iree/task/post_batch.h
rename to runtime/src/iree/task/post_batch.h
diff --git a/iree/task/queue.c b/runtime/src/iree/task/queue.c
similarity index 100%
rename from iree/task/queue.c
rename to runtime/src/iree/task/queue.c
diff --git a/iree/task/queue.h b/runtime/src/iree/task/queue.h
similarity index 100%
rename from iree/task/queue.h
rename to runtime/src/iree/task/queue.h
diff --git a/iree/task/queue_test.cc b/runtime/src/iree/task/queue_test.cc
similarity index 100%
rename from iree/task/queue_test.cc
rename to runtime/src/iree/task/queue_test.cc
diff --git a/iree/task/scope.c b/runtime/src/iree/task/scope.c
similarity index 100%
rename from iree/task/scope.c
rename to runtime/src/iree/task/scope.c
diff --git a/iree/task/scope.h b/runtime/src/iree/task/scope.h
similarity index 100%
rename from iree/task/scope.h
rename to runtime/src/iree/task/scope.h
diff --git a/iree/task/scope_test.cc b/runtime/src/iree/task/scope_test.cc
similarity index 100%
rename from iree/task/scope_test.cc
rename to runtime/src/iree/task/scope_test.cc
diff --git a/iree/task/submission.c b/runtime/src/iree/task/submission.c
similarity index 100%
rename from iree/task/submission.c
rename to runtime/src/iree/task/submission.c
diff --git a/iree/task/submission.h b/runtime/src/iree/task/submission.h
similarity index 100%
rename from iree/task/submission.h
rename to runtime/src/iree/task/submission.h
diff --git a/iree/task/task.c b/runtime/src/iree/task/task.c
similarity index 100%
rename from iree/task/task.c
rename to runtime/src/iree/task/task.c
diff --git a/iree/task/task.h b/runtime/src/iree/task/task.h
similarity index 100%
rename from iree/task/task.h
rename to runtime/src/iree/task/task.h
diff --git a/iree/task/task_impl.h b/runtime/src/iree/task/task_impl.h
similarity index 100%
rename from iree/task/task_impl.h
rename to runtime/src/iree/task/task_impl.h
diff --git a/iree/task/task_test_barrier.cc b/runtime/src/iree/task/task_test_barrier.cc
similarity index 100%
rename from iree/task/task_test_barrier.cc
rename to runtime/src/iree/task/task_test_barrier.cc
diff --git a/iree/task/task_test_call.cc b/runtime/src/iree/task/task_test_call.cc
similarity index 100%
rename from iree/task/task_test_call.cc
rename to runtime/src/iree/task/task_test_call.cc
diff --git a/iree/task/task_test_dispatch.cc b/runtime/src/iree/task/task_test_dispatch.cc
similarity index 100%
rename from iree/task/task_test_dispatch.cc
rename to runtime/src/iree/task/task_test_dispatch.cc
diff --git a/iree/task/task_test_fence.cc b/runtime/src/iree/task/task_test_fence.cc
similarity index 100%
rename from iree/task/task_test_fence.cc
rename to runtime/src/iree/task/task_test_fence.cc
diff --git a/iree/task/task_test_nop.cc b/runtime/src/iree/task/task_test_nop.cc
similarity index 100%
rename from iree/task/task_test_nop.cc
rename to runtime/src/iree/task/task_test_nop.cc
diff --git a/iree/task/task_test_wait.cc b/runtime/src/iree/task/task_test_wait.cc
similarity index 100%
rename from iree/task/task_test_wait.cc
rename to runtime/src/iree/task/task_test_wait.cc
diff --git a/iree/task/testing/BUILD b/runtime/src/iree/task/testing/BUILD
similarity index 66%
rename from iree/task/testing/BUILD
rename to runtime/src/iree/task/testing/BUILD
index 53f5108..c355f6b 100644
--- a/iree/task/testing/BUILD
+++ b/runtime/src/iree/task/testing/BUILD
@@ -4,28 +4,30 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
     licenses = ["notice"],  # Apache 2.0
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "task_test",
     testonly = 1,
     hdrs = ["task_test.h"],
     deps = [
-        "//iree/task",
-        "//iree/testing:gtest",
+        "//runtime/src/iree/task",
+        "//runtime/src/iree/testing:gtest",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "test_util",
     testonly = 1,
     hdrs = ["test_util.h"],
     deps = [
-        "//iree/task",
-        "//iree/testing:gtest",
+        "//runtime/src/iree/task",
+        "//runtime/src/iree/testing:gtest",
     ],
 )
diff --git a/iree/task/testing/CMakeLists.txt b/runtime/src/iree/task/testing/CMakeLists.txt
similarity index 93%
rename from iree/task/testing/CMakeLists.txt
rename to runtime/src/iree/task/testing/CMakeLists.txt
index f591191..9dbd55d 100644
--- a/iree/task/testing/CMakeLists.txt
+++ b/runtime/src/iree/task/testing/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/task/testing/BUILD                                                      #
+# runtime/src/iree/task/testing/BUILD                                          #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/task/testing/task_test.h b/runtime/src/iree/task/testing/task_test.h
similarity index 100%
rename from iree/task/testing/task_test.h
rename to runtime/src/iree/task/testing/task_test.h
diff --git a/iree/task/testing/test_util.h b/runtime/src/iree/task/testing/test_util.h
similarity index 100%
rename from iree/task/testing/test_util.h
rename to runtime/src/iree/task/testing/test_util.h
diff --git a/iree/task/topology.c b/runtime/src/iree/task/topology.c
similarity index 100%
rename from iree/task/topology.c
rename to runtime/src/iree/task/topology.c
diff --git a/iree/task/topology.h b/runtime/src/iree/task/topology.h
similarity index 100%
rename from iree/task/topology.h
rename to runtime/src/iree/task/topology.h
diff --git a/iree/task/topology_cpuinfo.c b/runtime/src/iree/task/topology_cpuinfo.c
similarity index 100%
rename from iree/task/topology_cpuinfo.c
rename to runtime/src/iree/task/topology_cpuinfo.c
diff --git a/iree/task/topology_test.cc b/runtime/src/iree/task/topology_test.cc
similarity index 100%
rename from iree/task/topology_test.cc
rename to runtime/src/iree/task/topology_test.cc
diff --git a/iree/task/tuning.h b/runtime/src/iree/task/tuning.h
similarity index 100%
rename from iree/task/tuning.h
rename to runtime/src/iree/task/tuning.h
diff --git a/iree/task/worker.c b/runtime/src/iree/task/worker.c
similarity index 100%
rename from iree/task/worker.c
rename to runtime/src/iree/task/worker.c
diff --git a/iree/task/worker.h b/runtime/src/iree/task/worker.h
similarity index 100%
rename from iree/task/worker.h
rename to runtime/src/iree/task/worker.h
diff --git a/iree/testing/BUILD b/runtime/src/iree/testing/BUILD
similarity index 73%
rename from iree/testing/BUILD
rename to runtime/src/iree/testing/BUILD
index 4217453..31be851 100644
--- a/iree/testing/BUILD
+++ b/runtime/src/iree/testing/BUILD
@@ -6,13 +6,15 @@
 
 # Testing utilities for IREE.
 
+load("//iree:build_defs.oss.bzl", "iree_runtime_cc_library")
+
 package(
     default_visibility = ["//visibility:public"],
     features = ["layering_check"],
     licenses = ["notice"],  # Apache 2.0
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "benchmark",
     srcs = [
         "benchmark_full.cc",
@@ -21,23 +23,23 @@
         "benchmark.h",
     ],
     deps = [
-        "//iree/base",
-        "//iree/base:tracing",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:tracing",
         "@com_google_benchmark//:benchmark",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "benchmark_main",
     testonly = True,
     srcs = ["benchmark_main.c"],
     deps = [
         ":benchmark",
-        "//iree/base/internal:flags",
+        "//runtime/src/iree/base/internal:flags",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "gtest",
     testonly = True,
     hdrs = [
@@ -45,19 +47,19 @@
         "status_matchers.h",
     ],
     deps = [
-        "//iree/base:cc",
+        "//runtime/src/iree/base:cc",
         "@com_google_googletest//:gtest",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "gtest_main",
     testonly = True,
     srcs = ["gtest_main.cc"],
     tags = ["keep_dep"],
     deps = [
         ":gtest",
-        "//iree/base/internal:flags",
+        "//runtime/src/iree/base/internal:flags",
         "@com_google_googletest//:gtest",
     ],
 )
diff --git a/iree/testing/CMakeLists.txt b/runtime/src/iree/testing/CMakeLists.txt
similarity index 100%
rename from iree/testing/CMakeLists.txt
rename to runtime/src/iree/testing/CMakeLists.txt
diff --git a/iree/testing/benchmark.h b/runtime/src/iree/testing/benchmark.h
similarity index 100%
rename from iree/testing/benchmark.h
rename to runtime/src/iree/testing/benchmark.h
diff --git a/iree/testing/benchmark_full.cc b/runtime/src/iree/testing/benchmark_full.cc
similarity index 100%
rename from iree/testing/benchmark_full.cc
rename to runtime/src/iree/testing/benchmark_full.cc
diff --git a/iree/testing/benchmark_main.c b/runtime/src/iree/testing/benchmark_main.c
similarity index 100%
rename from iree/testing/benchmark_main.c
rename to runtime/src/iree/testing/benchmark_main.c
diff --git a/iree/testing/benchmark_nop.c b/runtime/src/iree/testing/benchmark_nop.c
similarity index 100%
rename from iree/testing/benchmark_nop.c
rename to runtime/src/iree/testing/benchmark_nop.c
diff --git a/iree/testing/gtest.h b/runtime/src/iree/testing/gtest.h
similarity index 100%
rename from iree/testing/gtest.h
rename to runtime/src/iree/testing/gtest.h
diff --git a/iree/testing/gtest_main.cc b/runtime/src/iree/testing/gtest_main.cc
similarity index 100%
rename from iree/testing/gtest_main.cc
rename to runtime/src/iree/testing/gtest_main.cc
diff --git a/iree/testing/status_matchers.h b/runtime/src/iree/testing/status_matchers.h
similarity index 100%
rename from iree/testing/status_matchers.h
rename to runtime/src/iree/testing/status_matchers.h
diff --git a/iree/testing/vulkan/CMakeLists.txt b/runtime/src/iree/testing/vulkan/CMakeLists.txt
similarity index 100%
rename from iree/testing/vulkan/CMakeLists.txt
rename to runtime/src/iree/testing/vulkan/CMakeLists.txt
diff --git a/iree/testing/vulkan/iree-run-module-vulkan-gui-main.cc b/runtime/src/iree/testing/vulkan/iree-run-module-vulkan-gui-main.cc
similarity index 100%
rename from iree/testing/vulkan/iree-run-module-vulkan-gui-main.cc
rename to runtime/src/iree/testing/vulkan/iree-run-module-vulkan-gui-main.cc
diff --git a/iree/testing/vulkan/vulkan_gui_util.cc b/runtime/src/iree/testing/vulkan/vulkan_gui_util.cc
similarity index 100%
rename from iree/testing/vulkan/vulkan_gui_util.cc
rename to runtime/src/iree/testing/vulkan/vulkan_gui_util.cc
diff --git a/iree/testing/vulkan/vulkan_gui_util.h b/runtime/src/iree/testing/vulkan/vulkan_gui_util.h
similarity index 100%
rename from iree/testing/vulkan/vulkan_gui_util.h
rename to runtime/src/iree/testing/vulkan/vulkan_gui_util.h
diff --git a/iree/vm/BUILD b/runtime/src/iree/vm/BUILD
similarity index 71%
rename from iree/vm/BUILD
rename to runtime/src/iree/vm/BUILD
index 35dde95..34ededc 100644
--- a/iree/vm/BUILD
+++ b/runtime/src/iree/vm/BUILD
@@ -4,7 +4,7 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content")
+load("//iree:build_defs.oss.bzl", "iree_cmake_extra_content", "iree_runtime_cc_library", "iree_runtime_cc_test")
 load("//build_tools/bazel:iree_bytecode_module.bzl", "iree_bytecode_module")
 load("//build_tools/bazel:cc_binary_benchmark.bzl", "cc_binary_benchmark")
 # load("@llvm-project//mlir:tblgen.bzl", "gentbl_cc_library")
@@ -19,19 +19,19 @@
 # Public API
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "vm",
     hdrs = [
         "api.h",
     ],
     deps = [
         ":impl",
-        "//iree/base",
+        "//runtime/src/iree/base",
     ],
 )
 
 # TODO(benvanik): make these srcs and only expose an api_cc.h.
-cc_library(
+iree_runtime_cc_library(
     name = "cc",
     hdrs = [
         "native_module_cc.h",
@@ -40,10 +40,10 @@
     ],
     deps = [
         ":vm",
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/base:core_headers",
-        "//iree/base/internal:span",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base/internal:span",
     ],
 )
 
@@ -51,7 +51,7 @@
 # Implementation
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "impl",
     srcs = [
         "buffer.c",
@@ -82,59 +82,59 @@
         "value.h",
     ],
     deps = [
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "buffer_test",
     srcs = ["buffer_test.cc"],
     deps = [
         ":cc",
         ":impl",
-        "//iree/base",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "list_test",
     srcs = ["list_test.cc"],
     deps = [
         ":cc",
         ":impl",
-        "//iree/base",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "native_module_test",
     srcs = ["native_module_test.cc"],
     deps = [
         ":cc",
         ":impl",
         ":native_module_test_hdrs",
-        "//iree/base",
-        "//iree/base:cc",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "native_module_test_hdrs",
     hdrs = [
         "native_module_test.h",
     ],
     deps = [
         ":impl",
-        "//iree/base",
+        "//runtime/src/iree/base",
     ],
 )
 
@@ -144,33 +144,33 @@
     deps = [
         ":impl",
         ":native_module_test_hdrs",
-        "//iree/base",
-        "//iree/base:logging",
-        "//iree/testing:benchmark_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/testing:benchmark_main",
         "@com_google_benchmark//:benchmark",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "ref_test",
     srcs = ["ref_test.cc"],
     deps = [
         ":cc",
         ":impl",
-        "//iree/base",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "stack_test",
     srcs = ["stack_test.cc"],
     deps = [
         ":impl",
-        "//iree/base",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
     ],
 )
 
@@ -178,7 +178,7 @@
 # Bytecode interpreter module
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "bytecode_module",
     srcs = [
         "bytecode_disasm.c",
@@ -195,12 +195,12 @@
     deps = [
         ":ops",
         ":vm",
-        "//iree/base",
-        "//iree/base:core_headers",
-        "//iree/base:tracing",
-        "//iree/base/internal",
-        "//iree/base/internal/flatcc:parsing",
-        "//iree/schemas:bytecode_module_def_c_fbs",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:core_headers",
+        "//runtime/src/iree/base:tracing",
+        "//runtime/src/iree/base/internal",
+        "//runtime/src/iree/base/internal/flatcc:parsing",
+        "//runtime/src/iree/schemas:bytecode_module_def_c_fbs",
     ],
 )
 
@@ -230,7 +230,7 @@
     inline = True,
 )
 
-cc_test(
+iree_runtime_cc_test(
     name = "bytecode_module_test",
     srcs = [
         "bytecode_dispatch_test.cc",
@@ -243,11 +243,11 @@
     deps = [
         ":bytecode_module",
         ":vm",
-        "//iree/base:cc",
-        "//iree/base:logging",
-        "//iree/testing:gtest",
-        "//iree/testing:gtest_main",
-        "//iree/vm/test:all_bytecode_modules_c",
+        "//runtime/src/iree/base:cc",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/testing:gtest",
+        "//runtime/src/iree/testing:gtest_main",
+        "//runtime/src/iree/vm/test:all_bytecode_modules_c",
     ],
 )
 
@@ -259,9 +259,9 @@
         ":bytecode_module",
         ":bytecode_module_benchmark_module_c",
         ":vm",
-        "//iree/base",
-        "//iree/base:logging",
-        "//iree/testing:benchmark_main",
+        "//runtime/src/iree/base",
+        "//runtime/src/iree/base:logging",
+        "//runtime/src/iree/testing:benchmark_main",
         "@com_google_benchmark//:benchmark",
     ],
 )
@@ -282,7 +282,7 @@
         ":bytecode_module",
         ":bytecode_module_size_benchmark_module_c",
         ":vm",
-        "//iree/base",
+        "//runtime/src/iree/base",
     ],
 )
 
@@ -306,30 +306,30 @@
 # Common VM op implementations
 #===------------------------------------------------------------------------===#
 
-cc_library(
+iree_runtime_cc_library(
     name = "ops",
     hdrs = [
         "ops.h",
     ],
     deps = [
-        "//iree/base",
+        "//runtime/src/iree/base",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "ops_emitc",
     hdrs = [
         "ops_emitc.h",
     ],
 )
 
-cc_library(
+iree_runtime_cc_library(
     name = "shims_emitc",
     hdrs = [
         "shims_emitc.h",
     ],
     deps = [
         ":impl",
-        "//iree/base:core_headers",
+        "//runtime/src/iree/base:core_headers",
     ],
 )
diff --git a/iree/vm/CMakeLists.txt b/runtime/src/iree/vm/CMakeLists.txt
similarity index 98%
rename from iree/vm/CMakeLists.txt
rename to runtime/src/iree/vm/CMakeLists.txt
index 858bb13..ba43737 100644
--- a/iree/vm/CMakeLists.txt
+++ b/runtime/src/iree/vm/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/vm/BUILD                                                                #
+# runtime/src/iree/vm/BUILD                                                    #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
@@ -287,6 +287,8 @@
     ops_emitc
   HDRS
     "ops_emitc.h"
+  DEPS
+
   PUBLIC
 )
 
diff --git a/iree/vm/api.h b/runtime/src/iree/vm/api.h
similarity index 100%
rename from iree/vm/api.h
rename to runtime/src/iree/vm/api.h
diff --git a/iree/vm/buffer.c b/runtime/src/iree/vm/buffer.c
similarity index 100%
rename from iree/vm/buffer.c
rename to runtime/src/iree/vm/buffer.c
diff --git a/iree/vm/buffer.h b/runtime/src/iree/vm/buffer.h
similarity index 100%
rename from iree/vm/buffer.h
rename to runtime/src/iree/vm/buffer.h
diff --git a/iree/vm/buffer_test.cc b/runtime/src/iree/vm/buffer_test.cc
similarity index 100%
rename from iree/vm/buffer_test.cc
rename to runtime/src/iree/vm/buffer_test.cc
diff --git a/iree/vm/builtin_types.c b/runtime/src/iree/vm/builtin_types.c
similarity index 100%
rename from iree/vm/builtin_types.c
rename to runtime/src/iree/vm/builtin_types.c
diff --git a/iree/vm/builtin_types.h b/runtime/src/iree/vm/builtin_types.h
similarity index 100%
rename from iree/vm/builtin_types.h
rename to runtime/src/iree/vm/builtin_types.h
diff --git a/iree/vm/bytecode_disasm.c b/runtime/src/iree/vm/bytecode_disasm.c
similarity index 100%
rename from iree/vm/bytecode_disasm.c
rename to runtime/src/iree/vm/bytecode_disasm.c
diff --git a/iree/vm/bytecode_disasm.h b/runtime/src/iree/vm/bytecode_disasm.h
similarity index 100%
rename from iree/vm/bytecode_disasm.h
rename to runtime/src/iree/vm/bytecode_disasm.h
diff --git a/iree/vm/bytecode_dispatch.c b/runtime/src/iree/vm/bytecode_dispatch.c
similarity index 100%
rename from iree/vm/bytecode_dispatch.c
rename to runtime/src/iree/vm/bytecode_dispatch.c
diff --git a/iree/vm/bytecode_dispatch_test.cc b/runtime/src/iree/vm/bytecode_dispatch_test.cc
similarity index 100%
rename from iree/vm/bytecode_dispatch_test.cc
rename to runtime/src/iree/vm/bytecode_dispatch_test.cc
diff --git a/iree/vm/bytecode_dispatch_util.h b/runtime/src/iree/vm/bytecode_dispatch_util.h
similarity index 100%
rename from iree/vm/bytecode_dispatch_util.h
rename to runtime/src/iree/vm/bytecode_dispatch_util.h
diff --git a/iree/vm/bytecode_module.c b/runtime/src/iree/vm/bytecode_module.c
similarity index 100%
rename from iree/vm/bytecode_module.c
rename to runtime/src/iree/vm/bytecode_module.c
diff --git a/iree/vm/bytecode_module.h b/runtime/src/iree/vm/bytecode_module.h
similarity index 100%
rename from iree/vm/bytecode_module.h
rename to runtime/src/iree/vm/bytecode_module.h
diff --git a/iree/vm/bytecode_module_benchmark.cc b/runtime/src/iree/vm/bytecode_module_benchmark.cc
similarity index 100%
rename from iree/vm/bytecode_module_benchmark.cc
rename to runtime/src/iree/vm/bytecode_module_benchmark.cc
diff --git a/iree/vm/bytecode_module_benchmark.mlir b/runtime/src/iree/vm/bytecode_module_benchmark.mlir
similarity index 100%
rename from iree/vm/bytecode_module_benchmark.mlir
rename to runtime/src/iree/vm/bytecode_module_benchmark.mlir
diff --git a/iree/vm/bytecode_module_impl.h b/runtime/src/iree/vm/bytecode_module_impl.h
similarity index 100%
rename from iree/vm/bytecode_module_impl.h
rename to runtime/src/iree/vm/bytecode_module_impl.h
diff --git a/iree/vm/bytecode_module_size_benchmark.cc b/runtime/src/iree/vm/bytecode_module_size_benchmark.cc
similarity index 100%
rename from iree/vm/bytecode_module_size_benchmark.cc
rename to runtime/src/iree/vm/bytecode_module_size_benchmark.cc
diff --git a/iree/vm/bytecode_module_size_benchmark.mlir b/runtime/src/iree/vm/bytecode_module_size_benchmark.mlir
similarity index 100%
rename from iree/vm/bytecode_module_size_benchmark.mlir
rename to runtime/src/iree/vm/bytecode_module_size_benchmark.mlir
diff --git a/iree/vm/bytecode_module_test.cc b/runtime/src/iree/vm/bytecode_module_test.cc
similarity index 100%
rename from iree/vm/bytecode_module_test.cc
rename to runtime/src/iree/vm/bytecode_module_test.cc
diff --git a/iree/vm/context.c b/runtime/src/iree/vm/context.c
similarity index 100%
rename from iree/vm/context.c
rename to runtime/src/iree/vm/context.c
diff --git a/iree/vm/context.h b/runtime/src/iree/vm/context.h
similarity index 100%
rename from iree/vm/context.h
rename to runtime/src/iree/vm/context.h
diff --git a/iree/vm/generated/.clang-format b/runtime/src/iree/vm/generated/.clang-format
similarity index 100%
rename from iree/vm/generated/.clang-format
rename to runtime/src/iree/vm/generated/.clang-format
diff --git a/iree/vm/generated/bytecode_op_table.h b/runtime/src/iree/vm/generated/bytecode_op_table.h
similarity index 100%
rename from iree/vm/generated/bytecode_op_table.h
rename to runtime/src/iree/vm/generated/bytecode_op_table.h
diff --git a/iree/vm/instance.c b/runtime/src/iree/vm/instance.c
similarity index 100%
rename from iree/vm/instance.c
rename to runtime/src/iree/vm/instance.c
diff --git a/iree/vm/instance.h b/runtime/src/iree/vm/instance.h
similarity index 100%
rename from iree/vm/instance.h
rename to runtime/src/iree/vm/instance.h
diff --git a/iree/vm/invocation.c b/runtime/src/iree/vm/invocation.c
similarity index 100%
rename from iree/vm/invocation.c
rename to runtime/src/iree/vm/invocation.c
diff --git a/iree/vm/invocation.h b/runtime/src/iree/vm/invocation.h
similarity index 100%
rename from iree/vm/invocation.h
rename to runtime/src/iree/vm/invocation.h
diff --git a/iree/vm/list.c b/runtime/src/iree/vm/list.c
similarity index 100%
rename from iree/vm/list.c
rename to runtime/src/iree/vm/list.c
diff --git a/iree/vm/list.h b/runtime/src/iree/vm/list.h
similarity index 100%
rename from iree/vm/list.h
rename to runtime/src/iree/vm/list.h
diff --git a/iree/vm/list_test.cc b/runtime/src/iree/vm/list_test.cc
similarity index 100%
rename from iree/vm/list_test.cc
rename to runtime/src/iree/vm/list_test.cc
diff --git a/iree/vm/module.c b/runtime/src/iree/vm/module.c
similarity index 100%
rename from iree/vm/module.c
rename to runtime/src/iree/vm/module.c
diff --git a/iree/vm/module.h b/runtime/src/iree/vm/module.h
similarity index 100%
rename from iree/vm/module.h
rename to runtime/src/iree/vm/module.h
diff --git a/iree/vm/module_impl_emitc.c b/runtime/src/iree/vm/module_impl_emitc.c
similarity index 100%
rename from iree/vm/module_impl_emitc.c
rename to runtime/src/iree/vm/module_impl_emitc.c
diff --git a/iree/vm/native_module.c b/runtime/src/iree/vm/native_module.c
similarity index 100%
rename from iree/vm/native_module.c
rename to runtime/src/iree/vm/native_module.c
diff --git a/iree/vm/native_module.h b/runtime/src/iree/vm/native_module.h
similarity index 100%
rename from iree/vm/native_module.h
rename to runtime/src/iree/vm/native_module.h
diff --git a/iree/vm/native_module_benchmark.cc b/runtime/src/iree/vm/native_module_benchmark.cc
similarity index 100%
rename from iree/vm/native_module_benchmark.cc
rename to runtime/src/iree/vm/native_module_benchmark.cc
diff --git a/iree/vm/native_module_cc.h b/runtime/src/iree/vm/native_module_cc.h
similarity index 100%
rename from iree/vm/native_module_cc.h
rename to runtime/src/iree/vm/native_module_cc.h
diff --git a/iree/vm/native_module_packing.h b/runtime/src/iree/vm/native_module_packing.h
similarity index 100%
rename from iree/vm/native_module_packing.h
rename to runtime/src/iree/vm/native_module_packing.h
diff --git a/iree/vm/native_module_test.cc b/runtime/src/iree/vm/native_module_test.cc
similarity index 100%
rename from iree/vm/native_module_test.cc
rename to runtime/src/iree/vm/native_module_test.cc
diff --git a/iree/vm/native_module_test.h b/runtime/src/iree/vm/native_module_test.h
similarity index 100%
rename from iree/vm/native_module_test.h
rename to runtime/src/iree/vm/native_module_test.h
diff --git a/iree/vm/ops.h b/runtime/src/iree/vm/ops.h
similarity index 100%
rename from iree/vm/ops.h
rename to runtime/src/iree/vm/ops.h
diff --git a/iree/vm/ops_emitc.h b/runtime/src/iree/vm/ops_emitc.h
similarity index 100%
rename from iree/vm/ops_emitc.h
rename to runtime/src/iree/vm/ops_emitc.h
diff --git a/iree/vm/ref.c b/runtime/src/iree/vm/ref.c
similarity index 100%
rename from iree/vm/ref.c
rename to runtime/src/iree/vm/ref.c
diff --git a/iree/vm/ref.h b/runtime/src/iree/vm/ref.h
similarity index 100%
rename from iree/vm/ref.h
rename to runtime/src/iree/vm/ref.h
diff --git a/iree/vm/ref_cc.h b/runtime/src/iree/vm/ref_cc.h
similarity index 100%
rename from iree/vm/ref_cc.h
rename to runtime/src/iree/vm/ref_cc.h
diff --git a/iree/vm/ref_test.cc b/runtime/src/iree/vm/ref_test.cc
similarity index 100%
rename from iree/vm/ref_test.cc
rename to runtime/src/iree/vm/ref_test.cc
diff --git a/iree/vm/shims.c b/runtime/src/iree/vm/shims.c
similarity index 100%
rename from iree/vm/shims.c
rename to runtime/src/iree/vm/shims.c
diff --git a/iree/vm/shims.h b/runtime/src/iree/vm/shims.h
similarity index 100%
rename from iree/vm/shims.h
rename to runtime/src/iree/vm/shims.h
diff --git a/iree/vm/shims_emitc.h b/runtime/src/iree/vm/shims_emitc.h
similarity index 100%
rename from iree/vm/shims_emitc.h
rename to runtime/src/iree/vm/shims_emitc.h
diff --git a/iree/vm/stack.c b/runtime/src/iree/vm/stack.c
similarity index 100%
rename from iree/vm/stack.c
rename to runtime/src/iree/vm/stack.c
diff --git a/iree/vm/stack.h b/runtime/src/iree/vm/stack.h
similarity index 100%
rename from iree/vm/stack.h
rename to runtime/src/iree/vm/stack.h
diff --git a/iree/vm/stack_test.cc b/runtime/src/iree/vm/stack_test.cc
similarity index 100%
rename from iree/vm/stack_test.cc
rename to runtime/src/iree/vm/stack_test.cc
diff --git a/iree/vm/test/BUILD b/runtime/src/iree/vm/test/BUILD
similarity index 100%
rename from iree/vm/test/BUILD
rename to runtime/src/iree/vm/test/BUILD
diff --git a/iree/vm/test/CMakeLists.txt b/runtime/src/iree/vm/test/CMakeLists.txt
similarity index 98%
rename from iree/vm/test/CMakeLists.txt
rename to runtime/src/iree/vm/test/CMakeLists.txt
index 81b3f67..80e96c0 100644
--- a/iree/vm/test/CMakeLists.txt
+++ b/runtime/src/iree/vm/test/CMakeLists.txt
@@ -1,6 +1,6 @@
 ################################################################################
 # Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/vm/test/BUILD                                                           #
+# runtime/src/iree/vm/test/BUILD                                               #
 #                                                                              #
 # Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
 # CMake-only content.                                                          #
diff --git a/iree/vm/test/arithmetic_ops.mlir b/runtime/src/iree/vm/test/arithmetic_ops.mlir
similarity index 100%
rename from iree/vm/test/arithmetic_ops.mlir
rename to runtime/src/iree/vm/test/arithmetic_ops.mlir
diff --git a/iree/vm/test/arithmetic_ops_f32.mlir b/runtime/src/iree/vm/test/arithmetic_ops_f32.mlir
similarity index 100%
rename from iree/vm/test/arithmetic_ops_f32.mlir
rename to runtime/src/iree/vm/test/arithmetic_ops_f32.mlir
diff --git a/iree/vm/test/arithmetic_ops_i64.mlir b/runtime/src/iree/vm/test/arithmetic_ops_i64.mlir
similarity index 100%
rename from iree/vm/test/arithmetic_ops_i64.mlir
rename to runtime/src/iree/vm/test/arithmetic_ops_i64.mlir
diff --git a/iree/vm/test/assignment_ops.mlir b/runtime/src/iree/vm/test/assignment_ops.mlir
similarity index 100%
rename from iree/vm/test/assignment_ops.mlir
rename to runtime/src/iree/vm/test/assignment_ops.mlir
diff --git a/iree/vm/test/assignment_ops_f32.mlir b/runtime/src/iree/vm/test/assignment_ops_f32.mlir
similarity index 100%
rename from iree/vm/test/assignment_ops_f32.mlir
rename to runtime/src/iree/vm/test/assignment_ops_f32.mlir
diff --git a/iree/vm/test/assignment_ops_i64.mlir b/runtime/src/iree/vm/test/assignment_ops_i64.mlir
similarity index 100%
rename from iree/vm/test/assignment_ops_i64.mlir
rename to runtime/src/iree/vm/test/assignment_ops_i64.mlir
diff --git a/iree/vm/test/buffer_ops.mlir b/runtime/src/iree/vm/test/buffer_ops.mlir
similarity index 100%
rename from iree/vm/test/buffer_ops.mlir
rename to runtime/src/iree/vm/test/buffer_ops.mlir
diff --git a/iree/vm/test/call_ops.mlir b/runtime/src/iree/vm/test/call_ops.mlir
similarity index 100%
rename from iree/vm/test/call_ops.mlir
rename to runtime/src/iree/vm/test/call_ops.mlir
diff --git a/iree/vm/test/comparison_ops.mlir b/runtime/src/iree/vm/test/comparison_ops.mlir
similarity index 100%
rename from iree/vm/test/comparison_ops.mlir
rename to runtime/src/iree/vm/test/comparison_ops.mlir
diff --git a/iree/vm/test/comparison_ops_f32.mlir b/runtime/src/iree/vm/test/comparison_ops_f32.mlir
similarity index 100%
rename from iree/vm/test/comparison_ops_f32.mlir
rename to runtime/src/iree/vm/test/comparison_ops_f32.mlir
diff --git a/iree/vm/test/comparison_ops_i64.mlir b/runtime/src/iree/vm/test/comparison_ops_i64.mlir
similarity index 100%
rename from iree/vm/test/comparison_ops_i64.mlir
rename to runtime/src/iree/vm/test/comparison_ops_i64.mlir
diff --git a/iree/vm/test/control_flow_ops.mlir b/runtime/src/iree/vm/test/control_flow_ops.mlir
similarity index 100%
rename from iree/vm/test/control_flow_ops.mlir
rename to runtime/src/iree/vm/test/control_flow_ops.mlir
diff --git a/iree/vm/test/conversion_ops.mlir b/runtime/src/iree/vm/test/conversion_ops.mlir
similarity index 100%
rename from iree/vm/test/conversion_ops.mlir
rename to runtime/src/iree/vm/test/conversion_ops.mlir
diff --git a/iree/vm/test/conversion_ops_f32.mlir b/runtime/src/iree/vm/test/conversion_ops_f32.mlir
similarity index 100%
rename from iree/vm/test/conversion_ops_f32.mlir
rename to runtime/src/iree/vm/test/conversion_ops_f32.mlir
diff --git a/iree/vm/test/conversion_ops_i64.mlir b/runtime/src/iree/vm/test/conversion_ops_i64.mlir
similarity index 100%
rename from iree/vm/test/conversion_ops_i64.mlir
rename to runtime/src/iree/vm/test/conversion_ops_i64.mlir
diff --git a/iree/vm/test/emitc/CMakeLists.txt b/runtime/src/iree/vm/test/emitc/CMakeLists.txt
similarity index 100%
rename from iree/vm/test/emitc/CMakeLists.txt
rename to runtime/src/iree/vm/test/emitc/CMakeLists.txt
diff --git a/iree/vm/test/emitc/module_test.cc b/runtime/src/iree/vm/test/emitc/module_test.cc
similarity index 100%
rename from iree/vm/test/emitc/module_test.cc
rename to runtime/src/iree/vm/test/emitc/module_test.cc
diff --git a/iree/vm/test/global_ops.mlir b/runtime/src/iree/vm/test/global_ops.mlir
similarity index 100%
rename from iree/vm/test/global_ops.mlir
rename to runtime/src/iree/vm/test/global_ops.mlir
diff --git a/iree/vm/test/global_ops_f32.mlir b/runtime/src/iree/vm/test/global_ops_f32.mlir
similarity index 100%
rename from iree/vm/test/global_ops_f32.mlir
rename to runtime/src/iree/vm/test/global_ops_f32.mlir
diff --git a/iree/vm/test/global_ops_i64.mlir b/runtime/src/iree/vm/test/global_ops_i64.mlir
similarity index 100%
rename from iree/vm/test/global_ops_i64.mlir
rename to runtime/src/iree/vm/test/global_ops_i64.mlir
diff --git a/iree/vm/test/list_ops.mlir b/runtime/src/iree/vm/test/list_ops.mlir
similarity index 100%
rename from iree/vm/test/list_ops.mlir
rename to runtime/src/iree/vm/test/list_ops.mlir
diff --git a/iree/vm/test/list_ops_i64.mlir b/runtime/src/iree/vm/test/list_ops_i64.mlir
similarity index 100%
rename from iree/vm/test/list_ops_i64.mlir
rename to runtime/src/iree/vm/test/list_ops_i64.mlir
diff --git a/iree/vm/test/list_variant_ops.mlir b/runtime/src/iree/vm/test/list_variant_ops.mlir
similarity index 100%
rename from iree/vm/test/list_variant_ops.mlir
rename to runtime/src/iree/vm/test/list_variant_ops.mlir
diff --git a/iree/vm/test/ref_ops.mlir b/runtime/src/iree/vm/test/ref_ops.mlir
similarity index 100%
rename from iree/vm/test/ref_ops.mlir
rename to runtime/src/iree/vm/test/ref_ops.mlir
diff --git a/iree/vm/test/shift_ops.mlir b/runtime/src/iree/vm/test/shift_ops.mlir
similarity index 100%
rename from iree/vm/test/shift_ops.mlir
rename to runtime/src/iree/vm/test/shift_ops.mlir
diff --git a/iree/vm/test/shift_ops_i64.mlir b/runtime/src/iree/vm/test/shift_ops_i64.mlir
similarity index 100%
rename from iree/vm/test/shift_ops_i64.mlir
rename to runtime/src/iree/vm/test/shift_ops_i64.mlir
diff --git a/iree/vm/type_def.h b/runtime/src/iree/vm/type_def.h
similarity index 100%
rename from iree/vm/type_def.h
rename to runtime/src/iree/vm/type_def.h
diff --git a/iree/vm/value.h b/runtime/src/iree/vm/value.h
similarity index 100%
rename from iree/vm/value.h
rename to runtime/src/iree/vm/value.h