Mesa (master): aco/ra: fix infinite recursion in get_reg_simple() with subdword registers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 12 16:23:58 UTC 2021


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

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Tue Jan 12 12:45:46 2021 +0100

aco/ra: fix infinite recursion in get_reg_simple() with subdword registers

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>

Fixes: f8c7661ecaa782fdde105a4bf756023eb88ea780 ('aco: try to better align 8+ dword SGPR vectors')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8425>

---

 src/amd/compiler/aco_register_allocation.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index 2fadcef4a72..45eaf3ad5c2 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -633,6 +633,7 @@ std::pair<PhysReg, bool> get_reg_simple(ra_ctx& ctx,
    RegClass rc = info.rc;
 
    DefInfo new_info = info;
+   new_info.rc = RegClass(rc.type(), size);
    for (unsigned new_stride = 16; new_stride > stride; new_stride /= 2) {
       if (size % new_stride)
          continue;
@@ -643,8 +644,6 @@ std::pair<PhysReg, bool> get_reg_simple(ra_ctx& ctx,
    }
 
    if (stride == 1) {
-      info.rc = RegClass(rc.type(), size);
-
       /* best fit algorithm: find the smallest gap to fit in the variable */
       unsigned best_pos = 0xFFFF;
       unsigned gap_size = 0xFFFF;



More information about the mesa-commit mailing list