From 081feabf9cffbd27dfbb041ddac8cef919f4a5cc Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 4 May 2026 15:10:37 +0100 Subject: [PATCH] nir/search: fix nir_algebraic_automaton after constant folding op(bcsel) Likely fixes https://gitlab.freedesktop.org/mesa/mesa/-/jobs/98917704 Signed-off-by: Rhys Perry Fixes: f4812dc11d4 ("nir/opt_constant_folding: constant-fold op(bcsel(), #c) -> bcsel(.., #c1, #c2)") Reviewed-by: Georg Lehmann Part-of: --- src/compiler/nir/nir_search.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c index bddfd7f365d..959b312cc34 100644 --- a/src/compiler/nir/nir_search.c +++ b/src/compiler/nir/nir_search.c @@ -447,9 +447,9 @@ construct_value(nir_builder *build, nir_alu_instr *bcsel = nir_def_as_alu(def); assert(bcsel->op == nir_op_bcsel); util_dynarray_append_typed(state->states, uint16_t, 0); - nir_algebraic_automaton(nir_src_parent_instr(&bcsel->src[1].src), state->states, state->pass_op_table); + nir_algebraic_automaton(nir_def_instr(bcsel->src[1].src.ssa), state->states, state->pass_op_table); util_dynarray_append_typed(state->states, uint16_t, 0); - nir_algebraic_automaton(nir_src_parent_instr(&bcsel->src[2].src), state->states, state->pass_op_table); + nir_algebraic_automaton(nir_def_instr(bcsel->src[2].src.ssa), state->states, state->pass_op_table); } } else { nir_builder_instr_insert(build, &alu->instr);