mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 11:00:11 +01:00
radeonsi: move data_layout 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
797d673c9a
commit
e75fc8d033
3 changed files with 11 additions and 6 deletions
|
|
@ -149,10 +149,19 @@ 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 (compiler->target_library_info)
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@ struct si_shader;
|
|||
struct si_compiler {
|
||||
LLVMTargetMachineRef tm;
|
||||
const char *triple;
|
||||
const char *data_layout;
|
||||
LLVMTargetLibraryInfoRef target_library_info;
|
||||
LLVMPassManagerRef passmgr;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1005,12 +1005,7 @@ void si_llvm_context_init(struct si_shader_context *ctx,
|
|||
ctx->gallivm.module = LLVMModuleCreateWithNameInContext("tgsi",
|
||||
ctx->gallivm.context);
|
||||
LLVMSetTarget(ctx->gallivm.module, compiler->triple);
|
||||
|
||||
LLVMTargetDataRef data_layout = LLVMCreateTargetDataLayout(compiler->tm);
|
||||
char *data_layout_str = LLVMCopyStringRepOfTargetData(data_layout);
|
||||
LLVMSetDataLayout(ctx->gallivm.module, data_layout_str);
|
||||
LLVMDisposeTargetData(data_layout);
|
||||
LLVMDisposeMessage(data_layout_str);
|
||||
LLVMSetDataLayout(ctx->gallivm.module, compiler->data_layout);
|
||||
|
||||
bool unsafe_fpmath = (sscreen->debug_flags & DBG(UNSAFE_MATH)) != 0;
|
||||
enum ac_float_mode float_mode =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue