Moving LLVMLinkerUtils to a Utils/ directory.
diff --git a/compiler/plugins/target/CUDA/BUILD.bazel b/compiler/plugins/target/CUDA/BUILD.bazel index 6f22208..60c84ae 100644 --- a/compiler/plugins/target/CUDA/BUILD.bazel +++ b/compiler/plugins/target/CUDA/BUILD.bazel
@@ -31,7 +31,7 @@ "//compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR:IREECodegenDialect", "//compiler/src/iree/compiler/Codegen/LLVMGPU", "//compiler/src/iree/compiler/Dialect/HAL/Target", - "//compiler/src/iree/compiler/Dialect/HAL/Target:LLVMLinkerUtils", + "//compiler/src/iree/compiler/Dialect/HAL/Utils:LLVMLinkerUtils", "//compiler/src/iree/compiler/PluginAPI", "//compiler/src/iree/compiler/Utils", "//runtime/src/iree/base/internal/flatcc:building",
diff --git a/compiler/plugins/target/CUDA/CMakeLists.txt b/compiler/plugins/target/CUDA/CMakeLists.txt index a6c2174..eea220e 100644 --- a/compiler/plugins/target/CUDA/CMakeLists.txt +++ b/compiler/plugins/target/CUDA/CMakeLists.txt
@@ -55,7 +55,7 @@ iree::compiler::Codegen::Dialect::Codegen::IR::IREECodegenDialect iree::compiler::Codegen::LLVMGPU iree::compiler::Dialect::HAL::Target - iree::compiler::Dialect::HAL::Target::LLVMLinkerUtils + iree::compiler::Dialect::HAL::Utils::LLVMLinkerUtils iree::compiler::PluginAPI iree::compiler::Utils iree::schemas::cuda_executable_def_c_fbs
diff --git a/compiler/plugins/target/CUDA/CUDATarget.cpp b/compiler/plugins/target/CUDA/CUDATarget.cpp index 0316cec..7a008ed 100644 --- a/compiler/plugins/target/CUDA/CUDATarget.cpp +++ b/compiler/plugins/target/CUDA/CUDATarget.cpp
@@ -7,8 +7,8 @@ #include "./SetBlockIdsRangePass.h" #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.h" #include "iree/compiler/Codegen/LLVMGPU/Passes.h" -#include "iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.h" #include "iree/compiler/Dialect/HAL/Target/TargetRegistry.h" +#include "iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.h" #include "iree/compiler/PluginAPI/Client.h" #include "iree/compiler/Utils/FlatbufferUtils.h" #include "iree/compiler/Utils/ModuleUtils.h"
diff --git a/compiler/plugins/target/LLVMCPU/BUILD.bazel b/compiler/plugins/target/LLVMCPU/BUILD.bazel index 92c817f..f8fe708 100644 --- a/compiler/plugins/target/LLVMCPU/BUILD.bazel +++ b/compiler/plugins/target/LLVMCPU/BUILD.bazel
@@ -37,7 +37,7 @@ "//compiler/src/iree/compiler/Codegen/LLVMCPU", "//compiler/src/iree/compiler/Codegen/Utils", "//compiler/src/iree/compiler/Dialect/HAL/Target", - "//compiler/src/iree/compiler/Dialect/HAL/Target:LLVMLinkerUtils", + "//compiler/src/iree/compiler/Dialect/HAL/Utils:LLVMLinkerUtils", "//compiler/src/iree/compiler/Dialect/LinalgExt/IR", "//compiler/src/iree/compiler/Dialect/Util/IR", "//compiler/src/iree/compiler/PluginAPI",
diff --git a/compiler/plugins/target/LLVMCPU/CMakeLists.txt b/compiler/plugins/target/LLVMCPU/CMakeLists.txt index badb46d..cd4d3fb 100644 --- a/compiler/plugins/target/LLVMCPU/CMakeLists.txt +++ b/compiler/plugins/target/LLVMCPU/CMakeLists.txt
@@ -56,7 +56,7 @@ iree::compiler::Codegen::LLVMCPU iree::compiler::Codegen::Utils iree::compiler::Dialect::HAL::Target - iree::compiler::Dialect::HAL::Target::LLVMLinkerUtils + iree::compiler::Dialect::HAL::Utils::LLVMLinkerUtils iree::compiler::Dialect::LinalgExt::IR iree::compiler::Dialect::Util::IR iree::compiler::PluginAPI
diff --git a/compiler/plugins/target/LLVMCPU/LLVMCPUTarget.cpp b/compiler/plugins/target/LLVMCPU/LLVMCPUTarget.cpp index e1f8f09..fbcb44c 100644 --- a/compiler/plugins/target/LLVMCPU/LLVMCPUTarget.cpp +++ b/compiler/plugins/target/LLVMCPU/LLVMCPUTarget.cpp
@@ -19,7 +19,7 @@ #include "iree/compiler/Codegen/LLVMCPU/Passes.h" #include "iree/compiler/Codegen/LLVMCPU/Utils.h" #include "iree/compiler/Codegen/Utils/Utils.h" -#include "iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.h" +#include "iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.h" #include "iree/compiler/Dialect/HAL/Target/TargetRegistry.h" #include "iree/compiler/Dialect/LinalgExt/IR/LinalgExtDialect.h" #include "iree/compiler/PluginAPI/Client.h"
diff --git a/compiler/plugins/target/ROCM/BUILD.bazel b/compiler/plugins/target/ROCM/BUILD.bazel index cd62c87..bb316a5 100644 --- a/compiler/plugins/target/ROCM/BUILD.bazel +++ b/compiler/plugins/target/ROCM/BUILD.bazel
@@ -34,7 +34,7 @@ "//compiler/src/iree/compiler/Codegen/LLVMGPU", "//compiler/src/iree/compiler/Codegen/Utils", "//compiler/src/iree/compiler/Dialect/HAL/Target", - "//compiler/src/iree/compiler/Dialect/HAL/Target:LLVMLinkerUtils", + "//compiler/src/iree/compiler/Dialect/HAL/Utils:LLVMLinkerUtils", "//compiler/src/iree/compiler/PluginAPI", "//compiler/src/iree/compiler/Utils", "//llvm-external-projects/iree-dialects:IREEVectorExtDialect",
diff --git a/compiler/plugins/target/ROCM/CMakeLists.txt b/compiler/plugins/target/ROCM/CMakeLists.txt index e827e16..d374265 100644 --- a/compiler/plugins/target/ROCM/CMakeLists.txt +++ b/compiler/plugins/target/ROCM/CMakeLists.txt
@@ -60,7 +60,7 @@ iree::compiler::Codegen::LLVMGPU iree::compiler::Codegen::Utils iree::compiler::Dialect::HAL::Target - iree::compiler::Dialect::HAL::Target::LLVMLinkerUtils + iree::compiler::Dialect::HAL::Utils::LLVMLinkerUtils iree::compiler::PluginAPI iree::compiler::Utils iree::schemas::rocm_executable_def_c_fbs
diff --git a/compiler/plugins/target/ROCM/ROCMTarget.cpp b/compiler/plugins/target/ROCM/ROCMTarget.cpp index eb62b6c..d10860a 100644 --- a/compiler/plugins/target/ROCM/ROCMTarget.cpp +++ b/compiler/plugins/target/ROCM/ROCMTarget.cpp
@@ -15,8 +15,8 @@ #include "iree/compiler/Codegen/Dialect/Codegen/IR/IREECodegenDialect.h" #include "iree/compiler/Codegen/Dialect/GPU/IR/IREEGPUDialect.h" #include "iree/compiler/Codegen/LLVMGPU/Passes.h" -#include "iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.h" #include "iree/compiler/Dialect/HAL/Target/TargetRegistry.h" +#include "iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.h" #include "iree/compiler/PluginAPI/Client.h" #include "iree/compiler/Utils/FlatbufferUtils.h" #include "iree/compiler/Utils/ModuleUtils.h"
diff --git a/compiler/plugins/target/ROCM/ROCMTargetUtils.cpp b/compiler/plugins/target/ROCM/ROCMTargetUtils.cpp index 4663126..27d235e 100644 --- a/compiler/plugins/target/ROCM/ROCMTargetUtils.cpp +++ b/compiler/plugins/target/ROCM/ROCMTargetUtils.cpp
@@ -7,7 +7,7 @@ #include "compiler/plugins/target/ROCM/ROCMTargetUtils.h" #include "iree/compiler/Codegen/Utils/GPUUtils.h" -#include "iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.h" +#include "iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.h" #include "iree/compiler/Utils/ToolUtils.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Module.h"
diff --git a/compiler/src/iree/compiler/Dialect/HAL/Target/BUILD.bazel b/compiler/src/iree/compiler/Dialect/HAL/Target/BUILD.bazel index 98f74df..91224fa 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Target/BUILD.bazel +++ b/compiler/src/iree/compiler/Dialect/HAL/Target/BUILD.bazel
@@ -36,23 +36,3 @@ "@llvm-project//mlir:Transforms", ], ) - -iree_compiler_cc_library( - name = "LLVMLinkerUtils", - srcs = [ - "LLVMLinkerUtils.cpp", - ], - hdrs = [ - "LLVMLinkerUtils.h", - ], - deps = [ - "//compiler/src/iree/compiler/Codegen/Utils", - "//compiler/src/iree/compiler/Dialect/HAL/IR", - "@llvm-project//llvm:BitReader", - "@llvm-project//llvm:Core", - "@llvm-project//llvm:IPO", - "@llvm-project//llvm:Linker", - "@llvm-project//llvm:Support", - "@llvm-project//llvm:Target", - ], -)
diff --git a/compiler/src/iree/compiler/Dialect/HAL/Target/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/HAL/Target/CMakeLists.txt index 2143777..1db6d8f 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Target/CMakeLists.txt +++ b/compiler/src/iree/compiler/Dialect/HAL/Target/CMakeLists.txt
@@ -34,23 +34,4 @@ PUBLIC ) -iree_cc_library( - NAME - LLVMLinkerUtils - HDRS - "LLVMLinkerUtils.h" - SRCS - "LLVMLinkerUtils.cpp" - DEPS - LLVMBitReader - LLVMCore - LLVMLinker - LLVMSupport - LLVMTarget - LLVMipo - iree::compiler::Codegen::Utils - iree::compiler::Dialect::HAL::IR - PUBLIC -) - ### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
diff --git a/compiler/src/iree/compiler/Dialect/HAL/Utils/BUILD.bazel b/compiler/src/iree/compiler/Dialect/HAL/Utils/BUILD.bazel new file mode 100644 index 0000000..7745815 --- /dev/null +++ b/compiler/src/iree/compiler/Dialect/HAL/Utils/BUILD.bazel
@@ -0,0 +1,33 @@ +# Copyright 2024 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:build_defs.oss.bzl", "iree_compiler_cc_library") + +package( + default_visibility = ["//visibility:public"], + features = ["layering_check"], + licenses = ["notice"], # Apache 2.0 +) + +iree_compiler_cc_library( + name = "LLVMLinkerUtils", + srcs = [ + "LLVMLinkerUtils.cpp", + ], + hdrs = [ + "LLVMLinkerUtils.h", + ], + deps = [ + "//compiler/src/iree/compiler/Codegen/Utils", + "//compiler/src/iree/compiler/Dialect/HAL/IR", + "@llvm-project//llvm:BitReader", + "@llvm-project//llvm:Core", + "@llvm-project//llvm:IPO", + "@llvm-project//llvm:Linker", + "@llvm-project//llvm:Support", + "@llvm-project//llvm:Target", + ], +)
diff --git a/compiler/src/iree/compiler/Dialect/HAL/Utils/CMakeLists.txt b/compiler/src/iree/compiler/Dialect/HAL/Utils/CMakeLists.txt new file mode 100644 index 0000000..696c5f3 --- /dev/null +++ b/compiler/src/iree/compiler/Dialect/HAL/Utils/CMakeLists.txt
@@ -0,0 +1,32 @@ +################################################################################ +# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from # +# compiler/src/iree/compiler/Dialect/HAL/Utils/BUILD.bazel # +# # +# 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() + +iree_cc_library( + NAME + LLVMLinkerUtils + HDRS + "LLVMLinkerUtils.h" + SRCS + "LLVMLinkerUtils.cpp" + DEPS + LLVMBitReader + LLVMCore + LLVMLinker + LLVMSupport + LLVMTarget + LLVMipo + iree::compiler::Codegen::Utils + iree::compiler::Dialect::HAL::IR + PUBLIC +) + +### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
diff --git a/compiler/src/iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.cpp b/compiler/src/iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.cpp similarity index 98% rename from compiler/src/iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.cpp rename to compiler/src/iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.cpp index 3f7810b..c987f93 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.cpp
@@ -4,7 +4,7 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.h" +#include "iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.h" #include "iree/compiler/Codegen/Utils/Utils.h" #include "llvm/Bitcode/BitcodeReader.h"
diff --git a/compiler/src/iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.h b/compiler/src/iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.h similarity index 92% rename from compiler/src/iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.h rename to compiler/src/iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.h index af9c382..1ccbbf3 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Target/LLVMLinkerUtils.h +++ b/compiler/src/iree/compiler/Dialect/HAL/Utils/LLVMLinkerUtils.h
@@ -4,8 +4,8 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#ifndef IREE_COMPILER_DIALECT_HAL_TARGET_LLVMLINKERUTILS_H_ -#define IREE_COMPILER_DIALECT_HAL_TARGET_LLVMLINKERUTILS_H_ +#ifndef IREE_COMPILER_DIALECT_HAL_UTILS_LLVMLINKERUTILS_H_ +#define IREE_COMPILER_DIALECT_HAL_UTILS_LLVMLINKERUTILS_H_ #include "iree/compiler/Dialect/HAL/IR/HALTypes.h" #include "llvm/IR/Module.h" @@ -55,4 +55,4 @@ } // namespace mlir::iree_compiler::IREE::HAL -#endif // IREE_COMPILER_DIALECT_HAL_TARGET_LLVMLINKERUTILS_H_ +#endif // IREE_COMPILER_DIALECT_HAL_UTILS_LLVMLINKERUTILS_H_