nir: add callback to nir_remove_dead_variables()

This allows us to do API specific checks before removing variable
without filling nir_remove_dead_variables() with API specific code.

In the following patches we will use this to support the removal
of dead uniforms in GLSL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tweaked-for-D3D12-by: by Erik Faye-Lund <erik.faye-lund@collabora.com>
42 jobs for !225 with d3d12-remove_dead_variables_sync in 29 minutes and 38 seconds (queued for 10 seconds)
latest detached
Status Job ID Name Coverage
  Container
passed #3696943
aarch64
arm_build

00:00:21

passed #3696944
aarch64
arm_test

00:00:21

passed #3696945
mesa 1809 shell windows
windows_build_vs2019

00:00:07

passed #3696939
x86_build

00:00:22

passed #3696942
x86_build_old

00:00:18

passed #3696940
x86_test-gl

00:00:18

passed #3696941
x86_test-vk

00:00:21

 
  Meson X86 64
failed #3696949
meson-clang

00:02:41

passed #3696948
meson-classic

00:01:07

failed #3696950
meson-clover

00:02:32

failed #3696951
meson-clover-old-llvm

00:02:06

failed #3696947
meson-gallium

00:02:11

passed #3696946
meson-testing

00:02:44

passed #3696952
meson-vulkan

00:02:31

 
  Scons
passed #3696953
scons-win64

00:03:01

 
  Meson Misc
passed #3696955
aarch64
meson-arm64

00:02:12

passed #3696956
aarch64
meson-arm64-build-test

00:02:56

passed #3696954
aarch64
meson-armhf

00:01:14

passed #3696958
meson-i386

00:04:27

passed #3696961
meson-mingw32-x86_64

00:02:26

passed #3696960
kvm
meson-ppc64el

00:06:16

passed #3696959
kvm
meson-s390x

00:03:25

failed #3696957
mesa 1809 docker windows
meson-windows-vs2019

00:05:55

 
  Llvmpipe
passed #3696965
llvmpipe-gles2

00:04:54

passed #3696966
llvmpipe-traces

00:00:31

passed #3696963
piglit-glslparser

00:05:05

passed #3696962
piglit-quick_gl

00:07:37

passed #3696964
piglit-quick_shader

00:05:21

 
  Softpipe
passed #3696967
softpipe-gles2

00:01:14

passed #3696970
softpipe-gles31 1/4

00:03:22

passed #3696968
softpipe-gles3 1/2

00:05:31

passed #3696971
softpipe-gles31 2/4

00:03:08

passed #3696972
softpipe-gles31 3/4

00:05:52

passed #3696973
softpipe-gles31 4/4

00:03:59

passed #3696969
softpipe-gles3 2/2

00:06:04

 
  Panfrost
passed #3696974
mesa-ci-aarch64-lava-collabora
panfrost-t720-gles2:arm64

00:26:50

passed #3696975
mesa-ci-aarch64-lava-collabora
panfrost-t760-gles2:armhf

00:05:08

passed #3696976
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles2:arm64

00:04:19

passed #3696977
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles3:arm64

00:04:08

 
  Radv
passed #3696978
radv-fossils

00:00:46

 
  Virgl
passed #3696979
virgl-gles2

00:02:35

passed #3696980
virgl-gles3

00:04:20

 
Name Stage Failure
failed
meson-windows-vs2019 Meson Misc
Built:        2020-06-19T20:36:38+0000
OS/Arch: windows/amd64
Uploading artifacts...
_build/meson-logs/*.txt: found 2 matching files and directories

WARNING: build/*/config.log: no matching files
WARNING: shader-db: no matching files
WARNING: Failed to load system CertPool: crypto/x509: system root pool is not available on Windows
Uploading artifacts as "archive" to coordinator... ok
id=3696957 responseStatus=201 Created token=mzhwd5Vy
ERROR: Job failed: exit code 1
failed
meson-clang Meson X86 64
cache size                           4.5 GB
max cache size 5.0 GB
Uploading artifacts for failed job
Uploading artifacts...
_build/meson-logs/*.txt: found 1 matching files

WARNING: build/*/config.log: no matching files
WARNING: shader-db: no matching files
Uploading artifacts to coordinator... ok
id=3696949 responseStatus=201 Created token=J9kLYs7y
ERROR: Job failed: exit code 1
failed
meson-clover Meson X86 64
cache size                           4.5 GB
max cache size 5.0 GB
Uploading artifacts for failed job
Uploading artifacts...
_build/meson-logs/*.txt: found 1 matching files

WARNING: build/*/config.log: no matching files
WARNING: shader-db: no matching files
Uploading artifacts to coordinator... ok
id=3696950 responseStatus=201 Created token=2BS7URa7
ERROR: Job failed: exit code 1
failed
meson-gallium Meson X86 64
cache size                           4.3 GB
max cache size 5.0 GB
Uploading artifacts for failed job
Uploading artifacts...
_build/meson-logs/*.txt: found 1 matching files and directories

WARNING: build/*/config.log: no matching files
WARNING: shader-db: no matching files
Uploading artifacts as "archive" to coordinator... ok
id=3696947 responseStatus=201 Created token=RUi6_xyZ
ERROR: Job failed: exit code 1
failed
meson-clover-old-llvm Meson X86 64
cache size                           4.5 GB
max cache size 5.0 GB
Uploading artifacts for failed job
Uploading artifacts...
_build/meson-logs/*.txt: found 1 matching files and directories

WARNING: build/*/config.log: no matching files
WARNING: shader-db: no matching files
Uploading artifacts as "archive" to coordinator... ok
id=3696951 responseStatus=201 Created token=P1X_GwNz
ERROR: Job failed: exit code 1