From 9aad852af8a0c9889611b752a9918aba8f5dda5a Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 16 May 2025 16:54:27 +0100 Subject: [PATCH] nir/opt_offsets: report progress if NUW is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Reviewed-by: Faith Ekstrand Reviewed-by: Marek Olšák Part-of: --- src/compiler/nir/nir_opt_offsets.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_offsets.c b/src/compiler/nir/nir_opt_offsets.c index 7c5e7531e2d..a46ab402e4c 100644 --- a/src/compiler/nir/nir_opt_offsets.c +++ b/src/compiler/nir/nir_opt_offsets.c @@ -32,6 +32,7 @@ typedef struct { struct hash_table *range_ht; const nir_opt_offsets_options *options; + bool progress; } opt_offsets_state; static nir_scalar @@ -73,6 +74,7 @@ try_extract_const_addition(nir_builder *b, nir_scalar val, opt_offsets_state *st /* We proved that unsigned wrap won't be possible, so we can set the flag too. */ alu->no_unsigned_wrap = true; + state->progress = true; } for (unsigned i = 0; i < 2; ++i) { @@ -254,6 +256,7 @@ nir_opt_offsets(nir_shader *shader, const nir_opt_offsets_options *options) opt_offsets_state state; state.range_ht = NULL; state.options = options; + state.progress = false; bool p = nir_shader_instructions_pass(shader, process_instr, nir_metadata_control_flow, @@ -262,5 +265,5 @@ nir_opt_offsets(nir_shader *shader, const nir_opt_offsets_options *options) if (state.range_ht) _mesa_hash_table_destroy(state.range_ht, NULL); - return p; + return p || state.progress; }