nir: Add nir_undef_to_zero pass

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 <alyssa.rosenzweig@collabora.com>
22 jobs for !1769 with nir-undef-to-zero in 51 minutes and 39 seconds (queued for 3 seconds)
latest detached
Status Job ID Name Coverage
  Containers Build
passed #536396
debian

00:00:41

 
  Build+Test
passed #536405
meson-arm64

00:02:40

passed #536404
meson-armhf

00:02:34

passed #536398
meson-clang

00:10:28

passed #536402
meson-clover

00:11:30

passed #536406
meson-i386

00:03:46

passed #536401
meson-main

00:10:24

passed #536397
meson-swr-glvnd

00:05:55

passed #536403
meson-vulkan

00:03:01

passed #536408
scons-llvm

00:04:28

passed #536407
scons-nollvm

00:04:07

passed #536399
scons-swr

00:08:06

passed #536400
scons-win64

00:08:31

 
  Test
passed #536409
test-llvmpipe-gles2 1/4

00:04:31

passed #536410
test-llvmpipe-gles2 2/4

00:04:41

passed #536411
test-llvmpipe-gles2 3/4

00:04:29

passed #536412
test-llvmpipe-gles2 4/4

00:05:51

passed #536413
test-softpipe-gles2 1/4

00:02:05

passed #536414
test-softpipe-gles2 2/4

00:02:22

passed #536415
test-softpipe-gles2 3/4

00:02:12

passed #536416
test-softpipe-gles2 4/4

00:01:36

passed #536417
test-softpipe-gles3-limited

00:04:56