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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37777>
This commit is contained in:
Emma Anholt 2025-10-09 11:23:14 -07:00 committed by Marge Bot
parent 30b7772ae4
commit aa85e3331f

View file

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