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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22075>
This commit is contained in:
Connor Abbott 2024-04-04 08:12:22 -04:00 committed by Marge Bot
parent 81015b2620
commit b2cf2dfd78

View file

@ -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));
}