nir/metadata: Rename metadata_dirty to metadata_preserve
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 13 Dec 2014 00:22:46 +0000 (16:22 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 15 Jan 2015 15:20:21 +0000 (07:20 -0800)
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.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir.c
src/glsl/nir/nir.h
src/glsl/nir/nir_algebraic.py
src/glsl/nir/nir_from_ssa.c
src/glsl/nir/nir_lower_variables.c
src/glsl/nir/nir_metadata.c
src/glsl/nir/nir_opt_cse.c
src/glsl/nir/nir_opt_peephole_select.c

index 3a64135d94e46b71b45a02ff59a904186c4fd1fa..cb788d47259954c61aef308f625583251fd1fcca 100644 (file)
@@ -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) {
       /*
index fe1f9a8682ead3e34a0dfcfd0acbca15511ce757..822e2ae414c842ca3641b1aba375567598e0fbeb 100644 (file)
@@ -1287,7 +1287,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);
index 703102fc5cab1bd2e2b1850bd56a5d593755f151..72703beea8a2eb8693a9bb8393e1d17a17e8aaf4 100644 (file)
@@ -216,8 +216,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;
 }
index 9b7c931c072a86b7a5b32efa19f8ac234c49382d..f99ba9b7828bb07a536dcda3f225519e26c79ab1 100644 (file)
@@ -827,8 +827,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);
 
index 8c231240183c6d211104d57943c8ba03a45e933e..b8961f85ce889ede19eb7fdaecb50186454c598f 100644 (file)
@@ -1022,8 +1022,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);
 
index a4d618ccc05da96da2d007a8d303a73258e1bd79..a03e12456a18801e07592db38c65284986fe8799 100644 (file)
@@ -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;
 }
index 2447fe9cfc054229c5b4c05be30fac554d98a5da..14bd6bf50e62ed716121866ea12d829a7872481a 100644 (file)
@@ -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;
 }
index 4fc7726a85a34ab4de9b0cbcce98911761b8e909..247fe050a70d165b419db9f2c54a4d1e908b175d 100644 (file)
@@ -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;
 }