Skip to content

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.

Merge request reports