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>
(cherry picked from commit 408929289a)
This commit is contained in:
Faith Ekstrand 2023-08-15 11:27:49 -05:00 committed by Dylan Baker
parent e570645664
commit 0ecc582677
2 changed files with 3 additions and 2 deletions

View file

@ -6994,7 +6994,7 @@
"description": "nir: Don't handle nir_op_mov in get_undef_mask in opt_undef",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "5f26c21e62466783cd031c45a39544c992cee202",
"notes": null

View file

@ -110,7 +110,8 @@ nir_get_undef_mask(nir_ssa_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.is_ssa &&
alu->src[i].src.ssa->parent_instr->type ==