It's what the backend would do anyway, so let's do it in nir and
give the optimizer some chance to profit from possible improvements.
Fixes a bad shader with "The Raven Remastered"
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
NIR_PASS_V(sel->nir, nir_lower_idiv, &idiv_options);
NIR_PASS_V(sel->nir, r600_nir_lower_trigen);
NIR_PASS_V(sel->nir, nir_lower_phis_to_scalar, false);
+ NIR_PASS_V(sel->nir, nir_lower_undef_to_zero);
if (lower_64bit)
NIR_PASS_V(sel->nir, nir_lower_int64);