nir: Convert the if-test for num_inputs == 2 to an assertion
Suggested by Jason on a different patch after some comments / questions by Ilia. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Connor Abbott <cwabott0@gmail.com>
This commit is contained in:
@@ -218,8 +218,8 @@ match_expression(const nir_search_expression *expr, nir_alu_instr *instr,
|
|||||||
if (matched)
|
if (matched)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (nir_op_infos[instr->op].num_inputs == 2 &&
|
if (nir_op_infos[instr->op].algebraic_properties & NIR_OP_IS_COMMUTATIVE) {
|
||||||
(nir_op_infos[instr->op].algebraic_properties & NIR_OP_IS_COMMUTATIVE)) {
|
assert(nir_op_infos[instr->op].num_inputs == 2);
|
||||||
if (!match_value(expr->srcs[0], instr, 1, num_components,
|
if (!match_value(expr->srcs[0], instr, 1, num_components,
|
||||||
swizzle, state))
|
swizzle, state))
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user