Commit b6c81b3f authored by Jason Ekstrand's avatar Jason Ekstrand
Browse files

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.
Reviewed-by: default avatarConnor Abbott <cwabbott0@gmail.com>
parent 3c2c0a16
......@@ -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) {
/*
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
}
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment