diff options
author | Marek Olšák <[email protected]> | 2018-04-09 19:23:55 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-04-27 17:56:04 -0400 |
commit | e75fc8d03396ea47506cc044cb1c11a7352ea283 (patch) | |
tree | 6e4dfdb3fd1c7c1d2a9641bba2fe84f6071cb68f /src/gallium/drivers/radeonsi/si_pipe.c | |
parent | 797d673c9a8c2d0a392f80b3c2190606ba8a6c83 (diff) |
radeonsi: move data_layout into si_compiler
Reviewed-by: Timothy Arceri <[email protected]>
Tested-by: Benedikt Schemmer <ben at besd.de>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index eeb7ff81f92..aa92f889e6e 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -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) |