diff options
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3_depth.c')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_depth.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_depth.c b/src/gallium/drivers/freedreno/ir3/ir3_depth.c index 8ff62ba70a6..0cda62bf102 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_depth.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_depth.c @@ -102,7 +102,7 @@ static void insert_by_depth(struct ir3_instruction *instr) static void ir3_instr_depth(struct ir3_instruction *instr) { - unsigned i; + struct ir3_instruction *src; /* if we've already visited this instruction, bail now: */ if (ir3_instr_check_mark(instr)) @@ -110,19 +110,15 @@ static void ir3_instr_depth(struct ir3_instruction *instr) instr->depth = 0; - for (i = 1; i < instr->regs_count; i++) { - struct ir3_register *src = instr->regs[i]; - if (src->flags & IR3_REG_SSA) { - unsigned sd; + foreach_ssa_src_n(src, i, instr) { + unsigned sd; - /* visit child to compute it's depth: */ - ir3_instr_depth(src->instr); + /* visit child to compute it's depth: */ + ir3_instr_depth(src); - sd = ir3_delayslots(src->instr, instr, i-1) + - src->instr->depth; + sd = ir3_delayslots(src, instr, i) + src->depth; - instr->depth = MAX2(instr->depth, sd); - } + instr->depth = MAX2(instr->depth, sd); } /* meta-instructions don't add cycles, other than PHI.. which |