From 408929289aadaf44e57ef60cb7c1ace4958199c7 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 15 Aug 2023 11:27:49 -0500 Subject: [PATCH] nir: Don't handle nir_op_mov in get_undef_mask in opt_undef It's unnecessary because earlier parts of the pass will ensure that a mov of undef is turned into an undef. It's also wrong because nir_op_mov has different semantics from nir_op_vecN when it comes to how sources map to destination components. Fixes: 5f26c21e6246 ("nir: Expand opt_undef to handle undef channels in a store intrinsic") Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_opt_undef.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c index a77d821..ce950f4 100644 --- a/src/compiler/nir/nir_opt_undef.c +++ b/src/compiler/nir/nir_opt_undef.c @@ -102,7 +102,8 @@ nir_get_undef_mask(nir_def *def) nir_alu_instr *alu = nir_instr_as_alu(instr); unsigned undef = 0; - if (nir_op_is_vec(alu->op)) { + /* nir_op_mov of undef is handled by opt_undef_vecN() */ + if (nir_op_is_vec(alu->op) && alu->op != nir_op_mov) { for (int i = 0; i < nir_op_infos[alu->op].num_inputs; i++) { if (alu->src[i].src.ssa->parent_instr->type == nir_instr_type_undef) { -- 2.7.4