From e60e5fe5efb08cf9eb78b747a0143d148d175e41 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Tue, 5 May 2026 09:08:24 +0200 Subject: [PATCH] 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 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15395 Fixes: 3474ba53b5e ("freedreno/ir3/cf: handle multiple cov's properly") Part-of: --- src/freedreno/ir3/ir3_cf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/freedreno/ir3/ir3_cf.c b/src/freedreno/ir3/ir3_cf.c index ac04e2f2d22..50936fec166 100644 --- a/src/freedreno/ir3/ir3_cf.c +++ b/src/freedreno/ir3/ir3_cf.c @@ -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; }