[Mesa-dev] [PATCH 050/133] nir: Make the nir_index_* functions return the nuber of items

Jason Ekstrand jason at jlekstrand.net
Mon Dec 15 22:05:00 PST 2014


---
 src/glsl/nir/nir.c | 3 +++
 src/glsl/nir/nir.h | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index e90eeda..2c06d7e 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -1334,6 +1334,7 @@ nir_index_local_regs(nir_function_impl *impl)
    foreach_list_typed(nir_register, reg, node, &impl->registers) {
       reg->index = index++;
    }
+   impl->reg_alloc = index;
 }
 
 void
@@ -1343,6 +1344,7 @@ nir_index_global_regs(nir_shader *shader)
    foreach_list_typed(nir_register, reg, node, &shader->registers) {
       reg->index = index++;
    }
+   shader->reg_alloc = index;
 }
 
 static bool
@@ -1765,4 +1767,5 @@ nir_index_ssa_defs(nir_function_impl *impl)
 {
    unsigned index = 0;
    nir_foreach_block(impl, index_ssa_block, &index);
+   impl->ssa_alloc = index;
 }
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index f405694..f744736 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -357,7 +357,7 @@ typedef struct {
    unsigned num_components; /** < number of vector components */
    unsigned num_array_elems; /** < size of array (0 for no array) */
 
-   /** for liveness analysis, the index in the bit-array of live variables */
+   /** generic register index. */
    unsigned index;
 
    /** only for debug purposes, can be NULL */
@@ -417,7 +417,7 @@ typedef struct {
    /** for debugging only, can be NULL */
    const char* name;
 
-   /** index into the bit-array for liveness analysis */
+   /** generic SSA definition index. */
    unsigned index;
 
    nir_instr *parent_instr;
-- 
2.2.0



More information about the mesa-dev mailing list