From b2cf2dfd78db607b2966239afba3a96145a59142 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Thu, 4 Apr 2024 08:12:22 -0400 Subject: [PATCH] ir3/ra: Use ra_reg_get_num() for validating num This is what the rest of ra validation uses, because it returns the correct thing for arrays (i.e. the base of the array, instead of the actual register accessed). num is sometimes not set, so it was causing spurious assertion failures. Part-of: --- src/freedreno/ir3/ir3_ra_validate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/freedreno/ir3/ir3_ra_validate.c b/src/freedreno/ir3/ir3_ra_validate.c index 8d4e726149a..4537c6d959e 100644 --- a/src/freedreno/ir3/ir3_ra_validate.c +++ b/src/freedreno/ir3/ir3_ra_validate.c @@ -193,7 +193,7 @@ validate_simple(struct ra_val_ctx *ctx, struct ir3_instruction *instr) foreach_dst_if (dst, instr, validate_reg_is_dst) { if (ctx->shared_ra && !(dst->flags & IR3_REG_SHARED)) continue; - validate_assert(ctx, dst->num != INVALID_REG); + validate_assert(ctx, ra_reg_get_num(dst) != INVALID_REG); unsigned dst_max = ra_reg_get_physreg(dst) + reg_size(dst); validate_assert(ctx, dst_max <= get_file_size(ctx, dst)); if (dst->tied) @@ -203,7 +203,7 @@ validate_simple(struct ra_val_ctx *ctx, struct ir3_instruction *instr) foreach_src_if (src, instr, validate_reg_is_src) { if (ctx->shared_ra && !(src->flags & IR3_REG_SHARED)) continue; - validate_assert(ctx, src->num != INVALID_REG); + validate_assert(ctx, ra_reg_get_num(src) != INVALID_REG); unsigned src_max = ra_reg_get_physreg(src) + reg_size(src); validate_assert(ctx, src_max <= get_file_size(ctx, src)); }