nir: Handle nir_op_mov properly in opt_shrink_vectors

If the opcode is a mov, it falls into the nir_alu_src_is_trivial_ssa
case, not the vec case.

Fixes: 94eff7ccd8 ("nir: shrink phi nodes in nir_opt_shrink_vectors")
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:19:00 -05:00 committed by Marge Bot
parent 9bcc9597a5
commit f9a17c6fef

View file

@ -439,7 +439,7 @@ opt_shrink_vectors_phi(nir_builder *b, nir_phi_instr *instr)
/* However, even if the instruction only points back at the phi, we still
* need to check that the swizzles are trivial.
*/
if (nir_op_is_vec(alu->op)) {
if (nir_op_is_vec(alu->op) && alu->op != nir_op_mov) {
if (src_idx != alu->src[src_idx].swizzle[0]) {
mask |= src_read_mask;
}