From 2f53188f18d3f81416c8a3e5f3f7909a3fbdaa31 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 22 Feb 2023 13:12:24 -0800 Subject: [PATCH] glsl: Remove unused as_rvalue_to_saturate(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is not where saturate recognition happens. Dead code since 5598458e6923 ("i965/vec4: Remove try_emit_saturate") in 2014! Acked-by: Timothy Arceri Reviewed-by: Marek Olšák Part-of: --- src/compiler/glsl/ir.cpp | 57 ---------------------------------------- src/compiler/glsl/ir.h | 2 -- 2 files changed, 59 deletions(-) diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp index 08b62ddfafb..1d65cbcf7ad 100644 --- a/src/compiler/glsl/ir.cpp +++ b/src/compiler/glsl/ir.cpp @@ -2291,63 +2291,6 @@ reparent_ir(exec_list *list, void *mem_ctx) } } - -static ir_rvalue * -try_min_one(ir_rvalue *ir) -{ - ir_expression *expr = ir->as_expression(); - - if (!expr || expr->operation != ir_binop_min) - return NULL; - - if (expr->operands[0]->is_one()) - return expr->operands[1]; - - if (expr->operands[1]->is_one()) - return expr->operands[0]; - - return NULL; -} - -static ir_rvalue * -try_max_zero(ir_rvalue *ir) -{ - ir_expression *expr = ir->as_expression(); - - if (!expr || expr->operation != ir_binop_max) - return NULL; - - if (expr->operands[0]->is_zero()) - return expr->operands[1]; - - if (expr->operands[1]->is_zero()) - return expr->operands[0]; - - return NULL; -} - -ir_rvalue * -ir_rvalue::as_rvalue_to_saturate() -{ - ir_expression *expr = this->as_expression(); - - if (!expr) - return NULL; - - ir_rvalue *max_zero = try_max_zero(expr); - if (max_zero) { - return try_min_one(max_zero); - } else { - ir_rvalue *min_one = try_min_one(expr); - if (min_one) { - return try_max_zero(min_one); - } - } - - return NULL; -} - - unsigned vertices_per_prim(GLenum prim) { diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h index 792f40cd072..c1c5f36d86b 100644 --- a/src/compiler/glsl/ir.h +++ b/src/compiler/glsl/ir.h @@ -230,8 +230,6 @@ public: virtual ir_constant *constant_expression_value(void *mem_ctx, struct hash_table *variable_context = NULL); - ir_rvalue *as_rvalue_to_saturate(); - virtual bool is_lvalue(const struct _mesa_glsl_parse_state * = NULL) const { return false;