nir: Add nir_undef_to_zero pass

Closed Alyssa Rosenzweig requested to merge alyssa/mesa:nir-undef-to-zero into master

This optional pass rewrites ssa_undef into constant zeroes, eliminating the undefs entirely and permitting further optimization as well as eliminating some undefined behaviour. It's not strictly necessary, but it can help tame some shaders. The pass was originally written for Midgard's compiler but it turns out it helps lima as well.

Signed-off-by: Alyssa Rosenzweig

Tagging @rellla

Merge request reports