mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 22:00:13 +01:00
glsl: Optimize (f2i(trunc x)) into (f2i x).
total instructions in shared programs: 5950326 -> 5949286 (-0.02%) instructions in affected programs: 88264 -> 87224 (-1.18%) helped: 692
This commit is contained in:
parent
c262b2b582
commit
69ad5fd4ce
1 changed files with 9 additions and 0 deletions
|
|
@ -376,6 +376,15 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ir_unop_f2i:
|
||||||
|
case ir_unop_f2u:
|
||||||
|
if (op_expr[0] && op_expr[0]->operation == ir_unop_trunc) {
|
||||||
|
return new(mem_ctx) ir_expression(ir->operation,
|
||||||
|
ir->type,
|
||||||
|
op_expr[0]->operands[0]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case ir_unop_logic_not: {
|
case ir_unop_logic_not: {
|
||||||
enum ir_expression_operation new_op = ir_unop_logic_not;
|
enum ir_expression_operation new_op = ir_unop_logic_not;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue