From bf48eae1f983d927618d1ff6da6dc9563da57952 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 4 Feb 2025 13:09:34 -0500 Subject: [PATCH] nir: drop printf_base_identifier superseded. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Lionel Landwerlin Part-of: --- src/compiler/nir/nir.h | 1 - src/compiler/nir/nir_divergence_analysis.c | 1 - src/compiler/nir/nir_intrinsics.py | 4 ---- src/compiler/nir/nir_lower_printf.c | 6 +----- src/gallium/frontends/rusticl/core/kernel.rs | 1 - src/intel/compiler/intel_nir_lower_printf.c | 6 ------ 6 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index af9dcdd33b5..ab848ccca77 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -6864,7 +6864,6 @@ bool nir_lower_helper_writes(nir_shader *shader, bool lower_plain_stores); typedef struct nir_lower_printf_options { unsigned max_buffer_size; unsigned ptr_bit_size; - bool use_printf_base_identifier; bool hash_format_strings; } nir_lower_printf_options; diff --git a/src/compiler/nir/nir_divergence_analysis.c b/src/compiler/nir/nir_divergence_analysis.c index 3155b0594a1..66ad5679bad 100644 --- a/src/compiler/nir/nir_divergence_analysis.c +++ b/src/compiler/nir/nir_divergence_analysis.c @@ -348,7 +348,6 @@ visit_intrinsic(nir_intrinsic_instr *instr, struct divergence_state *state) case nir_intrinsic_load_polygon_stipple_buffer_amd: case nir_intrinsic_load_printf_buffer_address: case nir_intrinsic_load_printf_buffer_size: - case nir_intrinsic_load_printf_base_identifier: case nir_intrinsic_load_core_id_agx: case nir_intrinsic_load_samples_log2_agx: case nir_intrinsic_load_active_subgroup_count_agx: diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index d53d123ddbf..bea25d30321 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -1285,10 +1285,6 @@ intrinsic("printf", src_comp=[1, 1], dest_comp=1, bit_sizes=[32]) # the driver to at least provide a base location and size system_value("printf_buffer_address", 1, bit_sizes=[32,64]) system_value("printf_buffer_size", 1, bit_sizes=[32]) -# If driver wants to have all printfs from various shaders merged into a -# single output buffer, it needs each shader to have its own base identifier -# from which each printf is indexed. -system_value("printf_base_identifier", 1, bit_sizes=[32]) # Abort the program, triggering device fault. The invoking thread halts # immediately. Other threads eventually terminate. # diff --git a/src/compiler/nir/nir_lower_printf.c b/src/compiler/nir/nir_lower_printf.c index a12fbc7b556..4212ce81a7a 100644 --- a/src/compiler/nir/nir_lower_printf.c +++ b/src/compiler/nir/nir_lower_printf.c @@ -69,11 +69,7 @@ lower_printf_intrin(nir_builder *b, nir_intrinsic_instr *prntf, void *_options) } nir_def *fmt_str_id = prntf->src[0].ssa; - if (options->use_printf_base_identifier) { - fmt_str_id = nir_iadd(b, - nir_load_printf_base_identifier(b), - fmt_str_id); - } else if (options->hash_format_strings) { + if (options->hash_format_strings) { /* Rather than store the index of the format string, instead store the * hash of the format string itself. This is invariant across shaders * which may be more convenient. diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index 660b69d4deb..b9d76186f43 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -669,7 +669,6 @@ fn compile_nir_to_args( let printf_opts = nir_lower_printf_options { ptr_bit_size: 0, - use_printf_base_identifier: false, hash_format_strings: false, max_buffer_size: dev.printf_buffer_size() as u32, }; diff --git a/src/intel/compiler/intel_nir_lower_printf.c b/src/intel/compiler/intel_nir_lower_printf.c index 0e083eea958..41b748320e8 100644 --- a/src/intel/compiler/intel_nir_lower_printf.c +++ b/src/intel/compiler/intel_nir_lower_printf.c @@ -40,12 +40,6 @@ lower_printf_intrinsics(nir_builder *b, nir_intrinsic_instr *intrin, void *_) nir_load_reloc_const_intel(b, BRW_SHADER_RELOC_PRINTF_BUFFER_ADDR_HIGH))); return true; - case nir_intrinsic_load_printf_base_identifier: - nir_def_replace( - &intrin->def, - nir_load_reloc_const_intel(b, BRW_SHADER_RELOC_PRINTF_BASE_IDENTIFIER)); - return true; - case nir_intrinsic_load_printf_buffer_size: nir_def_replace( &intrin->def,