[Mesa-dev] [PATCH 08/11] nir: add new partially_unrolled bool to nir_loop

Timothy Arceri tarceri at itsqueeze.com
Tue Nov 20 08:14:36 UTC 2018


In order to stop continuously partially unrolling the same loop
we add the bool partialy_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.
---
 src/compiler/nir/nir.h       | 1 +
 src/compiler/nir/nir_clone.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index e6ee6ebe62..8e3c9b8710 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1917,6 +1917,7 @@ typedef struct {
    struct exec_list body; /** < list of nir_cf_node */
 
    nir_loop_info *info;
+   bool partially_unrolled;
 } nir_loop;
 
 /**
diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c
index 989c5051a5..b229094679 100644
--- a/src/compiler/nir/nir_clone.c
+++ b/src/compiler/nir/nir_clone.c
@@ -548,6 +548,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);
 
-- 
2.19.1



More information about the mesa-dev mailing list