diff options
author | Marek Olšák <marek.olsak@amd.com> | 2018-06-30 00:54:30 -0400 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2018-07-02 14:34:39 -0400 |
commit | 32e413ca59f5c335bcce110af1f27b5c5d458b94 (patch) | |
tree | f3f9abf28171a54edaf0afb61aae2050570b1e06 /src/gallium/drivers/radeonsi/si_pipe.c | |
parent | 49f7631c9fd94fbc5c892f70e5bcef54d0ec5043 (diff) |
ac: move all LLVM module initialization into ac_create_module
This removes some ugly code around module initialization.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index ded8cb5eb08..5da8a4b9873 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -119,13 +119,14 @@ static void si_init_compiler(struct si_screen *sscreen, (sscreen->info.chip_class < GFX9 ? AC_TM_FORCE_DISABLE_XNACK : 0) | (!sscreen->llvm_has_working_vgpr_indexing ? AC_TM_PROMOTE_ALLOCA_TO_SCRATCH : 0); + const char *triple; compiler->tm = ac_create_target_machine(sscreen->info.family, - tm_options, &compiler->triple); + tm_options, &triple); if (!compiler->tm) return; compiler->target_library_info = - gallivm_create_target_library_info(compiler->triple); + gallivm_create_target_library_info(triple); if (!compiler->target_library_info) return; @@ -150,19 +151,10 @@ static void si_init_compiler(struct si_screen *sscreen, /* This is recommended by the instruction combining pass. */ LLVMAddEarlyCSEMemSSAPass(compiler->passmgr); LLVMAddInstructionCombiningPass(compiler->passmgr); - - /* Get the data layout. */ - LLVMTargetDataRef data_layout = LLVMCreateTargetDataLayout(compiler->tm); - if (!data_layout) - return; - compiler->data_layout = LLVMCopyStringRepOfTargetData(data_layout); - LLVMDisposeTargetData(data_layout); } static void si_destroy_compiler(struct si_compiler *compiler) { - if (compiler->data_layout) - LLVMDisposeMessage((char*)compiler->data_layout); if (compiler->passmgr) LLVMDisposePassManager(compiler->passmgr); #if HAVE_LLVM >= 0x0700 |