nir/opt_dead_cf: remove nodes after a jump earlier
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 19 Jul 2023 13:05:11 +0000 (14:05 +0100)
committerRhys Perry <pendingchaos02@gmail.com>
Mon, 24 Jul 2023 13:06:16 +0000 (14:06 +0100)
commit21f0aca948b2bbaefb39407c3bf3fe605d05caf5
treedf517031993761fd71e9f969da234228d3bad2ab
parent1c8577b49327548c152ab2911a31d4abef392143
nir/opt_dead_cf: remove nodes after a jump earlier

In the case of:
   halt
   // succs: b9
   if %618 {
       block b3:// preds:
       break
       // succs: b6
   } else {
       block b4:  // preds: , succs: b5
   }
   block b5:    // preds: b4
   32    %556 = iadd %617, %2 (0x1)
opt_constant_if() doesn't work because stitch_blocks() can't join blocks if the
before ends in a jump and the after isn't empty.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24235>
src/compiler/nir/nir_opt_dead_cf.c