diff --git a/src/compiler/glsl/opt_algebraic.cpp b/src/compiler/glsl/opt_algebraic.cpp index 2d8f5cf3d10..e0987208062 100644 --- a/src/compiler/glsl/opt_algebraic.cpp +++ b/src/compiler/glsl/opt_algebraic.cpp @@ -322,18 +322,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) #undef HANDLE_PACK_UNPACK_INVERSE case ir_binop_add: - /* Replace (x + (-x)) with constant 0 */ - for (int i = 0; i < 2; i++) { - if (op_expr[i]) { - if (op_expr[i]->operation == ir_unop_neg) { - ir_rvalue *other = ir->operands[(i + 1) % 2]; - if (other && op_expr[i]->operands[0]->equals(other)) { - return ir_constant::zero(ir, ir->type); - } - } - } - } - /* Reassociate addition of constants so that we can do constant * folding. */