nir: update nir_lower_returns to only predicate instructions when needed
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 9 Dec 2016 05:49:09 +0000 (16:49 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 22 Dec 2016 23:59:32 +0000 (10:59 +1100)
commitf20ba7ad4476013a6a322a8d562f38bc6c4e2370
tree230ea46c23ccc3530c24a1ef576a915ee5147a08
parent40e9f2f13847ddd94e1216088aa00456d7b02d2b
nir: update nir_lower_returns to only predicate instructions when needed

Unless an if statement contains nested returns we can simply add
any following instructions to the branch without the return.

V2: fix handling if_nested_return value when there is a sibling if/loop
that doesn't contain a return. (Spotted by Ken)

V3:
 - add a better comment to the new variable
 - remove instructions after if when both branches return

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_lower_returns.c