diff options
author | Rob Clark <[email protected]> | 2018-02-04 12:52:24 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-02-10 14:54:58 -0500 |
commit | 2a2099a875568f2d979f0030aa6291ed88366046 (patch) | |
tree | 97a6619aae37b5dec8eeb4442a635da69fe5eb54 /src | |
parent | ffb00f6841768e842a010f895b52314e1eeb5828 (diff) |
freedreno/ir3: "boost" the depth of if/else condition
Account for the move to predicate register, to try to avoid needing to
insert extra NOPs later.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_depth.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_depth.c b/src/gallium/drivers/freedreno/ir3/ir3_depth.c index b58bf8ff3ae..270d53dbed7 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_depth.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_depth.c @@ -133,7 +133,7 @@ ir3_insert_by_depth(struct ir3_instruction *instr, struct list_head *list) } static void -ir3_instr_depth(struct ir3_instruction *instr) +ir3_instr_depth(struct ir3_instruction *instr, unsigned boost) { struct ir3_instruction *src; @@ -147,13 +147,14 @@ ir3_instr_depth(struct ir3_instruction *instr) unsigned sd; /* visit child to compute it's depth: */ - ir3_instr_depth(src); + ir3_instr_depth(src, boost); /* for array writes, no need to delay on previous write: */ if (i == 0) continue; sd = ir3_delayslots(src, instr, i) + src->depth; + sd += boost; instr->depth = MAX2(instr->depth, sd); } @@ -189,15 +190,15 @@ ir3_depth(struct ir3 *ir) ir3_clear_mark(ir); for (i = 0; i < ir->noutputs; i++) if (ir->outputs[i]) - ir3_instr_depth(ir->outputs[i]); + ir3_instr_depth(ir->outputs[i], 0); list_for_each_entry (struct ir3_block, block, &ir->block_list, node) { for (i = 0; i < block->keeps_count; i++) - ir3_instr_depth(block->keeps[i]); + ir3_instr_depth(block->keeps[i], 0); /* We also need to account for if-condition: */ if (block->condition) - ir3_instr_depth(block->condition); + ir3_instr_depth(block->condition, 6); } /* mark un-used instructions: */ |