Module: Mesa
Branch: master
Commit: d99d358389ca95ce23cfccf67150cccc66ff6407
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d99d358389ca95ce23cfccf67150cccc66ff6407

Author: Rob Clark <[email protected]>
Date:   Sat Mar 21 11:07:35 2020 -0700

freedreno/ir3/ra: fix target register calculation

Account for the # of regs an instruction writes, and fix an off-by-one.

(We are about to replace this with calculating the register target using
the live-ranges, but in debugging that it was useful to assert() if it
chose a higher target.)

Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4272>

---

 src/freedreno/ir3/ir3_ra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/freedreno/ir3/ir3_ra.c b/src/freedreno/ir3/ir3_ra.c
index b6c9b686b5e..df5f115c0b3 100644
--- a/src/freedreno/ir3/ir3_ra.c
+++ b/src/freedreno/ir3/ir3_ra.c
@@ -1036,7 +1036,7 @@ account_assignment(struct ir3_ra_ctx *ctx, struct 
ir3_instruction *instr)
        } else if ((id = &ctx->instrd[instr->ip]) && id->defn) {
                unsigned name = scalar_name(ctx, id->defn, 0);
                unsigned r = ra_get_node_reg(ctx->g, name);
-               max = ctx->set->ra_reg_to_gpr[r] + id->off;
+               max = ctx->set->ra_reg_to_gpr[r] + id->off + 
dest_regs(id->defn);
        } else {
                return;
        }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to