ir3: merge is_reg_gpr and reg_gpr

These two helpers were basically doing the same thing so no point in
having them both around.

Signed-off-by: Job Noorman <job@noorman.info>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32000>
This commit is contained in:
Job Noorman 2024-11-06 10:15:13 +01:00 committed by Marge Bot
parent b196e1c3c2
commit dc47ecc9ac
2 changed files with 5 additions and 14 deletions

View file

@ -1409,7 +1409,9 @@ dest_regs(struct ir3_instruction *instr)
static inline bool
is_reg_gpr(const struct ir3_register *reg)
{
if ((reg_num(reg) == REG_A0) || (reg->flags & IR3_REG_PREDICATE))
if (reg->flags & (IR3_REG_CONST | IR3_REG_IMMED | IR3_REG_PREDICATE))
return false;
if (reg_num(reg) == REG_A0)
return false;
if (!(reg->flags & (IR3_REG_SSA | IR3_REG_RELATIV)) &&
reg->num == INVALID_REG)
@ -1535,16 +1537,6 @@ conflicts(struct ir3_register *a, struct ir3_register *b)
return (a && b) && (a->def != b->def);
}
static inline bool
reg_gpr(struct ir3_register *r)
{
if (r->flags & (IR3_REG_CONST | IR3_REG_IMMED | IR3_REG_PREDICATE))
return false;
if (reg_num(r) == REG_A0)
return false;
return true;
}
static inline bool
reg_is_addr1(struct ir3_register *r)
{

View file

@ -466,7 +466,7 @@ legalize_block(struct ir3_legalize_ctx *ctx, struct ir3_block *block)
else
reg = n->srcs[i - n->dsts_count];
if (reg_gpr(reg)) {
if (is_reg_gpr(reg)) {
/* TODO: we probably only need (ss) for alu
* instr consuming sfu result.. need to make
@ -1721,8 +1721,7 @@ ir3_legalize(struct ir3 *ir, struct ir3_shader_variant *so, int *max_bary)
foreach_src (reg, instr) {
if (in_preamble) {
if (!(reg->flags & (IR3_REG_IMMED | IR3_REG_CONST | IR3_REG_SHARED)) &&
is_reg_gpr(reg))
if (!(reg->flags & IR3_REG_SHARED) && is_reg_gpr(reg))
gpr_in_preamble = true;
if (reg->flags & IR3_REG_RELATIV)
relative_in_preamble = true;