From af974b5fe9b02be44445cea16665457e2c4b7229 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 20 Nov 2024 17:26:22 +0100 Subject: [PATCH] nir/opt_undef: keep undefs used by partial undef vectors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Reviewed-by: Rhys Perry Part-of: --- src/compiler/nir/nir_opt_undef.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c index a7ed879e767..6a0a202abab 100644 --- a/src/compiler/nir/nir_opt_undef.c +++ b/src/compiler/nir/nir_opt_undef.c @@ -181,15 +181,9 @@ visit_undef_use(nir_src *src, struct visit_info *info) */ nir_alu_instr *alu = nir_instr_as_alu(instr); - /* Follow movs and vecs. - * - * Note that all vector component uses are followed and swizzles are - * ignored. - */ - if (alu->op == nir_op_mov || nir_op_is_vec(alu->op)) { - nir_foreach_use_including_if(next_src, &alu->def) { - visit_undef_use(next_src, info); - } + /* opt_undef_vecN already copy propagated. */ + if (nir_op_is_vec(alu->op)) { + info->must_keep_undef = true; return; }