ir3/cf: fix rewriting uses with different dst types

When an instruction has multiple cov uses that have different dst types,
we cannot simple make them all a mov, as some may still have to perform
an actual conversion. Fix this by setting the use's src type to the dst
type of the conversion we just folded.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15395
Fixes: 3474ba53b5 ("freedreno/ir3/cf: handle multiple cov's properly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41355>
This commit is contained in:
Job Noorman 2026-05-05 09:08:24 +02:00 committed by Marge Bot
parent 099933f004
commit e60e5fe5ef

View file

@ -132,7 +132,7 @@ all_uses_same_cov(struct ir3_instruction *movs)
* shifts the use to a simple mov.
*/
static void
rewrite_src_uses(struct ir3_instruction *src)
rewrite_src_uses(struct ir3_instruction *src, type_t src_type)
{
foreach_ssa_use (use, src) {
assert(use->opc == OPC_MOV);
@ -143,7 +143,7 @@ rewrite_src_uses(struct ir3_instruction *src)
use->srcs[0]->flags &= ~IR3_REG_HALF;
}
use->cat1.src_type = use->cat1.dst_type;
use->cat1.src_type = src_type;
}
}
@ -215,7 +215,7 @@ try_conversion_folding(struct ir3_instruction *conv,
}
ir3_set_dst_type(src, is_half(conv));
rewrite_src_uses(src);
rewrite_src_uses(src, conv->cat1.dst_type);
return true;
}