nir: add new partially_unrolled bool to nir_loop
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 19 Nov 2018 06:01:52 +0000 (17:01 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 12 Mar 2019 00:52:30 +0000 (00:52 +0000)
In order to stop continuously partially unrolling the same loop
we add the bool partially_unrolled to nir_loop, we add it here
rather than in nir_loop_info because nir_loop_info is only set
via loop analysis and is intended to be cleared before each
analysis. Also nir_loop_info is never cloned.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/nir/nir.h
src/compiler/nir/nir_clone.c

index 39b4c2aaf3eed80dafc1e943fe1f2d052c491585..aac9ac448b88628d1b2454e17ffe49bc2a67850f 100644 (file)
@@ -1949,6 +1949,7 @@ typedef struct {
    struct exec_list body; /** < list of nir_cf_node */
 
    nir_loop_info *info;
+   bool partially_unrolled;
 } nir_loop;
 
 /**
index b10068928a7358ba4139b7e21fec5d736da6c682..fa24f8b6028bd38b0baf7025d078c7a70d242f1c 100644 (file)
@@ -551,6 +551,7 @@ static nir_loop *
 clone_loop(clone_state *state, struct exec_list *cf_list, const nir_loop *loop)
 {
    nir_loop *nloop = nir_loop_create(state->ns);
+   nloop->partially_unrolled = loop->partially_unrolled;
 
    nir_cf_node_insert_end(cf_list, &nloop->cf_node);