From cc27e3ea29142793238158b13cd62b7e654493a0 Mon Sep 17 00:00:00 2001 From: Ganesh Belgur Ramachandra Date: Sun, 4 Aug 2024 12:45:44 -0500 Subject: [PATCH] amd: remove the redundant target library info instance in LLVM compiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/amd/llvm/ac_llvm_helper.cpp | 11 ----------- src/amd/llvm/ac_llvm_util.c | 6 ------ src/amd/llvm/ac_llvm_util.h | 4 ---- 3 files changed, 21 deletions(-) diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp index 8ea878943ba..59800955ff2 100644 --- a/src/amd/llvm/ac_llvm_helper.cpp +++ b/src/amd/llvm/ac_llvm_helper.cpp @@ -164,17 +164,6 @@ void ac_disable_signed_zeros(struct ac_llvm_context *ctx) } } -LLVMTargetLibraryInfoRef ac_create_target_library_info(const char *triple) -{ - return reinterpret_cast( - new TargetLibraryInfoImpl(Triple(triple))); -} - -void ac_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info) -{ - delete reinterpret_cast(library_info); -} - /* Implementation of raw_pwrite_stream that works on malloc()ed memory for * better compatibility with C code. */ struct raw_memory_ostream : public raw_pwrite_stream { diff --git a/src/amd/llvm/ac_llvm_util.c b/src/amd/llvm/ac_llvm_util.c index c8d5e739726..11456a388e3 100644 --- a/src/amd/llvm/ac_llvm_util.c +++ b/src/amd/llvm/ac_llvm_util.c @@ -178,10 +178,6 @@ bool ac_init_llvm_compiler(struct ac_llvm_compiler *compiler, enum radeon_family goto fail; } - compiler->target_library_info = ac_create_target_library_info(triple); - if (!compiler->target_library_info) - goto fail; - compiler->meo = ac_create_midend_optimizer(compiler->tm, tm_options & AC_TM_CHECK_IR); if (!compiler->meo) @@ -203,8 +199,6 @@ void ac_destroy_llvm_compiler(struct ac_llvm_compiler *compiler) if (compiler->meo) ac_destroy_midend_optimiser(compiler->meo); - if (compiler->target_library_info) - ac_dispose_target_library_info(compiler->target_library_info); if (compiler->low_opt_tm) LLVMDisposeTargetMachine(compiler->low_opt_tm); if (compiler->tm) diff --git a/src/amd/llvm/ac_llvm_util.h b/src/amd/llvm/ac_llvm_util.h index 0097601c9fc..4ab3cc47bf3 100644 --- a/src/amd/llvm/ac_llvm_util.h +++ b/src/amd/llvm/ac_llvm_util.h @@ -43,8 +43,6 @@ enum ac_float_mode /* Per-thread persistent LLVM objects. */ struct ac_llvm_compiler { - LLVMTargetLibraryInfoRef target_library_info; - /* Default compiler. */ LLVMTargetMachineRef tm; struct ac_midend_optimizer *meo; @@ -77,8 +75,6 @@ void ac_llvm_add_target_dep_function_attr(LLVMValueRef F, const char *name, unsi void ac_llvm_set_workgroup_size(LLVMValueRef F, unsigned size); void ac_llvm_set_target_features(LLVMValueRef F, struct ac_llvm_context *ctx, bool wgp_mode); -LLVMTargetLibraryInfoRef ac_create_target_library_info(const char *triple); -void ac_dispose_target_library_info(LLVMTargetLibraryInfoRef library_info); PUBLIC void ac_init_shared_llvm_once(void); /* Do not use directly, use ac_init_llvm_once */ void ac_init_llvm_once(void);