radeonsi: selectively build llvm compile

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>
This commit is contained in:
Qiang Yu 2023-09-04 15:14:19 +08:00
parent a5fc880495
commit 18e19a53e9

View file

@ -2509,9 +2509,12 @@ si_nir_generate_gs_copy_shader(struct si_screen *sscreen,
nir_print_shader(nir, stderr);
}
bool ok = sscreen->use_aco ?
si_aco_compile_shader(shader, &args, nir, debug) :
si_llvm_compile_shader(sscreen, compiler, shader, &args, debug, nir);
bool ok =
#ifdef LLVM_AVAILABLE
!sscreen->use_aco ? si_llvm_compile_shader(sscreen, compiler, shader, &args, debug, nir) :
#endif
si_aco_compile_shader(shader, &args, nir, debug);
if (ok) {
assert(!shader->config.scratch_bytes_per_wave);
@ -2764,9 +2767,12 @@ bool si_compile_shader(struct si_screen *sscreen, struct ac_llvm_compiler *compi
FLOAT_CONTROLS_DENORM_FLUSH_TO_ZERO_FP64))
float_mode &= ~V_00B028_FP_16_64_DENORMS;
ret = sscreen->use_aco ?
si_aco_compile_shader(shader, &args, nir, debug) :
si_llvm_compile_shader(sscreen, compiler, shader, &args, debug, nir);
ret =
#ifdef LLVM_AVAILABLE
!sscreen->use_aco ? si_llvm_compile_shader(sscreen, compiler, shader, &args, debug, nir) :
#endif
si_aco_compile_shader(shader, &args, nir, debug);
if (!ret)
goto out;
@ -2927,9 +2933,11 @@ si_get_shader_part(struct si_screen *sscreen, struct si_shader_part **list,
result = CALLOC_STRUCT(si_shader_part);
result->key = *key;
bool ok = sscreen->use_aco ?
si_aco_build_shader_part(sscreen, stage, prolog, debug, name, result) :
si_llvm_build_shader_part(sscreen, stage, prolog, compiler, debug, name, result);
bool ok =
#ifdef LLVM_AVAILABLE
!sscreen->use_aco ? si_llvm_build_shader_part(sscreen, stage, prolog, compiler, debug, name, result) :
#endif
si_aco_build_shader_part(sscreen, stage, prolog, debug, name, result);
if (ok) {
result->next = *list;