From 00cf077c15682e954fd9dea7f8261fcbd0638ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 12 Jan 2021 12:45:46 +0100 Subject: [PATCH] aco/ra: fix infinite recursion in get_reg_simple() with subdword registers Reviewed-by: Rhys Perry Fixes: f8c7661ecaa782fdde105a4bf756023eb88ea780 ('aco: try to better align 8+ dword SGPR vectors') Part-of: --- 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 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 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;