glsl: Remove unused as_rvalue_to_saturate().

This is not where saturate recognition happens.  Dead code since
5598458e69 ("i965/vec4: Remove try_emit_saturate") in 2014!

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:
Emma Anholt
2023-02-22 13:12:24 -08:00
committed by Marge Bot
parent d76fb3b2b1
commit 2f53188f18
2 changed files with 0 additions and 59 deletions

View File

@@ -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)
{

View File

@@ -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;