Mesa (master): nir: make opt_if_loop_terminator() less strict

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 8 01:54:26 UTC 2020


Module: Mesa
Branch: master
Commit: 52c8bc0130a2031904f8f4e2187baf2f3f8ff6ec
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=52c8bc0130a2031904f8f4e2187baf2f3f8ff6ec

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Tue Apr  7 23:33:55 2020 +1000

nir: make opt_if_loop_terminator() less strict

nir_cf_{extract,reinsert}() can't stitch a block together
if the block we are extracting ends in a jump but other jumps
nested in further ifs should be fine to move.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4477>

---

 src/compiler/nir/nir_opt_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c
index 75e4244cb2f..9460cefb79b 100644
--- a/src/compiler/nir/nir_opt_if.c
+++ b/src/compiler/nir/nir_opt_if.c
@@ -998,7 +998,7 @@ opt_if_loop_terminator(nir_if *nif)
    if (is_block_empty(first_continue_from_blk))
       return false;
 
-   if (!nir_is_trivial_loop_if(nif, break_blk))
+   if (nir_block_ends_in_jump(continue_from_blk))
       return false;
 
    /* Even though this if statement has a jump on one side, we may still have



More information about the mesa-commit mailing list