diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 2557559b5c0..247219ee1c0 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -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);