glsl/opt_algebraic: Drop the eq/neq add-removal optimization.
No change on freedreno or r300 shader-db. Acked-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
This commit is contained in:
@@ -449,39 +449,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ir_binop_equal:
|
|
||||||
case ir_binop_nequal:
|
|
||||||
for (int add_pos = 0; add_pos < 2; add_pos++) {
|
|
||||||
ir_expression *add = op_expr[add_pos];
|
|
||||||
|
|
||||||
if (!add || add->operation != ir_binop_add)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
ir_constant *zero = op_const[1 - add_pos];
|
|
||||||
if (!is_vec_zero(zero))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* We are allowed to add scalars with a vector or matrix. In that
|
|
||||||
* case lets just exit early.
|
|
||||||
*/
|
|
||||||
if (add->operands[0]->type != add->operands[1]->type)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* Depending of the zero position we want to optimize
|
|
||||||
* (0 cmp x+y) into (-x cmp y) or (x+y cmp 0) into (x cmp -y)
|
|
||||||
*/
|
|
||||||
if (add_pos == 1) {
|
|
||||||
return new(mem_ctx) ir_expression(ir->operation,
|
|
||||||
neg(add->operands[0]),
|
|
||||||
add->operands[1]);
|
|
||||||
} else {
|
|
||||||
return new(mem_ctx) ir_expression(ir->operation,
|
|
||||||
add->operands[0],
|
|
||||||
neg(add->operands[1]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ir_binop_min:
|
case ir_binop_min:
|
||||||
case ir_binop_max:
|
case ir_binop_max:
|
||||||
if (!ir->type->is_float())
|
if (!ir->type->is_float())
|
||||||
|
Reference in New Issue
Block a user