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: 5f26c21e62 ("nir: Expand opt_undef to handle undef channels in a store intrinsic")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24704>
This commit is contained in:
Faith Ekstrand 2023-08-15 11:27:49 -05:00 committed by Marge Bot
parent f9a17c6fef
commit 408929289a

View file

@ -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) {