ir3: add assert to detect getting reg file of const/imm

ir3_reg_file_offset should only be called for actual registers, not for
const or immediate values. However, this did happens accidentally for
tracking WAR hazards in ir3_legalize. While that case has been fixed,
better to prevent such cases in the future.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30611>
This commit is contained in:
Job Noorman
2024-08-12 09:28:18 +02:00
committed by Marge Bot
parent 523a0e2e39
commit 6e16dc60a1

View File

@@ -1483,6 +1483,7 @@ static inline unsigned
ir3_reg_file_offset(const struct ir3_register *reg, unsigned num,
bool mergedregs, enum ir3_reg_file *file)
{
assert(!(reg->flags & (IR3_REG_IMMED | IR3_REG_CONST)));
unsigned size = reg_elem_size(reg);
if (!is_reg_gpr(reg)) {
*file = IR3_FILE_NONGPR;