Merge branch 'review/const_fold-vs-lower_bit_size' into 'main'

nir/opt_constant_folding: Don't fight with nir_lower_bit_size

See merge request mesa/mesa!41412
This commit is contained in:
Ian Romanick 2026-05-08 00:12:57 +00:00
commit 2b5cfd3251

View file

@ -75,6 +75,10 @@ should_fold_bcsel(nir_alu_instr *alu)
if (alu->def.bit_size > 32)
return false;
/* Don't fight with nir_lower_bit_size. */
if (alu->op == nir_op_u2u8 || alu->op == nir_op_i2i8)
return false;
/* Don't fight with nir_lower_load_const_to_scalar. */
if (nir_op_is_vec_or_mov(alu->op))
return false;