nir/dead_cf: Remove if statement if one branch has infinite loop

If one branch has infinite loop it's not enough to remove this branch.
Removing it may break previous optimizations which were made on
assumption that the branch with infinite loop doesn't dominate other blocks.

Closes: mesa/mesa#2357

Signed-off-by: Danylo Piliaiev <>
37 jobs for !21 with fix/infinite-loop-in-if-stmt in 27 minutes and 58 seconds (queued for 3 seconds)
merge request