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

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

Fixes: f8c7661eca ('aco: try to better align 8+ dword SGPR vectors')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8425>
This commit is contained in:
Daniel Schürmann 2021-01-12 12:45:46 +01:00 committed by Marge Bot
parent 7b669ff789
commit 00cf077c15
1 changed files with 1 additions and 2 deletions

View File

@ -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;