ir3: validate instruction block pointer

When moving instructions between blocks, it's easy to forget to update
the block pointer resulting in obscure errors later. Let's add a
validation check to improve error reporting.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27411>
This commit is contained in:
Job Noorman 2024-02-01 14:51:15 +01:00 committed by Marge Bot
parent 4d0445d914
commit 1aa1036525

View file

@ -429,6 +429,7 @@ ir3_validate(struct ir3 *ir)
struct ir3_instruction *prev = NULL;
foreach_instr (instr, &block->instr_list) {
validate_assert(ctx, instr->block == block);
ctx->current_instr = instr;
if (instr->opc == OPC_META_PHI) {
/* phis must be the first in the block */