nir: s/live_ssa_def/live_def/
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 15 Aug 2023 15:11:43 +0000 (10:11 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 15 Aug 2023 17:44:27 +0000 (17:44 +0000)
Generated mostly with sed:

    sed -i -e 's/live_ssa_def/live_def/g' src/compiler/nir/nir.h src/compiler/nir/*.c

Plus three fixups in various Intel drivers.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24703>

20 files changed:
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_deref.c
src/compiler/nir/nir_from_ssa.c
src/compiler/nir/nir_liveness.c
src/compiler/nir/nir_lower_clip_cull_distance_arrays.c
src/compiler/nir/nir_lower_discard_or_demote.c
src/compiler/nir/nir_lower_global_vars_to_local.c
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_lower_shader_calls.c
src/compiler/nir/nir_lower_variable_initializers.c
src/compiler/nir/nir_metadata.c
src/compiler/nir/nir_opt_access.c
src/compiler/nir/nir_opt_barriers.c
src/compiler/nir/nir_opt_load_store_vectorize.c
src/compiler/nir/nir_opt_move.c
src/compiler/nir/nir_propagate_invariant.c
src/gallium/drivers/crocus/crocus_program.c
src/gallium/drivers/iris/iris_program.c
src/intel/compiler/brw_nir_blockify_uniform_loads.c

index 466b359..8d1a409 100644 (file)
@@ -1046,7 +1046,7 @@ add_ssa_def_cb(nir_def *def, void *state)
 
       def->index = impl->ssa_alloc++;
 
-      impl->valid_metadata &= ~nir_metadata_live_ssa_defs;
+      impl->valid_metadata &= ~nir_metadata_live_defs;
    }
 
    return true;
@@ -1516,7 +1516,7 @@ nir_def_init(nir_instr *instr, nir_def *def,
 
       def->index = impl->ssa_alloc++;
 
-      impl->valid_metadata &= ~nir_metadata_live_ssa_defs;
+      impl->valid_metadata &= ~nir_metadata_live_defs;
    } else {
       def->index = UINT_MAX;
    }
@@ -1921,7 +1921,7 @@ nir_index_ssa_defs(nir_function_impl *impl)
 {
    unsigned index = 0;
 
-   impl->valid_metadata &= ~nir_metadata_live_ssa_defs;
+   impl->valid_metadata &= ~nir_metadata_live_defs;
 
    nir_foreach_block_unstructured(block, impl) {
       nir_foreach_instr(instr, block)
index 03231d7..9814a83 100644 (file)
@@ -3034,7 +3034,7 @@ typedef enum {
     * SSA defs or uses of SSA defs (most passes shouldn't preserve this
     * metadata type).
     */
-   nir_metadata_live_ssa_defs = 0x4,
+   nir_metadata_live_defs = 0x4,
 
    /** A dummy metadata value to track when a pass forgot to call
     * nir_metadata_preserve.
@@ -5825,9 +5825,9 @@ bool nir_normalize_cubemap_coords(nir_shader *shader);
 
 bool nir_shader_supports_implicit_lod(nir_shader *shader);
 
-void nir_live_ssa_defs_impl(nir_function_impl *impl);
+void nir_live_defs_impl(nir_function_impl *impl);
 
-const BITSET_WORD *nir_get_live_ssa_defs(nir_cursor cursor, void *mem_ctx);
+const BITSET_WORD *nir_get_live_defs(nir_cursor cursor, void *mem_ctx);
 
 void nir_loop_analyze_impl(nir_function_impl *impl,
                            nir_variable_mode indirect_mask,
index 749e98f..66601dc 100644 (file)
@@ -453,7 +453,7 @@ nir_fixup_deref_modes(nir_shader *shader)
    nir_shader_instructions_pass(shader, nir_fixup_deref_modes_instr,
                                 nir_metadata_block_index |
                                    nir_metadata_dominance |
-                                   nir_metadata_live_ssa_defs |
+                                   nir_metadata_live_defs |
                                    nir_metadata_instr_index,
                                 NULL);
 }
index e35f9ae..5d63df4 100644 (file)
@@ -1044,7 +1044,7 @@ nir_convert_from_ssa_impl(nir_function_impl *impl,
                                   nir_metadata_dominance);
 
    nir_metadata_require(impl, nir_metadata_instr_index |
-                                 nir_metadata_live_ssa_defs |
+                                 nir_metadata_live_defs |
                                  nir_metadata_dominance);
 
    nir_foreach_block(block, impl) {
index 53dba18..2202553 100644 (file)
@@ -39,7 +39,7 @@
  * block but not in the live-in of the block containing the phi node.
  */
 
-struct live_ssa_defs_state {
+struct live_defs_state {
    unsigned bitset_words;
 
    /* Used in propagate_across_edge() */
@@ -53,7 +53,7 @@ struct live_ssa_defs_state {
  */
 static void
 init_liveness_block(nir_block *block,
-                    struct live_ssa_defs_state *state)
+                    struct live_defs_state *state)
 {
    block->live_in = reralloc(block, block->live_in, BITSET_WORD,
                              state->bitset_words);
@@ -100,7 +100,7 @@ set_ssa_def_dead(nir_def *def, void *void_live)
  */
 static bool
 propagate_across_edge(nir_block *pred, nir_block *succ,
-                      struct live_ssa_defs_state *state)
+                      struct live_defs_state *state)
 {
    BITSET_WORD *live = state->tmp_live;
    memcpy(live, succ->live_in, state->bitset_words * sizeof *live);
@@ -127,9 +127,9 @@ propagate_across_edge(nir_block *pred, nir_block *succ,
 }
 
 void
-nir_live_ssa_defs_impl(nir_function_impl *impl)
+nir_live_defs_impl(nir_function_impl *impl)
 {
-   struct live_ssa_defs_state state = {
+   struct live_defs_state state = {
       .bitset_words = BITSET_WORDS(impl->ssa_alloc),
    };
    state.tmp_live = rzalloc_array(impl, BITSET_WORD, state.bitset_words),
@@ -203,11 +203,11 @@ nir_live_ssa_defs_impl(nir_function_impl *impl)
  *       instead, provide a mem_ctx and free that.
  */
 const BITSET_WORD *
-nir_get_live_ssa_defs(nir_cursor cursor, void *mem_ctx)
+nir_get_live_defs(nir_cursor cursor, void *mem_ctx)
 {
    nir_block *block = nir_cursor_current_block(cursor);
    nir_function_impl *impl = nir_cf_node_get_function(&block->cf_node);
-   assert(impl->valid_metadata & nir_metadata_live_ssa_defs);
+   assert(impl->valid_metadata & nir_metadata_live_defs);
 
    switch (cursor.option) {
    case nir_cursor_before_block:
index 6c344e8..4d7b669 100644 (file)
@@ -144,7 +144,7 @@ nir_lower_clip_cull_distance_arrays(nir_shader *nir)
          nir_metadata_preserve(impl,
                                nir_metadata_block_index |
                                   nir_metadata_dominance |
-                                  nir_metadata_live_ssa_defs |
+                                  nir_metadata_live_defs |
                                   nir_metadata_loop_analysis);
       } else {
          nir_metadata_preserve(impl, nir_metadata_all);
index d9a4cf6..81c9239 100644 (file)
@@ -165,7 +165,7 @@ nir_lower_discard_or_demote(nir_shader *shader,
                                               nir_lower_discard_to_demote_instr,
                                               nir_metadata_block_index |
                                                  nir_metadata_dominance |
-                                                 nir_metadata_live_ssa_defs |
+                                                 nir_metadata_live_defs |
                                                  nir_metadata_instr_index,
                                               NULL);
       shader->info.fs.uses_demote = true;
index 858e96a..589a7be 100644 (file)
@@ -90,7 +90,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_ssa_defs);
+                                        nir_metadata_live_defs);
          progress = true;
       }
    }
index b0a042d..096188e 100644 (file)
@@ -2390,7 +2390,7 @@ nir_lower_vars_to_explicit_types_impl(nir_function_impl *impl,
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                      nir_metadata_dominance |
-                                     nir_metadata_live_ssa_defs |
+                                     nir_metadata_live_defs |
                                      nir_metadata_loop_analysis);
    } else {
       nir_metadata_preserve(impl, nir_metadata_all);
index 6a15c31..21ea866 100644 (file)
@@ -450,7 +450,7 @@ spill_ssa_defs_and_lower_shader_calls(nir_shader *shader, uint32_t num_calls,
     */
    nir_function_impl *impl = nir_shader_get_entrypoint(shader);
 
-   nir_metadata_require(impl, nir_metadata_live_ssa_defs |
+   nir_metadata_require(impl, nir_metadata_live_defs |
                                  nir_metadata_dominance |
                                  nir_metadata_block_index |
                                  nir_metadata_instr_index);
@@ -504,7 +504,7 @@ spill_ssa_defs_and_lower_shader_calls(nir_shader *shader, uint32_t num_calls,
           * TODO: This isn't quite true for report_intersection.
           */
          call_live[call_idx] =
-            nir_get_live_ssa_defs(nir_after_instr(instr), mem_ctx);
+            nir_get_live_defs(nir_after_instr(instr), mem_ctx);
 
          call_idx++;
       }
index ae37ece..7d12502 100644 (file)
@@ -121,7 +121,7 @@ nir_lower_variable_initializers(nir_shader *shader, nir_variable_mode modes)
          progress = true;
          nir_metadata_preserve(impl, nir_metadata_block_index |
                                         nir_metadata_dominance |
-                                        nir_metadata_live_ssa_defs);
+                                        nir_metadata_live_defs);
       } else {
          nir_metadata_preserve(impl, nir_metadata_all);
       }
index 5419d02..e008599 100644 (file)
@@ -38,8 +38,8 @@ nir_metadata_require(nir_function_impl *impl, nir_metadata required, ...)
       nir_index_instrs(impl);
    if (NEEDS_UPDATE(nir_metadata_dominance))
       nir_calc_dominance_impl(impl);
-   if (NEEDS_UPDATE(nir_metadata_live_ssa_defs))
-      nir_live_ssa_defs_impl(impl);
+   if (NEEDS_UPDATE(nir_metadata_live_defs))
+      nir_live_defs_impl(impl);
    if (NEEDS_UPDATE(nir_metadata_loop_analysis)) {
       va_list ap;
       va_start(ap, required);
index eebf872..86ada23 100644 (file)
@@ -281,7 +281,7 @@ opt_access_impl(struct access_state *state,
       nir_metadata_preserve(impl,
                             nir_metadata_block_index |
                                nir_metadata_dominance |
-                               nir_metadata_live_ssa_defs |
+                               nir_metadata_live_defs |
                                nir_metadata_loop_analysis);
    }
 
@@ -328,7 +328,7 @@ nir_opt_access(nir_shader *shader, const nir_opt_access_options *options)
          nir_metadata_preserve(impl,
                                nir_metadata_block_index |
                                   nir_metadata_dominance |
-                                  nir_metadata_live_ssa_defs |
+                                  nir_metadata_live_defs |
                                   nir_metadata_loop_analysis);
       }
    }
index 4cc1c8e..21eeb2d 100644 (file)
@@ -70,7 +70,7 @@ nir_opt_combine_barriers_impl(
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                      nir_metadata_dominance |
-                                     nir_metadata_live_ssa_defs);
+                                     nir_metadata_live_defs);
    } else {
       nir_metadata_preserve(impl, nir_metadata_all);
    }
index be1a0dd..b8927de 100644 (file)
@@ -1466,7 +1466,7 @@ nir_opt_load_store_vectorize(nir_shader *shader, const nir_load_store_vectorize_
       nir_metadata_preserve(impl,
                             nir_metadata_block_index |
                                nir_metadata_dominance |
-                               nir_metadata_live_ssa_defs);
+                               nir_metadata_live_defs);
    }
 
    ralloc_free(ctx);
index f55d68b..7fbb986 100644 (file)
@@ -137,7 +137,7 @@ nir_opt_move(nir_shader *shader, nir_move_options options)
       if (impl_progress) {
          nir_metadata_preserve(impl, nir_metadata_block_index |
                                         nir_metadata_dominance |
-                                        nir_metadata_live_ssa_defs);
+                                        nir_metadata_live_defs);
          progress = true;
       } else {
          nir_metadata_preserve(impl, nir_metadata_all);
index cea54e2..2492794 100644 (file)
@@ -174,7 +174,7 @@ propagate_invariant_impl(nir_function_impl *impl, struct set *invariants)
    if (progress) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                      nir_metadata_dominance |
-                                     nir_metadata_live_ssa_defs);
+                                     nir_metadata_live_defs);
    } else {
       nir_metadata_preserve(impl, nir_metadata_all);
    }
index cfe68ce..79883c6 100644 (file)
@@ -343,7 +343,7 @@ crocus_fix_edge_flags(nir_shader *nir)
    nir_foreach_function_impl(impl, nir) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                             nir_metadata_dominance |
-                            nir_metadata_live_ssa_defs |
+                            nir_metadata_live_defs |
                             nir_metadata_loop_analysis);
    }
 
index fb1ee90..0ed4806 100644 (file)
@@ -352,7 +352,7 @@ iris_fix_edge_flags(nir_shader *nir)
    nir_foreach_function_impl(impl, nir) {
       nir_metadata_preserve(impl, nir_metadata_block_index |
                                   nir_metadata_dominance |
-                                  nir_metadata_live_ssa_defs |
+                                  nir_metadata_live_defs |
                                   nir_metadata_loop_analysis);
    }
 
index 4224f61..01953d1 100644 (file)
@@ -110,6 +110,6 @@ brw_nir_blockify_uniform_loads(nir_shader *shader,
                                        brw_nir_blockify_uniform_loads_instr,
                                        nir_metadata_block_index |
                                        nir_metadata_dominance |
-                                       nir_metadata_live_ssa_defs,
+                                       nir_metadata_live_defs,
                                        (void *) devinfo);
 }