Module: Mesa
Branch: main
Commit: a5fc8804957b78679e6ae563bc31e9e15cff4ac5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5fc8804957b78679e6ae563bc31e9e15cff4ac5

Author: Qiang Yu <[email protected]>
Date:   Mon Sep  4 15:04:01 2023 +0800

radeonsi: selectively build si llvm compiler create/destroy

Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Qiang Yu <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25632>

---

 src/gallium/drivers/radeonsi/si_pipe.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c 
b/src/gallium/drivers/radeonsi/si_pipe.c
index 3218f54d2b3..8824bf29dd9 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -135,6 +135,7 @@ static const struct debug_named_value test_options[] = {
 
 struct ac_llvm_compiler *si_create_llvm_compiler(struct si_screen *sscreen)
 {
+#ifdef LLVM_AVAILABLE
    struct ac_llvm_compiler *compiler = CALLOC_STRUCT(ac_llvm_compiler);
    if (!compiler)
       return NULL;
@@ -156,6 +157,9 @@ struct ac_llvm_compiler *si_create_llvm_compiler(struct 
si_screen *sscreen)
       compiler->low_opt_passes = ac_create_llvm_passes(compiler->low_opt_tm);
 
    return compiler;
+#else
+   return NULL;
+#endif
 }
 
 void si_init_aux_async_compute_ctx(struct si_screen *sscreen)
@@ -175,8 +179,10 @@ void si_init_aux_async_compute_ctx(struct si_screen 
*sscreen)
 
 static void si_destroy_llvm_compiler(struct ac_llvm_compiler *compiler)
 {
+#ifdef LLVM_AVAILABLE
    ac_destroy_llvm_compiler(compiler);
    FREE(compiler);
+#endif
 }
 
 

Reply via email to