summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-11-03 17:15:24 -0800
committerKenneth Graunke <[email protected]>2015-11-05 00:09:40 -0800
commit5c6f21579d7db802f4db96bae8b166e7409afabe (patch)
treed27e23f038aec66811092b93bab1f2327bd24a63 /src/glsl
parent56774e63028b2997a7d8c0abb5009a4c79f9a453 (diff)
nir: Rename live_variables to live_ssa_defs.
This computes liveness of SSA values, not nir_variables. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/nir/nir.h4
-rw-r--r--src/glsl/nir/nir_from_ssa.c2
-rw-r--r--src/glsl/nir/nir_live_variables.c12
-rw-r--r--src/glsl/nir/nir_lower_global_vars_to_local.c2
-rw-r--r--src/glsl/nir/nir_metadata.c4
-rw-r--r--src/glsl/nir/nir_opt_dead_cf.c2
-rw-r--r--src/glsl/nir/nir_remove_dead_variables.c2
7 files changed, 14 insertions, 14 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 874a03966be..f8de40d0d13 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -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);
diff --git a/src/glsl/nir/nir_from_ssa.c b/src/glsl/nir/nir_from_ssa.c
index eaf883dbaa0..f2797f72c8e 100644
--- a/src/glsl/nir/nir_from_ssa.c
+++ b/src/glsl/nir/nir_from_ssa.c
@@ -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);
diff --git a/src/glsl/nir/nir_live_variables.c b/src/glsl/nir/nir_live_variables.c
index 1c96dcf36c5..05f79d7bc61 100644
--- a/src/glsl/nir/nir_live_variables.c
+++ b/src/glsl/nir/nir_live_variables.c
@@ -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
diff --git a/src/glsl/nir/nir_lower_global_vars_to_local.c b/src/glsl/nir/nir_lower_global_vars_to_local.c
index dcd091ae2fa..d549ee79bb4 100644
--- a/src/glsl/nir/nir_lower_global_vars_to_local.c
+++ b/src/glsl/nir/nir_lower_global_vars_to_local.c
@@ -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;
}
}
diff --git a/src/glsl/nir/nir_metadata.c b/src/glsl/nir/nir_metadata.c
index a03e12456a1..6de981f430f 100644
--- a/src/glsl/nir/nir_metadata.c
+++ b/src/glsl/nir/nir_metadata.c
@@ -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
diff --git a/src/glsl/nir/nir_opt_dead_cf.c b/src/glsl/nir/nir_opt_dead_cf.c
index 0d4819b5158..356e926ffe3 100644
--- a/src/glsl/nir/nir_opt_dead_cf.c
+++ b/src/glsl/nir/nir_opt_dead_cf.c
@@ -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) {
diff --git a/src/glsl/nir/nir_remove_dead_variables.c b/src/glsl/nir/nir_remove_dead_variables.c
index 530a8475ed5..8f0833c7e24 100644
--- a/src/glsl/nir/nir_remove_dead_variables.c
+++ b/src/glsl/nir/nir_remove_dead_variables.c
@@ -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;
}
}