intel/compiler: Use unreachable instead of assert(!"...")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34014>
This commit is contained in:
Matt Turner 2025-03-11 15:53:42 -04:00 committed by Marge Bot
parent 8d6deb4073
commit 0a63d629fe
9 changed files with 13 additions and 17 deletions

View file

@ -1608,8 +1608,7 @@ brw_find_loop_end(struct brw_codegen *p, int start_offset)
return offset;
}
}
assert(!"not reached");
return start_offset;
unreachable("not reached");
}
/* After program generation, go back and update the UIP and JIP of

View file

@ -991,8 +991,7 @@ lower_bit_size_callback(const nir_instr *instr, UNUSED void *data)
case nir_op_fcos:
return 0;
case nir_op_isign:
assert(!"Should have been lowered by nir_opt_algebraic.");
return 0;
unreachable("Should have been lowered by nir_opt_algebraic.");
default:
if (nir_op_infos[alu->op].num_inputs >= 2 &&
alu->def.bit_size == 8)

View file

@ -419,7 +419,7 @@ brw_opt_algebraic(brw_shader &s)
if (inst->dst.type != inst->src[0].type &&
inst->dst.type != BRW_TYPE_DF &&
inst->src[0].type != BRW_TYPE_F)
assert(!"unimplemented: saturate mixed types");
unreachable("unimplemented: saturate mixed types");
if (brw_reg_saturate_immediate(&inst->src[0])) {
inst->saturate = false;

View file

@ -103,7 +103,7 @@ brw_reg_negate_immediate(brw_reg *reg)
unreachable("no UB/B immediates");
case BRW_TYPE_UV:
case BRW_TYPE_V:
assert(!"unimplemented: negate UV/V immediate");
unreachable("unimplemented: negate UV/V immediate");
case BRW_TYPE_HF:
reg->ud ^= 0x80008000;
return true;
@ -148,9 +148,9 @@ brw_reg_abs_immediate(brw_reg *reg)
/* Presumably the absolute value modifier on an unsigned source is a
* nop, but it would be nice to confirm.
*/
assert(!"unimplemented: abs unsigned immediate");
unreachable("unimplemented: abs unsigned immediate");
case BRW_TYPE_V:
assert(!"unimplemented: abs V immediate");
unreachable("unimplemented: abs V immediate");
case BRW_TYPE_HF:
reg->ud &= ~0x80008000;
return true;

View file

@ -2578,8 +2578,7 @@ elk_find_loop_end(struct elk_codegen *p, int start_offset)
return offset;
}
}
assert(!"not reached");
return start_offset;
unreachable("not reached");
}
/* After program generation, go back and update the UIP and JIP of

View file

@ -2228,7 +2228,7 @@ elk_fs_visitor::opt_algebraic()
if (inst->dst.type != inst->src[0].type &&
inst->dst.type != ELK_REGISTER_TYPE_DF &&
inst->src[0].type != ELK_REGISTER_TYPE_F)
assert(!"unimplemented: saturate mixed types");
unreachable("unimplemented: saturate mixed types");
if (elk_saturate_immediate(inst->src[0].type,
&inst->src[0].as_elk_reg())) {

View file

@ -781,8 +781,7 @@ lower_bit_size_callback(const nir_instr *instr, UNUSED void *data)
case nir_op_fcos:
return 32;
case nir_op_isign:
assert(!"Should have been lowered by nir_opt_algebraic.");
return 0;
unreachable("Should have been lowered by nir_opt_algebraic.");
default:
if (nir_op_infos[alu->op].num_inputs >= 2 &&
alu->def.bit_size == 8)

View file

@ -615,7 +615,7 @@ elk_negate_immediate(enum elk_reg_type type, struct elk_reg *reg)
unreachable("no UB/B immediates");
case ELK_REGISTER_TYPE_UV:
case ELK_REGISTER_TYPE_V:
assert(!"unimplemented: negate UV/V immediate");
unreachable("unimplemented: negate UV/V immediate");
case ELK_REGISTER_TYPE_HF:
reg->ud ^= 0x80008000;
return true;
@ -660,9 +660,9 @@ elk_abs_immediate(enum elk_reg_type type, struct elk_reg *reg)
/* Presumably the absolute value modifier on an unsigned source is a
* nop, but it would be nice to confirm.
*/
assert(!"unimplemented: abs unsigned immediate");
unreachable("unimplemented: abs unsigned immediate");
case ELK_REGISTER_TYPE_V:
assert(!"unimplemented: abs V immediate");
unreachable("unimplemented: abs V immediate");
case ELK_REGISTER_TYPE_HF:
reg->ud &= ~0x80008000;
return true;

View file

@ -648,7 +648,7 @@ vec4_visitor::opt_algebraic()
if (inst->dst.type != inst->src[0].type &&
inst->dst.type != ELK_REGISTER_TYPE_DF &&
inst->src[0].type != ELK_REGISTER_TYPE_F)
assert(!"unimplemented: saturate mixed types");
unreachable("unimplemented: saturate mixed types");
if (elk_saturate_immediate(inst->src[0].type,
&inst->src[0].as_elk_reg())) {