ir3/ra: Make sure we don't pick a preferred reg overflowing the file.
authorEmma Anholt <emma@anholt.net>
Wed, 9 Nov 2022 20:23:53 +0000 (12:23 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Nov 2022 19:37:50 +0000 (19:37 +0000)
commita39113b616099a7bcce9e62337731f040c7cad64
treedeb504ebe914c9bce9f61580e25c4205c9a9065c
parentecc2dfc503dcf62573fa539b49caa874f908c1cf
ir3/ra: Make sure we don't pick a preferred reg overflowing the file.

If we're in handle_collect()'s dst allocation and are part of a merge set
near the end of the file, our check for reg_elem_size(reg) would let us
use the preferred reg when that would immediately lead to
allocate_dst_fixed() creating an interval extending thruogh reg_size(reg)
that overflows the file.

Avoids a regression on gfxbench5/gl_5_high_off/17.shader_test in the next
commit.  No change on shader-db.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18946>
src/freedreno/ir3/ir3_ra.c