diff --git a/src/compiler/nir/nir_opt_constant_folding.c b/src/compiler/nir/nir_opt_constant_folding.c index 8526e175ce9..1884cf8ddbe 100644 --- a/src/compiler/nir/nir_opt_constant_folding.c +++ b/src/compiler/nir/nir_opt_constant_folding.c @@ -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;