nir: Add NIR debug passes and MESA_NIR_DBG env variable to enable them

The idea is to have a collection of NIR passes which would help in
debugging common issues with shaders.

Passes:
- "no_undef" (nir_undef_to_zero) - initializes all undefined SSAs after
  each NIR pass.

- "finite_loops" (nir_dbg_restrain_loops) - adds upper bound to all loops.
  Helps to find out if shader hangs due to some infinite loop.

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
37 jobs for !3390 with feature/nir-dbg-passes in 20 minutes and 24 seconds (queued for 1 second)
latest detached
Status Job ID Name Coverage
  Container
passed #1387228
aarch64
arm_build

00:00:26

passed #1387229
aarch64
arm_test

00:00:26

passed #1387225
x86_build

00:00:25

passed #1387227
x86_build_old

00:00:21

passed #1387226
x86_test-gl

00:00:21

 
  Build
passed #1387233
aarch64
meson-arm64

00:03:10

passed #1387232
aarch64
meson-armhf

00:02:45

passed #1387234
meson-clang

00:06:15

passed #1387237
meson-clover

00:06:49

passed #1387238
meson-clover-old-llvm

00:03:04

passed #1387240
meson-i386

00:02:11

passed #1387231
meson-main

00:06:53

passed #1387241
meson-mingw32-x86_64

00:06:54

passed #1387230
meson-testing

00:05:19

passed #1387239
meson-vulkan

00:04:42

passed #1387242
scons

00:05:15

passed #1387243
scons-old-llvm

00:04:52

passed #1387235
scons-swr

00:04:22

passed #1387236
scons-win64

00:04:00

 
  Test
passed #1387261
db410c
arm64_a306_gles2

00:06:06

passed #1387258
mesa-cheza
arm64_a630_gles2

00:01:47

passed #1387260
mesa-cheza
arm64_a630_gles3

00:06:31

passed #1387259
mesa-cheza
arm64_a630_gles31

00:04:23

passed #1387244
lava-sun50i-h6-pine-h64
panfrost-t720-test:arm64

00:08:40

passed #1387245
lava-rk3288-veyron-jaq
panfrost-t760-test:armhf

00:06:08

passed #1387246
lava-rk3399-gru-kevin
panfrost-t860-test:arm64

00:05:31

passed #1387248
piglit-glslparser

00:04:38

passed #1387247
piglit-quick_gl

00:09:39

passed #1387249
piglit-quick_shader

00:08:23

passed #1387250
test-llvmpipe-gles2

00:02:52

passed #1387251
test-softpipe-gles2

00:01:12

passed #1387254
test-softpipe-gles31 1/4

00:02:00

passed #1387252
test-softpipe-gles3 1/2

00:05:00

passed #1387255
test-softpipe-gles31 2/4

00:04:27

passed #1387256
test-softpipe-gles31 3/4

00:09:39

passed #1387257
test-softpipe-gles31 4/4

00:06:21

passed #1387253
test-softpipe-gles3 2/2

00:05:35