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

Author: Jason Ekstrand <[email protected]>
Date:   Mon Mar 30 16:39:01 2020 -0500

nir/opt_loop_unroll: Fix has_nested_loop handling

In 87839680c0a48, a very subtle mistake was made with the CFG walking
recursion.  Instead of setting the local has_nested_loop variable when
process child loops, has_nested_loop_out was passed directly into the
process_loop_in_block call.  This broke nested loop detection heuristics
and caused loop unrolling to run massively out of control.  In
particular, it makes the following CTS test compile virtually forever:

dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.struct_mixed_types.uniform_buffer_block_geom

Fixes: 87839680c0 "nir: Fix breakage of foreach_list_typed_safe..."
Closes: #2710
Reviewed-by: Danylo Piliaiev <[email protected]>
Tested-by: Marge Bot 
<https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4380>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4380>

---

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

diff --git a/src/compiler/nir/nir_opt_loop_unroll.c 
b/src/compiler/nir/nir_opt_loop_unroll.c
index 4e18b0e3d12..f8741ea6c50 100644
--- a/src/compiler/nir/nir_opt_loop_unroll.c
+++ b/src/compiler/nir/nir_opt_loop_unroll.c
@@ -851,7 +851,7 @@ process_loops(nir_shader *sh, nir_cf_node *cf_node, bool 
*has_nested_loop_out,
    }
    case nir_cf_node_loop: {
       loop = nir_cf_node_as_loop(cf_node);
-      progress |= process_loops_in_block(sh, &loop->body, has_nested_loop_out);
+      progress |= process_loops_in_block(sh, &loop->body, &has_nested_loop);
 
       break;
    }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to