aco/ra: Update register use bounds before recursing in get_regs_for_copies

Delaying the call to adjust_max_used_regs until after get_regs_for_copies
returns puts the RA context into a state where registers past max_used_gpr
may be blocked. This isn't an issue on its own, but it adds a surprising
corner case to get_reg_simple that is easily avoided now.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7799>
This commit is contained in:
Tony Wasserka 2020-11-30 12:40:02 +01:00 committed by Marge Bot
parent 288032a873
commit 67c1f32228
1 changed files with 1 additions and 2 deletions

View File

@ -945,12 +945,11 @@ bool get_regs_for_copies(ra_ctx& ctx,
/* mark the area as blocked */
reg_file.block(PhysReg{reg_lo}, var.rc);
adjust_max_used_regs(ctx, var.rc, reg_lo);
if (!get_regs_for_copies(ctx, reg_file, parallelcopies, new_vars, lb, ub, instr, def_reg_lo, def_reg_hi))
return false;
adjust_max_used_regs(ctx, var.rc, reg_lo);
/* create parallelcopy pair (without definition id) */
Temp tmp = Temp(id, var.rc);
Operand pc_op = Operand(tmp);