nir: Rename live_variables to live_ssa_defs.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 4 Nov 2015 01:15:24 +0000 (17:15 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 5 Nov 2015 08:09:40 +0000 (00:09 -0800)
This computes liveness of SSA values, not nir_variables.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/glsl/nir/nir.h
src/glsl/nir/nir_from_ssa.c
src/glsl/nir/nir_live_variables.c
src/glsl/nir/nir_lower_global_vars_to_local.c
src/glsl/nir/nir_metadata.c
src/glsl/nir/nir_opt_dead_cf.c
src/glsl/nir/nir_remove_dead_variables.c

index 874a03966befa83507288505c93b7b8963228b03..f8de40d0d130807f213cc44ff534eded3d4630f9 100644 (file)
@@ -1310,7 +1310,7 @@ typedef enum {
    nir_metadata_none = 0x0,
    nir_metadata_block_index = 0x1,
    nir_metadata_dominance = 0x2,
-   nir_metadata_live_variables = 0x4,
+   nir_metadata_live_ssa_defs = 0x4,
 } nir_metadata;
 
 typedef struct {
@@ -1986,7 +1986,7 @@ bool nir_lower_gs_intrinsics(nir_shader *shader);
 
 bool nir_normalize_cubemap_coords(nir_shader *shader);
 
-void nir_live_variables_impl(nir_function_impl *impl);
+void nir_live_ssa_defs_impl(nir_function_impl *impl);
 bool nir_ssa_defs_interfere(nir_ssa_def *a, nir_ssa_def *b);
 
 void nir_convert_to_ssa_impl(nir_function_impl *impl);
index eaf883dbaa02786846b0e7c1785bea94fa66bdc5..f2797f72c8e6028398c9f260b92aa20920d062ae 100644 (file)
@@ -777,7 +777,7 @@ nir_convert_from_ssa_impl(nir_function_impl *impl, bool phi_webs_only)
    nir_metadata_preserve(impl, nir_metadata_block_index |
                                nir_metadata_dominance);
 
-   nir_metadata_require(impl, nir_metadata_live_variables |
+   nir_metadata_require(impl, nir_metadata_live_ssa_defs |
                               nir_metadata_dominance);
 
    nir_foreach_block(impl, coalesce_phi_nodes_block, &state);
index 1c96dcf36c5ce2afc1d3dcc6bebccf90205407bb..05f79d7bc617a76b45fd02701616c67f2115a75b 100644 (file)
@@ -42,7 +42,7 @@
  * block but not in the live-in of the block containing the phi node.
  */
 
-struct live_variables_state {
+struct live_ssa_defs_state {
    unsigned num_ssa_defs;
    unsigned bitset_words;
 
@@ -52,7 +52,7 @@ struct live_variables_state {
 static bool
 index_ssa_def(nir_ssa_def *def, void *void_state)
 {
-   struct live_variables_state *state = void_state;
+   struct live_ssa_defs_state *state = void_state;
 
    if (def->parent_instr->type == nir_instr_type_ssa_undef)
       def->live_index = 0;
@@ -77,7 +77,7 @@ index_ssa_definitions_block(nir_block *block, void *state)
 static bool
 init_liveness_block(nir_block *block, void *void_state)
 {
-   struct live_variables_state *state = void_state;
+   struct live_ssa_defs_state *state = void_state;
 
    block->live_in = reralloc(block, block->live_in, BITSET_WORD,
                              state->bitset_words);
@@ -129,7 +129,7 @@ set_ssa_def_dead(nir_ssa_def *def, void *void_live)
  */
 static bool
 propagate_across_edge(nir_block *pred, nir_block *succ,
-                      struct live_variables_state *state)
+                      struct live_ssa_defs_state *state)
 {
    NIR_VLA(BITSET_WORD, live, state->bitset_words);
    memcpy(live, succ->live_in, state->bitset_words * sizeof *live);
@@ -165,9 +165,9 @@ propagate_across_edge(nir_block *pred, nir_block *succ,
 }
 
 void
-nir_live_variables_impl(nir_function_impl *impl)
+nir_live_ssa_defs_impl(nir_function_impl *impl)
 {
-   struct live_variables_state state;
+   struct live_ssa_defs_state state;
 
    /* We start at 1 because we reserve the index value of 0 for ssa_undef
     * instructions.  Those are never live, so their liveness information
index dcd091ae2fa6e098f1cb36b246b4a379f068c95e..d549ee79bb4bfada96462f92f9344ea685be5f3a 100644 (file)
@@ -102,7 +102,7 @@ nir_lower_global_vars_to_local(nir_shader *shader)
          exec_list_push_tail(&impl->locals, &var->node);
          nir_metadata_preserve(impl, nir_metadata_block_index |
                                      nir_metadata_dominance |
-                                     nir_metadata_live_variables);
+                                     nir_metadata_live_ssa_defs);
          progress = true;
       }
    }
index a03e12456a18801e07592db38c65284986fe8799..6de981f430f7adf9451f4ce67a28eccc94401153 100644 (file)
@@ -39,8 +39,8 @@ nir_metadata_require(nir_function_impl *impl, nir_metadata required)
       nir_index_blocks(impl);
    if (NEEDS_UPDATE(nir_metadata_dominance))
       nir_calc_dominance_impl(impl);
-   if (NEEDS_UPDATE(nir_metadata_live_variables))
-      nir_live_variables_impl(impl);
+   if (NEEDS_UPDATE(nir_metadata_live_ssa_defs))
+      nir_live_ssa_defs_impl(impl);
 
 #undef NEEDS_UPDATE
 
index 0d4819b515813a75f30bd6667b2855570a06f0f8..356e926ffe38656d3abd1f446269f74813f417c0 100644 (file)
@@ -204,7 +204,7 @@ loop_is_dead(nir_loop *loop)
       return false;
 
    nir_function_impl *impl = nir_cf_node_get_function(&loop->cf_node);
-   nir_metadata_require(impl, nir_metadata_live_variables |
+   nir_metadata_require(impl, nir_metadata_live_ssa_defs |
                               nir_metadata_dominance);
 
    for (nir_block *cur = after->imm_dom; cur != before; cur = cur->imm_dom) {
index 530a8475ed5b46cf8c98c17f75cfad64bb30ccf0..8f0833c7e2474dc47453fec09ba8ef85130a5bdc 100644 (file)
@@ -130,7 +130,7 @@ nir_remove_dead_variables(nir_shader *shader)
          if (remove_dead_vars(&overload->impl->locals, live)) {
             nir_metadata_preserve(overload->impl, nir_metadata_block_index |
                                                   nir_metadata_dominance |
-                                                  nir_metadata_live_variables);
+                                                  nir_metadata_live_ssa_defs);
             progress = true;
          }
       }