summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_search.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-04-15 15:20:57 -0700
committerIan Romanick <[email protected]>2015-04-16 09:56:49 -0700
commit94aab6cde696ab1cd1243f5c62444166efb1a2fa (patch)
treee93f2ccacff004af0cf836fdfa62d1280b43db6a /src/glsl/nir/nir_search.c
parent61293bfcedcab450e1a6f3301152bda5f6e348ed (diff)
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 <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_search.c')
-rw-r--r--src/glsl/nir/nir_search.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/nir/nir_search.c b/src/glsl/nir/nir_search.c
index 73a802be705..5ba016085fc 100644
--- a/src/glsl/nir/nir_search.c
+++ b/src/glsl/nir/nir_search.c
@@ -218,8 +218,8 @@ match_expression(const nir_search_expression *expr, nir_alu_instr *instr,
if (matched)
return true;
- if (nir_op_infos[instr->op].num_inputs == 2 &&
- (nir_op_infos[instr->op].algebraic_properties & NIR_OP_IS_COMMUTATIVE)) {
+ if (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,
swizzle, state))
return false;