diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2014-12-12 16:22:46 -0800 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2014-12-17 21:08:12 -0800 |
commit | 39f1789c2e064fe6cb08c780b51a7cfc0ee28ad6 (patch) | |
tree | 391d1298312e4b3dec1b16d38b1e84faee0a2e26 | |
parent | 99ccf3ee9ac28263cf1c70665e46e245044fef95 (diff) |
nir/metadata: Rename metadata_dirty to metadata_preserve
nir_metadata_dirty was a terrible name because the parameter it takes is
the metadata to be preserved. This is really confusing because it looks
like it's doing the opposite of what it is actually doing. Now it's named
sensibly.
-rw-r--r-- | src/glsl/nir/nir.c | 10 | ||||
-rw-r--r-- | src/glsl/nir/nir.h | 2 | ||||
-rw-r--r-- | src/glsl/nir/nir_algebraic.py | 4 | ||||
-rw-r--r-- | src/glsl/nir/nir_from_ssa.c | 6 | ||||
-rw-r--r-- | src/glsl/nir/nir_lower_variables.c | 4 | ||||
-rw-r--r-- | src/glsl/nir/nir_metadata.c | 2 | ||||
-rw-r--r-- | src/glsl/nir/nir_opt_cse.c | 4 | ||||
-rw-r--r-- | src/glsl/nir/nir_opt_peephole_select.c | 2 |
8 files changed, 18 insertions, 16 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c index e8d7cd2c40..1f9905b72b 100644 --- a/src/glsl/nir/nir.c +++ b/src/glsl/nir/nir.c @@ -862,7 +862,7 @@ handle_jump(nir_block *block) unlink_block_successors(block); nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node); - nir_metadata_dirty(impl, nir_metadata_none); + nir_metadata_preserve(impl, nir_metadata_none); if (jump_instr->type == nir_jump_break || jump_instr->type == nir_jump_continue) { @@ -960,7 +960,7 @@ handle_remove_jump(nir_block *block, nir_jump_type type) } nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node); - nir_metadata_dirty(impl, nir_metadata_none); + nir_metadata_preserve(impl, nir_metadata_none); } /** @@ -1066,7 +1066,7 @@ nir_cf_node_insert_after(nir_cf_node *node, nir_cf_node *after) } nir_function_impl *impl = nir_cf_node_get_function(node); - nir_metadata_dirty(impl, nir_metadata_none); + nir_metadata_preserve(impl, nir_metadata_none); } void @@ -1108,7 +1108,7 @@ nir_cf_node_insert_before(nir_cf_node *node, nir_cf_node *before) } nir_function_impl *impl = nir_cf_node_get_function(node); - nir_metadata_dirty(impl, nir_metadata_none); + nir_metadata_preserve(impl, nir_metadata_none); } void @@ -1154,7 +1154,7 @@ void nir_cf_node_remove(nir_cf_node *node) { nir_function_impl *impl = nir_cf_node_get_function(node); - nir_metadata_dirty(impl, nir_metadata_none); + nir_metadata_preserve(impl, nir_metadata_none); if (node->type == nir_cf_node_block) { /* diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 179d45d78d..e1703bafbb 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -1288,7 +1288,7 @@ void nir_cf_node_remove(nir_cf_node *node); /** requests that the given pieces of metadata be generated */ void nir_metadata_require(nir_function_impl *impl, nir_metadata required); /** dirties all but the preserved metadata */ -void nir_metadata_dirty(nir_function_impl *impl, nir_metadata preserved); +void nir_metadata_preserve(nir_function_impl *impl, nir_metadata preserved); /** creates an instruction with default swizzle/writemask/etc. with NULL registers */ nir_alu_instr *nir_alu_instr_create(void *mem_ctx, nir_op op); diff --git a/src/glsl/nir/nir_algebraic.py b/src/glsl/nir/nir_algebraic.py index 7718a6d31c..24deacdb8d 100644 --- a/src/glsl/nir/nir_algebraic.py +++ b/src/glsl/nir/nir_algebraic.py @@ -210,8 +210,8 @@ ${pass_name}_impl(nir_function_impl *impl) nir_foreach_block(impl, ${pass_name}_block, &state); if (state.progress) - nir_metadata_dirty(impl, nir_metadata_block_index | - nir_metadata_dominance); + nir_metadata_preserve(impl, nir_metadata_block_index | + nir_metadata_dominance); return state.progress; } diff --git a/src/glsl/nir/nir_from_ssa.c b/src/glsl/nir/nir_from_ssa.c index 5c3f67ebdb..bc17c344ff 100644 --- a/src/glsl/nir/nir_from_ssa.c +++ b/src/glsl/nir/nir_from_ssa.c @@ -832,8 +832,10 @@ nir_convert_from_ssa_impl(nir_function_impl *impl) nir_foreach_block(impl, isolate_phi_nodes_block, &state); - nir_metadata_dirty(impl, nir_metadata_block_index | - nir_metadata_dominance); + /* Mark metadata as dirty before we ask for liveness analysis */ + nir_metadata_preserve(impl, nir_metadata_block_index | + nir_metadata_dominance); + nir_metadata_require(impl, nir_metadata_live_variables | nir_metadata_dominance); diff --git a/src/glsl/nir/nir_lower_variables.c b/src/glsl/nir/nir_lower_variables.c index dab3639908..9307a671c4 100644 --- a/src/glsl/nir/nir_lower_variables.c +++ b/src/glsl/nir/nir_lower_variables.c @@ -1027,8 +1027,8 @@ nir_lower_variables_impl(nir_function_impl *impl) insert_phi_nodes(&state); nir_foreach_block(impl, lower_deref_to_ssa_block, &state); - nir_metadata_dirty(impl, nir_metadata_block_index | - nir_metadata_dominance); + nir_metadata_preserve(impl, nir_metadata_block_index | + nir_metadata_dominance); ralloc_free(state.dead_ctx); diff --git a/src/glsl/nir/nir_metadata.c b/src/glsl/nir/nir_metadata.c index a4d618ccc0..a03e12456a 100644 --- a/src/glsl/nir/nir_metadata.c +++ b/src/glsl/nir/nir_metadata.c @@ -48,7 +48,7 @@ nir_metadata_require(nir_function_impl *impl, nir_metadata required) } void -nir_metadata_dirty(nir_function_impl *impl, nir_metadata preserved) +nir_metadata_preserve(nir_function_impl *impl, nir_metadata preserved) { impl->valid_metadata &= preserved; } diff --git a/src/glsl/nir/nir_opt_cse.c b/src/glsl/nir/nir_opt_cse.c index 2447fe9cfc..14bd6bf50e 100644 --- a/src/glsl/nir/nir_opt_cse.c +++ b/src/glsl/nir/nir_opt_cse.c @@ -249,8 +249,8 @@ nir_opt_cse_impl(nir_function_impl *impl) nir_foreach_block(impl, nir_opt_cse_block, &state); if (state.progress) - nir_metadata_dirty(impl, nir_metadata_block_index | - nir_metadata_dominance); + nir_metadata_preserve(impl, nir_metadata_block_index | + nir_metadata_dominance); return state.progress; } diff --git a/src/glsl/nir/nir_opt_peephole_select.c b/src/glsl/nir/nir_opt_peephole_select.c index 4fc7726a85..247fe050a7 100644 --- a/src/glsl/nir/nir_opt_peephole_select.c +++ b/src/glsl/nir/nir_opt_peephole_select.c @@ -193,7 +193,7 @@ nir_opt_peephole_select_impl(nir_function_impl *impl) nir_foreach_block(impl, nir_opt_peephole_select_block, &state); if (state.progress) - nir_metadata_dirty(impl, nir_metadata_none); + nir_metadata_preserve(impl, nir_metadata_none); return state.progress; } |