From aa85e3331f7160901d0a970f9b36913c4355c767 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 9 Oct 2025 11:23:14 -0700 Subject: [PATCH] ir3/parser: Make sure relative accesses have a size set. This will avoid assertion failures about a size==0 in the upcoming change to regmask bitset handling, when collect_info() usees them to track references into the current alias table. We know that relative accesses won't go to the alias table, but that code doesn't. Part-of: --- src/freedreno/ir3/ir3_parser_support.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/freedreno/ir3/ir3_parser_support.c b/src/freedreno/ir3/ir3_parser_support.c index cd86a1d8b6f..2dba2cd0024 100644 --- a/src/freedreno/ir3/ir3_parser_support.c +++ b/src/freedreno/ir3/ir3_parser_support.c @@ -173,6 +173,13 @@ new_src(int num, unsigned flags) flags |= IR3_REG_HALF; reg = ir3_src_create(instr, num >> 1, flags); reg->wrmask = MAX2(1, rflags.wrmask); + /* Make sure that relative reads have a size as required, so that + * aliasing-related regmask checks in collect_info() aren't surprised by + * 0-length arrays. We don't need a proper size, because aliases will + * never be indirectly referenced, anyway. + */ + if (flags & IR3_REG_RELATIV) + reg->size = 1; rflags.flags = rflags.wrmask = 0; return reg; } @@ -186,6 +193,13 @@ new_dst(int num, unsigned flags) flags |= IR3_REG_HALF; reg = ir3_dst_create(instr, num >> 1, flags); reg->wrmask = MAX2(1, rflags.wrmask); + /* Make sure that relative writes have a size as required, so that + * aliasing-related regmask checks in collect_info() aren't surprised by + * 0-length arrays. We don't need a proper size, because aliases will + * never be indirectly referenced, anyway. + */ + if (flags & IR3_REG_RELATIV) + reg->size = 1; rflags.flags = rflags.wrmask = 0; return reg; }