diff --git a/xla/backends/cpu/codegen/BUILD b/xla/backends/cpu/codegen/BUILD index eb4d77e46cc15..895373edee9e8 100644 --- a/xla/backends/cpu/codegen/BUILD +++ b/xla/backends/cpu/codegen/BUILD @@ -51,18 +51,6 @@ cc_library( ], ) -cc_library( - name = "function_library", - srcs = ["function_library.cc"], - hdrs = ["function_library.h"], - deps = [ - "//xla:util", - "//xla/tsl/lib/gtl:int_type", - "@com_google_absl//absl/status:statusor", - "@tsl//tsl/platform:statusor", - ], -) - cc_library( name = "ir_compiler", srcs = ["ir_compiler.cc"], @@ -96,9 +84,9 @@ cc_library( deps = [ ":contiguous_section_memory_manager", ":cpu_features", - ":function_library", ":ir_compiler", "//xla:util", + "//xla/backends/cpu/runtime:function_library", "//xla/service/cpu:orc_jit_memory_mapper", "@com_google_absl//absl/base:core_headers", "@com_google_absl//absl/container:flat_hash_map", @@ -138,9 +126,9 @@ xla_cc_test( name = "jit_compiler_test", srcs = ["jit_compiler_test.cc"], deps = [ - ":function_library", ":jit_compiler", "//xla:util", + "//xla/backends/cpu/runtime:function_library", "//xla/tsl/lib/core:status_test_util", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", diff --git a/xla/backends/cpu/codegen/jit_compiler.cc b/xla/backends/cpu/codegen/jit_compiler.cc index 86bb5167cf6e7..03dcfad9033b8 100644 --- a/xla/backends/cpu/codegen/jit_compiler.cc +++ b/xla/backends/cpu/codegen/jit_compiler.cc @@ -49,8 +49,8 @@ limitations under the License. #include "llvm/TargetParser/Host.h" #include "xla/backends/cpu/codegen/contiguous_section_memory_manager.h" #include "xla/backends/cpu/codegen/cpu_features.h" -#include "xla/backends/cpu/codegen/function_library.h" #include "xla/backends/cpu/codegen/ir_compiler.h" +#include "xla/backends/cpu/runtime/function_library.h" #include "xla/service/cpu/orc_jit_memory_mapper.h" #include "xla/util.h" #include "tsl/platform/cpu_info.h" diff --git a/xla/backends/cpu/codegen/jit_compiler.h b/xla/backends/cpu/codegen/jit_compiler.h index 8a1b5d0b40ec0..36ed08d5a63a9 100644 --- a/xla/backends/cpu/codegen/jit_compiler.h +++ b/xla/backends/cpu/codegen/jit_compiler.h @@ -40,8 +40,8 @@ limitations under the License. #include "llvm/Support/CodeGen.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" -#include "xla/backends/cpu/codegen/function_library.h" #include "xla/backends/cpu/codegen/ir_compiler.h" +#include "xla/backends/cpu/runtime/function_library.h" #include "tsl/platform/cpu_info.h" namespace xla::cpu { diff --git a/xla/backends/cpu/codegen/jit_compiler_test.cc b/xla/backends/cpu/codegen/jit_compiler_test.cc index d7a81cd93e91b..94ee288e8bc75 100644 --- a/xla/backends/cpu/codegen/jit_compiler_test.cc +++ b/xla/backends/cpu/codegen/jit_compiler_test.cc @@ -41,7 +41,7 @@ limitations under the License. #include "llvm/Support/SourceMgr.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" -#include "xla/backends/cpu/codegen/function_library.h" +#include "xla/backends/cpu/runtime/function_library.h" #include "xla/tsl/lib/core/status_test_util.h" #include "xla/util.h" #include "tsl/platform/env.h" diff --git a/xla/backends/cpu/runtime/BUILD b/xla/backends/cpu/runtime/BUILD index 6801b8b5376c1..13757c45836c0 100644 --- a/xla/backends/cpu/runtime/BUILD +++ b/xla/backends/cpu/runtime/BUILD @@ -120,6 +120,18 @@ xla_cc_test( ], ) +cc_library( + name = "function_library", + srcs = ["function_library.cc"], + hdrs = ["function_library.h"], + deps = [ + "//xla:util", + "//xla/tsl/lib/gtl:int_type", + "@com_google_absl//absl/status:statusor", + "@tsl//tsl/platform:statusor", + ], +) + cc_library( name = "thunk", srcs = ["thunk.cc"], diff --git a/xla/backends/cpu/codegen/function_library.cc b/xla/backends/cpu/runtime/function_library.cc similarity index 94% rename from xla/backends/cpu/codegen/function_library.cc rename to xla/backends/cpu/runtime/function_library.cc index 42261b90713f8..05fca27073dd9 100644 --- a/xla/backends/cpu/codegen/function_library.cc +++ b/xla/backends/cpu/runtime/function_library.cc @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#include "xla/backends/cpu/codegen/function_library.h" +#include "xla/backends/cpu/runtime/function_library.h" #include #include diff --git a/xla/backends/cpu/codegen/function_library.h b/xla/backends/cpu/runtime/function_library.h similarity index 94% rename from xla/backends/cpu/codegen/function_library.h rename to xla/backends/cpu/runtime/function_library.h index 9593fd78c9d18..4531c83b59ff3 100644 --- a/xla/backends/cpu/codegen/function_library.h +++ b/xla/backends/cpu/runtime/function_library.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef XLA_BACKENDS_CPU_CODEGEN_FUNCTION_LIBRARY_H_ -#define XLA_BACKENDS_CPU_CODEGEN_FUNCTION_LIBRARY_H_ +#ifndef XLA_BACKENDS_CPU_RUNTIME_FUNCTION_LIBRARY_H_ +#define XLA_BACKENDS_CPU_RUNTIME_FUNCTION_LIBRARY_H_ #include #include @@ -81,4 +81,4 @@ class FunctionLibrary { } // namespace xla::cpu -#endif // XLA_BACKENDS_CPU_CODEGEN_FUNCTION_LIBRARY_H_ +#endif // XLA_BACKENDS_CPU_RUNTIME_FUNCTION_LIBRARY_H_ diff --git a/xla/service/cpu/BUILD b/xla/service/cpu/BUILD index 95f702d804ca2..11089c900d296 100644 --- a/xla/service/cpu/BUILD +++ b/xla/service/cpu/BUILD @@ -243,10 +243,10 @@ cc_library( "//xla:xla_data_proto_cc", "//xla:xla_proto_cc", "//xla/backends/cpu/codegen:cpu_features", - "//xla/backends/cpu/codegen:function_library", "//xla/backends/cpu/codegen:ir_compiler", "//xla/backends/cpu/codegen:jit_compiler", "//xla/backends/cpu/codegen:target_machine_features", + "//xla/backends/cpu/runtime:function_library", "//xla/backends/cpu/runtime:thunk", "//xla/hlo/analysis:hlo_ordering", "//xla/hlo/analysis:indexed_array_analysis", @@ -587,8 +587,8 @@ cc_library( "//xla:status_macros", "//xla:util", "//xla:xla_data_proto_cc", - "//xla/backends/cpu/codegen:function_library", "//xla/backends/cpu/runtime:buffer_allocations", + "//xla/backends/cpu/runtime:function_library", "//xla/backends/cpu/runtime:thread_pool_task_runner", "//xla/backends/cpu/runtime:thunk", "//xla/backends/cpu/runtime:thunk_executor", diff --git a/xla/service/cpu/cpu_compiler.cc b/xla/service/cpu/cpu_compiler.cc index 288fc1e91a517..02ff4db0749f8 100644 --- a/xla/service/cpu/cpu_compiler.cc +++ b/xla/service/cpu/cpu_compiler.cc @@ -78,10 +78,10 @@ limitations under the License. #include "mlir/Target/LLVMIR/Export.h" #include "mlir/Transforms/DialectConversion.h" #include "xla/backends/cpu/codegen/cpu_features.h" -#include "xla/backends/cpu/codegen/function_library.h" #include "xla/backends/cpu/codegen/ir_compiler.h" #include "xla/backends/cpu/codegen/jit_compiler.h" #include "xla/backends/cpu/codegen/target_machine_features.h" +#include "xla/backends/cpu/runtime/function_library.h" #include "xla/backends/cpu/runtime/thunk.h" #include "xla/cpu_function_runtime.h" #include "xla/hlo/analysis/hlo_ordering.h" diff --git a/xla/service/cpu/cpu_executable.cc b/xla/service/cpu/cpu_executable.cc index 2b3949fe7eab1..ddcf95208360c 100644 --- a/xla/service/cpu/cpu_executable.cc +++ b/xla/service/cpu/cpu_executable.cc @@ -42,8 +42,8 @@ limitations under the License. #include "llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h" #include "llvm/IR/Mangler.h" #include "llvm/Support/Error.h" -#include "xla/backends/cpu/codegen/function_library.h" #include "xla/backends/cpu/runtime/buffer_allocations.h" +#include "xla/backends/cpu/runtime/function_library.h" #include "xla/backends/cpu/runtime/thread_pool_task_runner.h" #include "xla/backends/cpu/runtime/thunk.h" #include "xla/backends/cpu/runtime/thunk_executor.h" diff --git a/xla/service/cpu/cpu_executable.h b/xla/service/cpu/cpu_executable.h index 2222bf0adcb48..c136a2ce607ca 100644 --- a/xla/service/cpu/cpu_executable.h +++ b/xla/service/cpu/cpu_executable.h @@ -28,7 +28,7 @@ limitations under the License. #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/types/span.h" -#include "xla/backends/cpu/codegen/function_library.h" +#include "xla/backends/cpu/runtime/function_library.h" #include "xla/backends/cpu/runtime/thunk.h" #include "xla/backends/cpu/runtime/thunk_executor.h" #include "xla/executable_run_options.h"