nir: do not skip dead if/loop optimizations

At the moment 'dead_cf_list' can't perform an optimization
for second if/loop of two dead if's/loops in a row.

It doesn't work because in this case we need to call dead_cf_block
twice on the same block, first to remove the first if and again
to remove the second, but previously we moved on to the second if
after processing the first.

Skipping dead loop removal in particular
can make other passes crash on infinite loops.

This patch should fix this issue.

v2: - fix commit message
    - use nir_cf_node_next helper
               ( Connor Abbott <cwabbott0@gmail.com> )

v3: - update commit message
    - remove one unnecessary exec_node_data call
               ( Connor Abbott <cwabbott0@gmail.com> )

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111070
Fixes: f649afc9 "nir/dead_cf: delete code that's unreachable due to jumps"
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
40 jobs for !1352 with spirv_infinity_loop in 20 minutes and 46 seconds (queued for 3 seconds)
latest detached
Status Job ID Name Coverage
  Containers
passed #696251
debian-10

00:01:56

passed #696252
debian-9

00:00:24

passed #696253
aarch64
test-container:arm64

00:00:22

 
  Build
passed #696256
meson-arm64

00:06:14

passed #696255
meson-armhf

00:04:21

passed #696258
meson-clang

00:08:08

passed #696261
meson-clover

00:06:51

passed #696262
meson-clover-old-llvm

00:05:48

passed #696264
meson-i386

00:03:06

passed #696254
meson-main

00:10:52

passed #696257
meson-swr-glvnd

00:05:59

passed #696263
meson-vulkan

00:03:17

passed #696265
scons

00:18:14

passed #696266
scons-old-llvm

00:08:02

passed #696259
scons-swr

00:05:55

passed #696260
scons-win64

00:06:55

 
  Test
passed #696287
db410c
arm64_a306_gles2 1/4

00:04:10

passed #696288
db410c
arm64_a306_gles2 2/4

00:06:00

passed #696289
db410c
arm64_a306_gles2 3/4

00:04:12

passed #696290
db410c
arm64_a306_gles2 4/4

00:04:29

passed #696276
mesa-cheza
arm64_a630_gles2

00:05:01

passed #696277
mesa-cheza
arm64_a630_gles31 1/4

00:06:24

passed #696278
mesa-cheza
arm64_a630_gles31 2/4

00:07:35

passed #696279
mesa-cheza
arm64_a630_gles31 3/4

00:07:57

passed #696280
mesa-cheza
arm64_a630_gles31 4/4

00:07:08

passed #696281
mesa-cheza
arm64_a630_gles3 1/6

00:04:43

passed #696282
mesa-cheza
arm64_a630_gles3 2/6

00:04:44

passed #696283
mesa-cheza
arm64_a630_gles3 3/6

00:03:54

passed #696284
mesa-cheza
arm64_a630_gles3 4/6

00:04:56

passed #696285
mesa-cheza
arm64_a630_gles3 5/6

00:04:10

passed #696286
mesa-cheza
arm64_a630_gles3 6/6

00:04:47

passed #696267
test-llvmpipe-gles2 1/4

00:04:28

passed #696268
test-llvmpipe-gles2 2/4

00:03:59

passed #696269
test-llvmpipe-gles2 3/4

00:02:14

passed #696270
test-llvmpipe-gles2 4/4

00:03:59

passed #696271
test-softpipe-gles2 1/4

00:01:04

passed #696272
test-softpipe-gles2 2/4

00:01:41

passed #696273
test-softpipe-gles2 3/4

00:01:43

passed #696274
test-softpipe-gles2 4/4

00:01:23

passed #696275
test-softpipe-gles3-limited

00:03:59