Skip to content

nir/opt_if: fix opt_if_merge when destination branch has a jump

Rhys Perry requested to merge pendingchaos/mesa:nir_merge_if_jump into master

Fixes a case where opt_if_merge created code like:

if (...) {
   break;
   loop {
      ...
   }
}

which caused opt_peel_loop_initial_if to complain that the loop pre-header wasn't a predecessor of the loop header. This patch prevents this (invalid, I think) unreachable code from being created.

Merge request reports