Cuts an instruction from two shaders in Tesseract, by allowing the
(x+y) cmp 0 -> x cmp -y optimization to take place.
instructions in affected programs: 1198 -> 1194 (-0.33%)
Reviewed-by: Eric Anholt <eric@anholt.net>
}
break;
+ case ir_binop_all_equal:
+ case ir_binop_any_nequal:
+ if (ir->operands[0]->type->is_scalar() &&
+ ir->operands[1]->type->is_scalar())
+ return new(mem_ctx) ir_expression(ir->operation == ir_binop_all_equal
+ ? ir_binop_equal : ir_binop_nequal,
+ ir->operands[0],
+ ir->operands[1]);
+ break;
+
case ir_binop_rshift:
case ir_binop_lshift:
/* 0 >> x == 0 */