summaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-10-23 09:50:22 -0700
committerRob Clark <[email protected]>2019-11-09 02:49:15 +0000
commit8b92052f1092048306cb85abb29599918ac33bd7 (patch)
tree230c65a8942ca5e8cf6aff77e0de80922ca5e29b /src/freedreno
parentbd21c73d3f55332c097841eab42b570709feab13 (diff)
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 <[email protected]>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/ir3/ir3_ra.c11
1 files 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)