aco/ra: test the register file in get_reg_specified() when necessary

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Backport-to: *
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41018>
This commit is contained in:
Rhys Perry 2026-04-28 11:48:46 +01:00 committed by Marge Bot
parent 2d5478fc3f
commit 43aeeb8b88

View file

@ -1633,6 +1633,12 @@ get_reg_specified(ra_ctx& ctx, const RegisterFile& reg_file, RegClass rc,
if (reg.reg_b % info.data_stride)
return false;
/* In other cases, we assume the caller ensured that this is fine. */
if (info.rc.bytes() > rc.bytes()) {
if (reg_file.test(reg, info.rc.bytes()))
return false;
}
assert(util_is_power_of_two_nonzero(info.stride));
reg.reg_b &= ~(info.stride - 1);