Mesa (master): freedreno/ir3/ra: move regs_count==0 check
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Nov 9 03:07:48 UTC 2019
Module: Mesa
Branch: master
Commit: 8b92052f1092048306cb85abb29599918ac33bd7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8b92052f1092048306cb85abb29599918ac33bd7
Author: Rob Clark <robdclark at chromium.org>
Date: Wed Oct 23 09:50:22 2019 -0700
freedreno/ir3/ra: move regs_count==0 check
Fold it in to writes_gpr() (since a register that does not reference any
registers by definition does not write a register). This lets us avoid
having to handle this case in a few other places.
Signed-off-by: Rob Clark <robdclark at chromium.org>
---
src/freedreno/ir3/ir3_ra.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/src/freedreno/ir3/ir3_ra.c b/src/freedreno/ir3/ir3_ra.c
index 100ce422354..2f312a5ff15 100644
--- a/src/freedreno/ir3/ir3_ra.c
+++ b/src/freedreno/ir3/ir3_ra.c
@@ -388,6 +388,8 @@ writes_gpr(struct ir3_instruction *instr)
{
if (is_store(instr))
return false;
+ if (instr->regs_count == 0)
+ return false;
/* is dest a normal temp register: */
struct ir3_register *reg = instr->regs[0];
if (reg->flags & (IR3_REG_CONST | IR3_REG_IMMED))
@@ -586,9 +588,6 @@ ra_block_name_instructions(struct ir3_ra_ctx *ctx, struct ir3_block *block)
ctx->instr_cnt++;
- if (instr->regs_count == 0)
- continue;
-
if (!writes_gpr(instr))
continue;
@@ -706,9 +705,6 @@ ra_block_compute_live_ranges(struct ir3_ra_ctx *ctx, struct ir3_block *block)
struct ir3_instruction *src;
struct ir3_register *reg;
- if (instr->regs_count == 0)
- continue;
-
/* There are a couple special cases to deal with here:
*
* fanout: used to split values from a higher class to a lower
@@ -1069,9 +1065,6 @@ ra_block_alloc(struct ir3_ra_ctx *ctx, struct ir3_block *block)
list_for_each_entry (struct ir3_instruction, instr, &block->instr_list, node) {
struct ir3_register *reg;
- if (instr->regs_count == 0)
- continue;
-
if (writes_gpr(instr)) {
reg_assign(ctx, instr->regs[0], instr);
if (instr->regs[0]->flags & IR3_REG_HALF)
More information about the mesa-commit
mailing list