From 8f64415af722fc37fe994a55b7268df5ddbdb7b8 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Fri, 9 Jun 2023 19:55:49 -0700 Subject: [PATCH] nir/print: Make NIR_DEBUG=print_consts behavior the default Now there's a NIR_DEBUG=print_no_inline_consts to omit them. Reviewed-by: Jesse Natalie Acked-by: Emma Anholt Part-of: --- src/compiler/nir/nir.c | 4 ++-- src/compiler/nir/nir.h | 2 +- src/compiler/nir/nir_print.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 8a5fe2f..10f1709 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -85,8 +85,8 @@ static const struct debug_named_value nir_debug_control[] = { "Dump resulting callable shader after each successful lowering/optimization call" }, { "print_ks", NIR_DEBUG_PRINT_KS, "Dump resulting kernel shader after each successful lowering/optimization call" }, - { "print_consts", NIR_DEBUG_PRINT_CONSTS, - "Print const value near each use of const SSA variable" }, + { "print_no_inline_consts", NIR_DEBUG_PRINT_NO_INLINE_CONSTS, + "Do not print const value near each use of const SSA variable" }, { "print_internal", NIR_DEBUG_PRINT_INTERNAL, "Print shaders even if they are marked as internal" }, DEBUG_NAMED_VALUE_END diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 4e3a8a4..ac522e7 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -87,7 +87,7 @@ extern bool nir_debug_print_shader[MESA_SHADER_KERNEL + 1]; #define NIR_DEBUG_PRINT_IS (1u << 17) #define NIR_DEBUG_PRINT_CBS (1u << 18) #define NIR_DEBUG_PRINT_KS (1u << 19) -#define NIR_DEBUG_PRINT_CONSTS (1u << 20) +#define NIR_DEBUG_PRINT_NO_INLINE_CONSTS (1u << 20) #define NIR_DEBUG_PRINT_INTERNAL (1u << 21) #define NIR_DEBUG_PRINT (NIR_DEBUG_PRINT_VS | \ diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index c4b6029..db40197 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -234,7 +234,7 @@ print_ssa_use(nir_ssa_def *def, print_state *state) FILE *fp = state->fp; fprintf(fp, "ssa_%u", def->index); nir_instr *instr = def->parent_instr; - if (instr->type == nir_instr_type_load_const && NIR_DEBUG(PRINT_CONSTS)) { + if (instr->type == nir_instr_type_load_const && !NIR_DEBUG(PRINT_NO_INLINE_CONSTS)) { fprintf(fp, " "); print_const_from_load(nir_instr_as_load_const(instr), state, true); } @@ -1780,7 +1780,7 @@ print_function_impl(nir_function_impl *impl, print_state *state) fprintf(fp, "\tpreamble %s\n", impl->preamble->name); } - if (NIR_DEBUG(PRINT_CONSTS)) { + if (!NIR_DEBUG(PRINT_NO_INLINE_CONSTS)) { /* Don't reindex the SSA as suggested by nir_gather_ssa_types() because * nir_print don't modify the shader. If needed, a limit for ssa_alloc * can be added. -- 2.7.4