Module: Mesa Branch: main Commit: eae36b4850b6642062d43a4b910c6fe34a4ba81d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=eae36b4850b6642062d43a4b910c6fe34a4ba81d
Author: Connor Abbott <[email protected]> Date: Fri Jul 23 11:50:46 2021 +0200 ir3/ra: Reinitialize interval when inserting Otherwise when an interval is removed and then re-inserted it could have an invalid/corrupted parent link and child tree. I think RA happened to never do this, but spilling will. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12033> --- src/freedreno/ir3/ir3_ra.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/freedreno/ir3/ir3_ra.c b/src/freedreno/ir3/ir3_ra.c index dd8d4adab2d..a30455ea277 100644 --- a/src/freedreno/ir3/ir3_ra.c +++ b/src/freedreno/ir3/ir3_ra.c @@ -175,6 +175,17 @@ void ir3_reg_interval_insert(struct ir3_reg_ctx *ctx, struct ir3_reg_interval *interval) { + rb_tree_init(&interval->children); + interval->parent = NULL; + interval_insert(ctx, &ctx->intervals, interval); +} + +/* Call after ir3_reg_interval_remove_temp() to reinsert the interval */ +static void +ir3_reg_interval_reinsert(struct ir3_reg_ctx *ctx, + struct ir3_reg_interval *interval) +{ + interval->parent = NULL; interval_insert(ctx, &ctx->intervals, interval); } @@ -669,7 +680,7 @@ ra_push_interval(struct ra_ctx *ctx, struct ra_file *file, interval->physreg_start = dst; interval->physreg_end = dst + removed->size; - ir3_reg_interval_insert(&file->reg_ctx, &interval->interval); + ir3_reg_interval_reinsert(&file->reg_ctx, &interval->interval); } /* Pick up the interval and place it at "dst". */
