glsl/opt_algebraic: Drop no-op pack/unpack optimization.
No change on freedreno 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:
@@ -293,34 +293,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
||||
this->mem_ctx = ralloc_parent(ir);
|
||||
|
||||
switch (ir->operation) {
|
||||
/* This macro CANNOT use the do { } while(true) mechanism because
|
||||
* then the breaks apply to the loop instead of the switch!
|
||||
*/
|
||||
#define HANDLE_PACK_UNPACK_INVERSE(inverse_operation) \
|
||||
{ \
|
||||
ir_expression *const op = ir->operands[0]->as_expression(); \
|
||||
if (op == NULL) \
|
||||
break; \
|
||||
if (op->operation == (inverse_operation)) \
|
||||
return op->operands[0]; \
|
||||
break; \
|
||||
}
|
||||
|
||||
case ir_unop_unpack_uint_2x32:
|
||||
HANDLE_PACK_UNPACK_INVERSE(ir_unop_pack_uint_2x32);
|
||||
case ir_unop_pack_uint_2x32:
|
||||
HANDLE_PACK_UNPACK_INVERSE(ir_unop_unpack_uint_2x32);
|
||||
case ir_unop_unpack_int_2x32:
|
||||
HANDLE_PACK_UNPACK_INVERSE(ir_unop_pack_int_2x32);
|
||||
case ir_unop_pack_int_2x32:
|
||||
HANDLE_PACK_UNPACK_INVERSE(ir_unop_unpack_int_2x32);
|
||||
case ir_unop_unpack_double_2x32:
|
||||
HANDLE_PACK_UNPACK_INVERSE(ir_unop_pack_double_2x32);
|
||||
case ir_unop_pack_double_2x32:
|
||||
HANDLE_PACK_UNPACK_INVERSE(ir_unop_unpack_double_2x32);
|
||||
|
||||
#undef HANDLE_PACK_UNPACK_INVERSE
|
||||
|
||||
case ir_binop_add:
|
||||
/* Reassociate addition of constants so that we can do constant
|
||||
* folding.
|
||||
|
Reference in New Issue
Block a user