From cf515bda024530461c703aa7b44e88dd4f0d6d22 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") (cherry picked from commit e60e5fe5efb08cf9eb78b747a0143d148d175e41) Part-of: --- .pick_status.json | 2 +- src/freedreno/ir3/ir3_cf.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 9c51df2e958..e52d71ec4b8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -554,7 +554,7 @@ "description": "ir3/cf: fix rewriting uses with different dst types", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "3474ba53b5e6560e758cef51b50d248b6fb806ec", "notes": null 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; }