ir3: Validate tied sources better

Catch when we try to propagate an immediate or const, which can happen
if we forget to specify the valid flags for the instruction, and make
sure that it's the same size and type.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22075>
This commit is contained in:
Connor Abbott 2024-04-11 08:00:33 -04:00 committed by Marge Bot
parent 3c71667dda
commit 79c89a3670

View file

@ -92,6 +92,8 @@ validate_src(struct ir3_validate_ctx *ctx, struct ir3_instruction *instr,
if (reg->tied) {
validate_assert(ctx, reg->tied->tied == reg);
validate_assert(ctx, reg_class_flags(reg) == reg_class_flags(reg->tied));
validate_assert(ctx, !(reg->flags & (IR3_REG_CONST | IR3_REG_IMMED)));
bool found = false;
foreach_dst (dst, instr) {
if (dst == reg->tied) {