From a5d360550ee98acbd2977222152258ca05a464ff Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 2 Feb 2023 11:43:23 -0800 Subject: [PATCH] gallivm: Enable GALLIVM_DEBUG (mostly) on non-DEBUG builds. This is what let me do the performance work in my recent gallivm MRs. Reviewed-by: Roland Scheidegger Reviewed-by: Dave Airlie Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_debug.h | 4 ---- src/gallium/auxiliary/gallivm/lp_bld_init.c | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.h b/src/gallium/auxiliary/gallivm/lp_bld_debug.h index a5dd7b80dcc..291e6d5a731 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.h @@ -56,11 +56,7 @@ extern "C" { extern unsigned gallivm_perf; -#ifdef DEBUG extern unsigned gallivm_debug; -#else -#define gallivm_debug 0 -#endif static inline void diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index 1782f9dd189..dc391652a5c 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -67,7 +67,6 @@ static const struct debug_named_value lp_bld_perf_flags[] = { DEBUG_NAMED_VALUE_END }; -#ifdef DEBUG unsigned gallivm_debug = 0; static const struct debug_named_value lp_bld_debug_flags[] = { @@ -76,12 +75,14 @@ static const struct debug_named_value lp_bld_debug_flags[] = { { "asm", GALLIVM_DEBUG_ASM, NULL }, { "perf", GALLIVM_DEBUG_PERF, NULL }, { "gc", GALLIVM_DEBUG_GC, NULL }, +/* Don't allow setting DUMP_BC for release builds, since writing the files may be an issue with setuid. */ +#ifdef DEBUG { "dumpbc", GALLIVM_DEBUG_DUMP_BC, NULL }, +#endif DEBUG_NAMED_VALUE_END }; DEBUG_GET_ONCE_FLAGS_OPTION(gallivm_debug, "GALLIVM_DEBUG", lp_bld_debug_flags, 0) -#endif static boolean gallivm_initialized = FALSE; @@ -433,9 +434,7 @@ lp_build_init(void) */ LLVMLinkInMCJIT(); -#ifdef DEBUG gallivm_debug = debug_get_option_gallivm_debug(); -#endif gallivm_perf = debug_get_flags_option("GALLIVM_PERF", lp_bld_perf_flags, 0 );