diff options
author | Daniel Schürmann <[email protected]> | 2020-04-14 12:15:56 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-22 18:23:23 +0000 |
commit | 5a3c1f4f0bfbcc9ea1900891435c28df73b5afa8 (patch) | |
tree | c69037b77a8a5be8c525b1431fff6fdbc2b8af69 /src/amd | |
parent | 2796cb4c2481c35b9510c03dad3a5ebe65a82d51 (diff) |
aco: stop get_reg_simple after reaching max_used_gpr
Reviewed-by: Rhys Perry <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4573>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/compiler/aco_register_allocation.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 11b54ba8339..9a36019ff37 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -408,10 +408,16 @@ std::pair<PhysReg, bool> get_reg_simple(ra_ctx& ctx, unsigned last_pos = 0xFFFF; for (unsigned current_reg = lb; current_reg < ub; current_reg++) { + if (reg_file[current_reg] == 0 && !ctx.war_hint[current_reg]) { if (last_pos == 0xFFFF) last_pos = current_reg; - continue; + + /* stop searching after max_used_gpr */ + if (current_reg == ctx.max_used_sgpr + 1 || current_reg == 256 + ctx.max_used_vgpr + 1) + break; + else + continue; } if (last_pos == 0xFFFF) |