zink: run nir_opt_algebraic_late

This pass is needed to finish off the [ui]2imp lowering. Follow what
other drivers do and perform some dead-code elimimation etc when
lowering happens.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10101>
This commit is contained in:
Erik Faye-Lund 2021-04-06 17:27:13 +02:00 committed by Marge Bot
parent 204cd1b893
commit 3f4eacb38a

View file

@ -444,6 +444,16 @@ optimize_nir(struct nir_shader *s)
NIR_PASS(progress, s, nir_opt_undef);
NIR_PASS(progress, s, zink_nir_lower_b2b);
} while (progress);
do {
progress = false;
NIR_PASS(progress, s, nir_opt_algebraic_late);
if (progress) {
NIR_PASS_V(s, nir_copy_prop);
NIR_PASS_V(s, nir_opt_dce);
NIR_PASS_V(s, nir_opt_cse);
}
} while (progress);
}
/* check for a genuine gl_PointSize output vs one from nir_lower_point_size_mov */