mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 03:40:10 +01:00
radeonsi: move target_library_info into si_compiler
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Tested-by: Benedikt Schemmer <ben at besd.de> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
5a94f15aa7
commit
c1823ff661
3 changed files with 13 additions and 5 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include "sid.h"
|
||||
|
||||
#include "radeon/radeon_uvd.h"
|
||||
#include "gallivm/lp_bld_misc.h"
|
||||
#include "util/disk_cache.h"
|
||||
#include "util/hash_table.h"
|
||||
#include "util/u_log.h"
|
||||
|
|
@ -113,10 +114,19 @@ static void si_init_compiler(struct si_screen *sscreen,
|
|||
|
||||
compiler->tm = ac_create_target_machine(sscreen->info.family,
|
||||
tm_options, &compiler->triple);
|
||||
if (!compiler->tm)
|
||||
return;
|
||||
|
||||
compiler->target_library_info =
|
||||
gallivm_create_target_library_info(compiler->triple);
|
||||
if (!compiler->target_library_info)
|
||||
return;
|
||||
}
|
||||
|
||||
static void si_destroy_compiler(struct si_compiler *compiler)
|
||||
{
|
||||
if (compiler->target_library_info)
|
||||
gallivm_dispose_target_library_info(compiler->target_library_info);
|
||||
if (compiler->tm)
|
||||
LLVMDisposeTargetMachine(compiler->tm);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@ struct si_shader;
|
|||
struct si_compiler {
|
||||
LLVMTargetMachineRef tm;
|
||||
const char *triple;
|
||||
LLVMTargetLibraryInfoRef target_library_info;
|
||||
};
|
||||
|
||||
/* State of the context creating the shader object. */
|
||||
|
|
|
|||
|
|
@ -1213,7 +1213,6 @@ void si_llvm_create_func(struct si_shader_context *ctx,
|
|||
void si_llvm_optimize_module(struct si_shader_context *ctx)
|
||||
{
|
||||
struct gallivm_state *gallivm = &ctx->gallivm;
|
||||
LLVMTargetLibraryInfoRef target_library_info;
|
||||
|
||||
/* Dump LLVM IR before any optimization passes */
|
||||
if (ctx->screen->debug_flags & DBG(PREOPT_IR) &&
|
||||
|
|
@ -1223,9 +1222,8 @@ void si_llvm_optimize_module(struct si_shader_context *ctx)
|
|||
/* Create the pass manager */
|
||||
gallivm->passmgr = LLVMCreatePassManager();
|
||||
|
||||
target_library_info =
|
||||
gallivm_create_target_library_info(ctx->compiler->triple);
|
||||
LLVMAddTargetLibraryInfo(target_library_info, gallivm->passmgr);
|
||||
LLVMAddTargetLibraryInfo(ctx->compiler->target_library_info,
|
||||
gallivm->passmgr);
|
||||
|
||||
if (si_extra_shader_checks(ctx->screen, ctx->type))
|
||||
LLVMAddVerifierPass(gallivm->passmgr);
|
||||
|
|
@ -1249,7 +1247,6 @@ void si_llvm_optimize_module(struct si_shader_context *ctx)
|
|||
|
||||
LLVMDisposeBuilder(ctx->ac.builder);
|
||||
LLVMDisposePassManager(gallivm->passmgr);
|
||||
gallivm_dispose_target_library_info(target_library_info);
|
||||
}
|
||||
|
||||
void si_llvm_dispose(struct si_shader_context *ctx)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue