nir: Add a find_variable_with_[driver_]location helper

We've hand-rolled this loop 10 places and those are just the ones I
found easily.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <mesa/mesa!5966>
70 jobs for !5966 with review/nir-global-var-list in 14 minutes and 58 seconds (queued for 8 seconds)
detached
Status Job ID Name Coverage
  Container+Docs
passed #3859840
aarch64
arm_build

00:00:19

passed #3859842
arm_test-base

00:00:15

passed #3859835
x86_build-base

00:00:14

passed #3859839
x86_build_old

00:01:26

passed #3859837
x86_test-base

00:00:15

 
  Container 2
passed #3859860
arm64_test

00:00:21

passed #3859851
i386_build

00:00:20

passed #3859844
kernel+rootfs_amd64

00:01:32

passed #3859846
aarch64
kernel+rootfs_arm64

00:00:17

passed #3859848
aarch64
kernel+rootfs_armhf

00:00:18

passed #3859853
ppc64el_build

00:00:14

passed #3859855
s390x_build

00:00:21

passed #3859850
x86_build

00:00:21

passed #3859857
x86_test-gl

00:00:14

passed #3859859
x86_test-vk

00:00:21

 
  Meson X86 64
passed #3859867
meson-clang

00:06:24

passed #3859866
meson-classic

00:01:37

passed #3859869
meson-clover

00:03:18

passed #3859871
meson-clover-old-llvm

00:07:21

passed #3859864
meson-gallium

00:05:22

passed #3859862
meson-testing

00:02:12

passed #3859872
meson-vulkan

00:02:56

 
  Scons
passed #3859874
scons-win64

00:03:52

 
  Meson Misc
passed #3859878
aarch64
meson-arm64

00:01:36

passed #3859880
aarch64
meson-arm64-build-test

00:03:34

passed #3859876
aarch64
meson-armhf

00:01:13

passed #3859882
meson-i386

00:02:33

passed #3859887
meson-mingw32-x86_64

00:05:39

passed #3859885
kvm
meson-ppc64el

00:04:08

passed #3859883
kvm
meson-s390x

00:05:06

 
  Llvmpipe
passed #3859894
llvmpipe-gles2

00:00:45

passed #3859896
llvmpipe-traces

00:01:26

passed #3859891
piglit-glslparser

00:02:03

passed #3859889
piglit-quick_gl

00:02:32

passed #3859892
piglit-quick_shader

00:02:39

 
  Softpipe
passed #3859898
softpipe-gles2

00:00:39

passed #3859900
softpipe-gles3

00:05:58

passed #3859902
softpipe-gles31 1/2

00:05:40

passed #3859903
softpipe-gles31 2/2

00:03:26

 
  Freedreno
passed #3859913
google-freedreno-db410c
arm64_a306_gles2

00:06:51

passed #3859914
google-freedreno-db410c
arm64_a306_gles3

00:05:47

passed #3859915
google-freedreno-db410c
arm64_a306_gles3_options

00:04:10

passed #3859916
google-freedreno-db820c
arm64_a530_gles2

00:11:10

passed #3859917
google-freedreno-db820c
arm64_a530_gles3

00:03:37

passed #3859918
google-freedreno-db820c
arm64_a530_gles31

00:04:44

passed #3859908
google-freedreno-cheza
arm64_a630_bypass

00:01:58

passed #3859904
google-freedreno-cheza
arm64_a630_gles2

00:02:00

passed #3859906
google-freedreno-cheza
arm64_a630_gles3

00:05:54

passed #3859905
google-freedreno-cheza
arm64_a630_gles31

00:04:21

passed #3859910
google-freedreno-cheza
arm64_a630_gmem

00:01:52

passed #3859907
google-freedreno-cheza
arm64_a630_noubo

00:01:24

passed #3859909
google-freedreno-cheza
arm64_a630_traces

00:01:30

passed #3859911
google-freedreno-cheza
arm64_a630_vk

00:04:33

passed #3859912
google-freedreno-cheza
arm64_a630_vk_sysmem

00:02:28

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

00:08:06

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

00:05:25

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

00:05:09

passed #3859922
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles3:arm64 1/2

00:12:48

passed #3859923
mesa-ci-aarch64-lava-collabora
panfrost-t860-gles3:arm64 2/2

00:07:21

passed #3859924
mesa-ci-aarch64-lava-collabora
panfrost-t860-traces:arm64

00:04:47

 
  Radv
passed #3859925
radv-fossils

00:05:16

 
  Virgl
passed #3859930
virgl-gl30-on-gl

00:00:32

passed #3859931
virgl-gl31-on-gl

00:03:22

passed #3859932
virgl-gl32-on-gl

00:01:35

passed #3859926
virgl-gles2-on-gl

00:01:39

passed #3859928
virgl-gles31-on-gl 1/2

00:03:25

passed #3859929
virgl-gles31-on-gl 2/2

00:04:07

passed #3859927
virgl-gles3-on-gl

00:04:58

passed #3859933
virgl-traces

00:00:43

 
  Radeonsi
passed #3859934
mesa-ci-aarch64-lava-collabora
radeonsi-stoney-traces:amd64

00:08:46