nir/opt_if: Use early returns in opt_if_merge()
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 16 Apr 2019 17:39:11 +0000 (19:39 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 30 Sep 2020 15:47:51 +0000 (15:47 +0000)
commit7f0cd6f1539ff4a98d1d084116834073f20c515d
treefac8393cce9d8408c415087cff05722ef9580645
parent656e428ff4e027d134027df73a0fe13e587011a8
nir/opt_if: Use early returns in opt_if_merge()

We would've had to add yet another level of indentation, or duplicated
finding the if conditions in the next commit. Refactor this function to
use early returns like our other optimizations, so that this isn't an
issue.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6866>
src/compiler/nir/nir_opt_if.c