diff options
author | Dave Airlie <[email protected]> | 2018-07-03 09:39:27 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2018-07-04 05:31:32 +1000 |
commit | 0eb65b49442888ec45895b1aa5c0f8087361364f (patch) | |
tree | d7736b08a985125065e553222fe56ea55c39d5ab | |
parent | 887ba45c93b0a8cab664d1cd0bff104c862c479d (diff) |
radeonsi: rename si_compiler -> ac_llvm_compiler
As precursor to moving init to common code, just rename the struct
and move it.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r-- | src/amd/common/ac_llvm_util.h | 7 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_compute.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 6 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 24 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.h | 16 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_internal.h | 6 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state_shaders.c | 4 |
9 files changed, 37 insertions, 36 deletions
diff --git a/src/amd/common/ac_llvm_util.h b/src/amd/common/ac_llvm_util.h index 1175971e257..0ba70835678 100644 --- a/src/amd/common/ac_llvm_util.h +++ b/src/amd/common/ac_llvm_util.h @@ -67,6 +67,13 @@ enum ac_float_mode { AC_FLOAT_MODE_UNSAFE_FP_MATH, }; +/* Per-thread persistent LLVM objects. */ +struct ac_llvm_compiler { + LLVMTargetMachineRef tm; + LLVMTargetLibraryInfoRef target_library_info; + LLVMPassManagerRef passmgr; +}; + const char *ac_get_llvm_processor_name(enum radeon_family family); LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac_target_machine_options tm_options, diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index 5a58fe4ac4f..5d3341ff61e 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -86,7 +86,7 @@ static void si_create_compute_state_async(void *job, int thread_index) struct si_compute *program = (struct si_compute *)job; struct si_shader *shader = &program->shader; struct si_shader_selector sel; - struct si_compiler *compiler; + struct ac_llvm_compiler *compiler; struct pipe_debug_callback *debug = &program->compiler_ctx_state.debug; struct si_screen *sscreen = program->screen; diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 0f58286fed1..f4bed98e841 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -105,7 +105,7 @@ static const struct debug_named_value debug_options[] = { }; static void si_init_compiler(struct si_screen *sscreen, - struct si_compiler *compiler) + struct ac_llvm_compiler *compiler) { enum ac_target_machine_options tm_options = (sscreen->debug_flags & DBG(SI_SCHED) ? AC_TM_SISCHED : 0) | @@ -131,7 +131,7 @@ static void si_init_compiler(struct si_screen *sscreen, return; } -static void si_destroy_compiler(struct si_compiler *compiler) +static void si_destroy_compiler(struct ac_llvm_compiler *compiler) { if (compiler->passmgr) LLVMDisposePassManager(compiler->passmgr); diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index bd857f8a349..301c168c952 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -515,12 +515,12 @@ struct si_screen { /* Use at most 3 normal compiler threads on quadcore and better. * Hyperthreaded CPUs report the number of threads, but we want * the number of cores. We only need this many threads for shader-db. */ - struct si_compiler compiler[24]; /* used by the queue only */ + struct ac_llvm_compiler compiler[24]; /* used by the queue only */ struct util_queue shader_compiler_queue_low_priority; /* Use at most 2 low priority threads on quadcore and better. * We want to minimize the impact on multithreaded Mesa. */ - struct si_compiler compiler_lowp[10]; + struct ac_llvm_compiler compiler_lowp[10]; }; struct si_blend_color { @@ -762,7 +762,7 @@ struct si_context { void *vs_blit_texcoord; struct si_screen *screen; struct pipe_debug_callback debug; - struct si_compiler compiler; /* only non-threaded compilation */ + struct ac_llvm_compiler compiler; /* only non-threaded compilation */ struct si_shader_ctx_state fixed_func_tcs_shader; struct r600_resource *wait_mem_scratch; unsigned wait_mem_number; diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 32db089ed2c..5dc12d87243 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -69,7 +69,7 @@ enum si_arg_regfile { static void si_init_shader_ctx(struct si_shader_context *ctx, struct si_screen *sscreen, - struct si_compiler *compiler); + struct ac_llvm_compiler *compiler); static void si_llvm_emit_barrier(const struct lp_build_tgsi_action *action, struct lp_build_tgsi_context *bld_base, @@ -5641,7 +5641,7 @@ void si_shader_dump(struct si_screen *sscreen, const struct si_shader *shader, static int si_compile_llvm(struct si_screen *sscreen, struct ac_shader_binary *binary, struct si_shader_config *conf, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, LLVMModuleRef mod, struct pipe_debug_callback *debug, unsigned processor, @@ -5719,7 +5719,7 @@ static void si_llvm_build_ret(struct si_shader_context *ctx, LLVMValueRef ret) /* Generate code for the hardware VS shader stage to go with a geometry shader */ struct si_shader * si_generate_gs_copy_shader(struct si_screen *sscreen, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct si_shader_selector *gs_selector, struct pipe_debug_callback *debug) { @@ -6001,7 +6001,7 @@ static void si_dump_shader_key(unsigned processor, const struct si_shader *shade static void si_init_shader_ctx(struct si_shader_context *ctx, struct si_screen *sscreen, - struct si_compiler *compiler) + struct ac_llvm_compiler *compiler) { struct lp_build_tgsi_context *bld_base; @@ -6791,7 +6791,7 @@ static void si_build_wrapper_function(struct si_shader_context *ctx, } int si_compile_tgsi_shader(struct si_screen *sscreen, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct si_shader *shader, struct pipe_debug_callback *debug) { @@ -7132,7 +7132,7 @@ si_get_shader_part(struct si_screen *sscreen, enum pipe_shader_type type, bool prolog, union si_shader_part_key *key, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct pipe_debug_callback *debug, void (*build)(struct si_shader_context *, union si_shader_part_key *), @@ -7378,7 +7378,7 @@ static void si_build_vs_prolog_function(struct si_shader_context *ctx, } static bool si_get_vs_prolog(struct si_screen *sscreen, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct si_shader *shader, struct pipe_debug_callback *debug, struct si_shader *main_part, @@ -7406,7 +7406,7 @@ static bool si_get_vs_prolog(struct si_screen *sscreen, * Select and compile (or reuse) vertex shader parts (prolog & epilog). */ static bool si_shader_select_vs_parts(struct si_screen *sscreen, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct si_shader *shader, struct pipe_debug_callback *debug) { @@ -7495,7 +7495,7 @@ static void si_build_tcs_epilog_function(struct si_shader_context *ctx, * Select and compile (or reuse) TCS parts (epilog). */ static bool si_shader_select_tcs_parts(struct si_screen *sscreen, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct si_shader *shader, struct pipe_debug_callback *debug) { @@ -7527,7 +7527,7 @@ static bool si_shader_select_tcs_parts(struct si_screen *sscreen, * Select and compile (or reuse) GS parts (prolog). */ static bool si_shader_select_gs_parts(struct si_screen *sscreen, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct si_shader *shader, struct pipe_debug_callback *debug) { @@ -7940,7 +7940,7 @@ static void si_build_ps_epilog_function(struct si_shader_context *ctx, * Select and compile (or reuse) pixel shader parts (prolog & epilog). */ static bool si_shader_select_ps_parts(struct si_screen *sscreen, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct si_shader *shader, struct pipe_debug_callback *debug) { @@ -8071,7 +8071,7 @@ static void si_fix_resource_usage(struct si_screen *sscreen, } } -int si_shader_create(struct si_screen *sscreen, struct si_compiler *compiler, +int si_shader_create(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, struct si_shader *shader, struct pipe_debug_callback *debug) { diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 6b71b399437..ffe13b761d9 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -139,6 +139,7 @@ #include "ac_binary.h" #include "ac_llvm_build.h" +#include "ac_llvm_util.h" #include <stdio.h> @@ -317,18 +318,11 @@ enum { struct si_shader; -/* Per-thread persistent LLVM objects. */ -struct si_compiler { - LLVMTargetMachineRef tm; - LLVMTargetLibraryInfoRef target_library_info; - LLVMPassManagerRef passmgr; -}; - /* State of the context creating the shader object. */ struct si_compiler_ctx_state { /* Should only be used by si_init_shader_selector_async and * si_build_shader_variant if thread_index == -1 (non-threaded). */ - struct si_compiler *compiler; + struct ac_llvm_compiler *compiler; /* Used if thread_index == -1 or if debug.async is true. */ struct pipe_debug_callback debug; @@ -657,14 +651,14 @@ struct si_shader_part { /* si_shader.c */ struct si_shader * si_generate_gs_copy_shader(struct si_screen *sscreen, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct si_shader_selector *gs_selector, struct pipe_debug_callback *debug); int si_compile_tgsi_shader(struct si_screen *sscreen, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct si_shader *shader, struct pipe_debug_callback *debug); -int si_shader_create(struct si_screen *sscreen, struct si_compiler *compiler, +int si_shader_create(struct si_screen *sscreen, struct ac_llvm_compiler *compiler, struct si_shader *shader, struct pipe_debug_callback *debug); void si_shader_destroy(struct si_shader *shader); diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h index 5c275ab6d9f..21e325c2d82 100644 --- a/src/gallium/drivers/radeonsi/si_shader_internal.h +++ b/src/gallium/drivers/radeonsi/si_shader_internal.h @@ -174,7 +174,7 @@ struct si_shader_context { /* CS */ int param_block_size; - struct si_compiler *compiler; + struct ac_llvm_compiler *compiler; /* Preloaded descriptors. */ LLVMValueRef esgs_ring; @@ -216,7 +216,7 @@ si_shader_context_from_abi(struct ac_shader_abi *abi) } unsigned si_llvm_compile(LLVMModuleRef M, struct ac_shader_binary *binary, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct pipe_debug_callback *debug); LLVMTypeRef tgsi2llvmtype(struct lp_build_tgsi_context *bld_base, @@ -231,7 +231,7 @@ LLVMValueRef si_llvm_bound_index(struct si_shader_context *ctx, void si_llvm_context_init(struct si_shader_context *ctx, struct si_screen *sscreen, - struct si_compiler *compiler); + struct ac_llvm_compiler *compiler); void si_llvm_context_set_tgsi(struct si_shader_context *ctx, struct si_shader *shader); diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c index 2581d14e760..566d3a8eb6e 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c @@ -81,7 +81,7 @@ static void si_diagnostic_handler(LLVMDiagnosticInfoRef di, void *context) * @returns 0 for success, 1 for failure */ unsigned si_llvm_compile(LLVMModuleRef M, struct ac_shader_binary *binary, - struct si_compiler *compiler, + struct ac_llvm_compiler *compiler, struct pipe_debug_callback *debug) { struct si_llvm_diagnostics diag; @@ -972,7 +972,7 @@ static void emit_immediate(struct lp_build_tgsi_context *bld_base, void si_llvm_context_init(struct si_shader_context *ctx, struct si_screen *sscreen, - struct si_compiler *compiler) + struct ac_llvm_compiler *compiler) { struct lp_type type; diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index ddd38dabbe6..ffc8821df09 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -1509,7 +1509,7 @@ static void si_build_shader_variant(struct si_shader *shader, { struct si_shader_selector *sel = shader->selector; struct si_screen *sscreen = sel->screen; - struct si_compiler *compiler; + struct ac_llvm_compiler *compiler; struct pipe_debug_callback *debug = &shader->compiler_ctx_state.debug; int r; @@ -1856,7 +1856,7 @@ static void si_init_shader_selector_async(void *job, int thread_index) { struct si_shader_selector *sel = (struct si_shader_selector *)job; struct si_screen *sscreen = sel->screen; - struct si_compiler *compiler; + struct ac_llvm_compiler *compiler; struct pipe_debug_callback *debug = &sel->compiler_ctx_state.debug; assert(!debug->debug_message || debug->async); |