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)
committerEric Engestrom <eric@engestrom.ch>
Thu, 17 Nov 2022 14:05:02 +0000 (14:05 +0000)
commit077e04bd86f9eb3eb0a2e9e0e14cfe2a5406fabb
treeece0df23c7a796a06f0eb03d9c650e2418dfc696
parentfd23e5b22eec27a8eae6baec13ad4dc4ddc23046
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>
(cherry picked from commit a39113b616099a7bcce9e62337731f040c7cad64)
.pick_status.json
src/freedreno/ir3/ir3_ra.c