diff options
author | Job Noorman <jnoorman@igalia.com> | 2024-08-12 09:28:18 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-08-29 18:44:14 +0000 |
commit | 6e16dc60a176c5d2ea8ee074d1281a36af0e78cf (patch) | |
tree | 0c9df006ba51c9400078503030cdc6e440714edf | |
parent | 523a0e2e395fa147307f78bb6d65b7e7cdbb0d80 (diff) |
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>
-rw-r--r-- | src/freedreno/ir3/ir3.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index fe6932a4f41..90b4c4460a1 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -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; |