diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index aaa93e7aea6..8a369b68b67 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -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) { diff --git a/src/freedreno/ir3/ir3_legalize.c b/src/freedreno/ir3/ir3_legalize.c index 3b1c8e67092..e4809922d9a 100644 --- a/src/freedreno/ir3/ir3_legalize.c +++ b/src/freedreno/ir3/ir3_legalize.c @@ -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;