ir3: set current instruction before all validation asserts

The first assert happened before setting the current instruction which
caused the error message to refer to the previous instruction.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29497>
This commit is contained in:
Job Noorman 2024-06-17 11:34:25 +02:00 committed by Marge Bot
parent f57bee676f
commit c24aad5867

View file

@ -472,8 +472,8 @@ 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;
validate_assert(ctx, instr->block == block);
if (instr->opc == OPC_META_PHI) {
/* phis must be the first in the block */
validate_assert(ctx, prev == NULL || prev->opc == OPC_META_PHI);