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) {
}
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);
}
/**
}
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
}
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
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) {
/*
/** 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);
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;
}
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);
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);
}
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;
}
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;
}
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;
}