mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 17:50:11 +01:00
nir: Rename live_variables to live_ssa_defs.
This computes liveness of SSA values, not nir_variables. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
parent
56774e6302
commit
5c6f21579d
7 changed files with 14 additions and 14 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue