From 2d94ca93b51a16cbfe50fee60515c27a571688f0 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 9 Dec 2024 16:09:23 +0000 Subject: [PATCH] nir/liveness: stop requiring instr indices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nir_live_defs_impl() doesn't actually use them, and every nir_metadata_require of nir_metadata_live_defs already requires them. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/compiler/nir/nir.h | 1 + src/compiler/nir/nir_liveness.c | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 7ebd867d2d0..a51f05c7528 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -6762,6 +6762,7 @@ void nir_loop_analyze_impl(nir_function_impl *impl, nir_variable_mode indirect_mask, bool force_unroll_sampler_indirect); +/* This requires both nir_metadata_live_defs and nir_metadata_instr_index. */ bool nir_defs_interfere(nir_def *a, nir_def *b); bool nir_repair_ssa_impl(nir_function_impl *impl); diff --git a/src/compiler/nir/nir_liveness.c b/src/compiler/nir/nir_liveness.c index 2202553dabc..70f885af1cb 100644 --- a/src/compiler/nir/nir_liveness.c +++ b/src/compiler/nir/nir_liveness.c @@ -134,11 +134,6 @@ nir_live_defs_impl(nir_function_impl *impl) }; state.tmp_live = rzalloc_array(impl, BITSET_WORD, state.bitset_words), - /* Number the instructions so we can do cheap interference tests using the - * instruction index. - */ - nir_metadata_require(impl, nir_metadata_instr_index); - nir_block_worklist_init(&state.worklist, impl->num_blocks, NULL); /* Allocate live_in and live_out sets and add all of the blocks to the