From cccb3ecc6aa3ccec76261c065aa0fab74fb23462 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Tue, 19 Aug 2025 08:35:38 +0200 Subject: [PATCH] ir3/opt_predicates: move some helpers up We'll need them earlier in the next commit. Signed-off-by: Job Noorman Part-of: --- src/freedreno/ir3/ir3_opt_predicates.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/freedreno/ir3/ir3_opt_predicates.c b/src/freedreno/ir3/ir3_opt_predicates.c index 934480a1a65..976a3d19374 100644 --- a/src/freedreno/ir3/ir3_opt_predicates.c +++ b/src/freedreno/ir3/ir3_opt_predicates.c @@ -30,6 +30,19 @@ struct opt_predicates_ctx { struct hash_table *predicate_clones; }; +static bool +is_shared_or_const(struct ir3_register *reg) +{ + return reg->flags & (IR3_REG_CONST | IR3_REG_SHARED); +} + +static bool +cat2_needs_scalar_alu(struct ir3_instruction *instr) +{ + return is_shared_or_const(instr->srcs[0]) && + (instr->srcs_count == 1 || is_shared_or_const(instr->srcs[1])); +} + static struct ir3_instruction * clone_with_predicate_dst(struct opt_predicates_ctx *ctx, struct ir3_instruction *instr) @@ -49,19 +62,6 @@ clone_with_predicate_dst(struct opt_predicates_ctx *ctx, return clone; } -static bool -is_shared_or_const(struct ir3_register *reg) -{ - return reg->flags & (IR3_REG_CONST | IR3_REG_SHARED); -} - -static bool -cat2_needs_scalar_alu(struct ir3_instruction *instr) -{ - return is_shared_or_const(instr->srcs[0]) && - (instr->srcs_count == 1 || is_shared_or_const(instr->srcs[1])); -} - static bool can_write_predicate(struct opt_predicates_ctx *ctx, struct ir3_instruction *instr)