nir: Rename nir_instr_type_ssa_undef to nir_instr_type_undef
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Tue, 15 Aug 2023 14:59:06 +0000 (09:59 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 15 Aug 2023 17:44:27 +0000 (17:44 +0000)
We already renamed the type, we just need to rename the enum and the
casting helper functions.

Generated with sed:

    sed -i -e 's/nir_instr_type_ssa_undef/nir_instr_type_undef/g' src/**/*.h src/**/*.c src/**/*.cpp
    sed -i -e 's/nir_instr_as_ssa_undef/nir_instr_as_undef/g' src/**/*.h src/**/*.c src/**/*.cpp

and two tiny whitespace fixups in lima.

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

60 files changed:
src/amd/common/ac_nir_opt_outputs.c
src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_instruction_selection_setup.cpp
src/amd/llvm/ac_nir_to_llvm.c
src/asahi/compiler/agx_compile.c
src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/vir.c
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_clone.c
src/compiler/nir/nir_divergence_analysis.c
src/compiler/nir/nir_from_ssa.c
src/compiler/nir/nir_group_loads.c
src/compiler/nir/nir_inline_helpers.h
src/compiler/nir/nir_instr_set.c
src/compiler/nir/nir_liveness.c
src/compiler/nir/nir_lower_array_deref_of_vec.c
src/compiler/nir/nir_lower_bool_to_bitsize.c
src/compiler/nir/nir_lower_bool_to_float.c
src/compiler/nir/nir_lower_bool_to_int32.c
src/compiler/nir/nir_lower_int_to_float.c
src/compiler/nir/nir_lower_phis_to_scalar.c
src/compiler/nir/nir_lower_shader_calls.c
src/compiler/nir/nir_lower_undef_to_zero.c
src/compiler/nir/nir_lower_vec_to_regs.c
src/compiler/nir/nir_opt_dce.c
src/compiler/nir/nir_opt_gcm.c
src/compiler/nir/nir_opt_if.c
src/compiler/nir/nir_opt_move_discards_to_top.c
src/compiler/nir/nir_opt_peephole_select.c
src/compiler/nir/nir_opt_preamble.c
src/compiler/nir/nir_opt_shrink_vectors.c
src/compiler/nir/nir_opt_sink.c
src/compiler/nir/nir_opt_undef.c
src/compiler/nir/nir_print.c
src/compiler/nir/nir_propagate_invariant.c
src/compiler/nir/nir_schedule.c
src/compiler/nir/nir_serialize.c
src/compiler/nir/nir_to_lcssa.c
src/compiler/nir/nir_trivialize_registers.c
src/compiler/nir/nir_validate.c
src/freedreno/ir3/ir3_compiler_nir.c
src/freedreno/ir3/ir3_nir_lower_64b.c
src/freedreno/ir3/ir3_nir_move_varying_inputs.c
src/gallium/auxiliary/gallivm/lp_bld_nir.c
src/gallium/auxiliary/nir/nir_to_tgsi.c
src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c
src/gallium/drivers/etnaviv/etnaviv_compiler_nir_liveness.c
src/gallium/drivers/freedreno/a2xx/ir2_nir.c
src/gallium/drivers/lima/ir/gp/nir.c
src/gallium/drivers/lima/ir/pp/nir.c
src/gallium/drivers/r600/sfn/sfn_instrfactory.cpp
src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp
src/gallium/drivers/vc4/vc4_program.c
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/intel/compiler/brw_fs_nir.cpp
src/intel/compiler/brw_vec4_nir.cpp
src/microsoft/compiler/nir_to_dxil.c
src/nouveau/codegen/nv50_ir_from_nir.cpp
src/panfrost/midgard/midgard_compile.c

index aa4b4f5..b622a1b 100644 (file)
@@ -271,7 +271,7 @@ bool ac_nir_optimize_outputs(nir_shader *nir, bool sprite_tex_disallowed,
          /* nir_lower_io_to_scalar is required before this */
          assert(intr->src[0].ssa->num_components == 1);
          /* No intrinsic should store undef. */
-         assert(intr->src[0].ssa->parent_instr->type != nir_instr_type_ssa_undef);
+         assert(intr->src[0].ssa->parent_instr->type != nir_instr_type_undef);
 
          /* Gather the output. */
          struct ac_out_info *out_info = &outputs[sem.location];
index 7226565..b22111f 100644 (file)
@@ -9742,7 +9742,7 @@ Operand
 get_phi_operand(isel_context* ctx, nir_def* ssa, RegClass rc, bool logical)
 {
    Temp tmp = get_ssa_temp(ctx, ssa);
-   if (ssa->parent_instr->type == nir_instr_type_ssa_undef) {
+   if (ssa->parent_instr->type == nir_instr_type_undef) {
       return Operand(rc);
    } else if (logical && ssa->bit_size == 1 &&
               ssa->parent_instr->type == nir_instr_type_load_const) {
@@ -10093,7 +10093,7 @@ visit_block(isel_context* ctx, nir_block* block)
       case nir_instr_type_intrinsic: visit_intrinsic(ctx, nir_instr_as_intrinsic(instr)); break;
       case nir_instr_type_tex: visit_tex(ctx, nir_instr_as_tex(instr)); break;
       case nir_instr_type_phi: visit_phi(ctx, nir_instr_as_phi(instr)); break;
-      case nir_instr_type_ssa_undef: visit_undef(ctx, nir_instr_as_ssa_undef(instr)); break;
+      case nir_instr_type_undef: visit_undef(ctx, nir_instr_as_undef(instr)); break;
       case nir_instr_type_deref: break;
       case nir_instr_type_jump: visit_jump(ctx, nir_instr_as_jump(instr)); break;
       default: isel_err(instr, "Unknown NIR instr type");
index a524069..c87572a 100644 (file)
@@ -590,11 +590,11 @@ init_context(isel_context* ctx, nir_shader* shader)
                regclasses[tex->def.index] = rc;
                break;
             }
-            case nir_instr_type_ssa_undef: {
-               unsigned num_components = nir_instr_as_ssa_undef(instr)->def.num_components;
-               unsigned bit_size = nir_instr_as_ssa_undef(instr)->def.bit_size;
+            case nir_instr_type_undef: {
+               unsigned num_components = nir_instr_as_undef(instr)->def.num_components;
+               unsigned bit_size = nir_instr_as_undef(instr)->def.bit_size;
                RegClass rc = get_reg_class(ctx, RegType::sgpr, num_components, bit_size);
-               regclasses[nir_instr_as_ssa_undef(instr)->def.index] = rc;
+               regclasses[nir_instr_as_undef(instr)->def.index] = rc;
                break;
             }
             case nir_instr_type_phi: {
index cc16a1f..3d62d8d 100644 (file)
@@ -4227,8 +4227,8 @@ static bool visit_block(struct ac_nir_context *ctx, nir_block *block)
          break;
       case nir_instr_type_phi:
          break;
-      case nir_instr_type_ssa_undef:
-         visit_ssa_undef(ctx, nir_instr_as_ssa_undef(instr));
+      case nir_instr_type_undef:
+         visit_ssa_undef(ctx, nir_instr_as_undef(instr));
          break;
       case nir_instr_type_jump:
          if (!visit_jump(&ctx->ac, nir_instr_as_jump(instr)))
index d662973..405f75b 100644 (file)
@@ -1834,8 +1834,8 @@ agx_emit_instr(agx_builder *b, struct nir_instr *instr)
       agx_emit_phi(b, nir_instr_as_phi(instr));
       break;
 
-   case nir_instr_type_ssa_undef:
-      agx_emit_undef(b, nir_instr_as_ssa_undef(instr));
+   case nir_instr_type_undef:
+      agx_emit_undef(b, nir_instr_as_undef(instr));
       break;
 
    default:
index 4120b3d..89d58f9 100644 (file)
@@ -3820,7 +3820,7 @@ is_cheap_block(nir_block *block)
         nir_foreach_instr(instr, block) {
                 switch (instr->type) {
                 case nir_instr_type_alu:
-                case nir_instr_type_ssa_undef:
+                case nir_instr_type_undef:
                 case nir_instr_type_load_const:
                         if (--cost <= 0)
                                 return false;
@@ -4129,7 +4129,7 @@ ntq_emit_instr(struct v3d_compile *c, nir_instr *instr)
                 ntq_emit_load_const(c, nir_instr_as_load_const(instr));
                 break;
 
-        case nir_instr_type_ssa_undef:
+        case nir_instr_type_undef:
                 unreachable("Should've been lowered by nir_lower_undef_to_zero");
                 break;
 
index c997b67..a9c928f 100644 (file)
@@ -1157,7 +1157,7 @@ v3d_instr_delay_cb(nir_instr *instr, void *data)
    struct v3d_compile *c = (struct v3d_compile *) data;
 
    switch (instr->type) {
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_load_const:
    case nir_instr_type_alu:
    case nir_instr_type_deref:
index 4ae14bb..466b359 100644 (file)
@@ -876,7 +876,7 @@ nir_undef_instr_create(nir_shader *shader,
                        unsigned bit_size)
 {
    nir_undef_instr *instr = gc_alloc(shader->gctx, nir_undef_instr, 1);
-   instr_init(&instr->instr, nir_instr_type_ssa_undef);
+   instr_init(&instr->instr, nir_instr_type_undef);
 
    nir_def_init(&instr->instr, &instr->def, num_components, bit_size);
 
@@ -1316,8 +1316,8 @@ nir_instr_ssa_def(nir_instr *instr)
    case nir_instr_type_load_const:
       return &nir_instr_as_load_const(instr)->def;
 
-   case nir_instr_type_ssa_undef:
-      return &nir_instr_as_ssa_undef(instr)->def;
+   case nir_instr_type_undef:
+      return &nir_instr_as_undef(instr)->def;
 
    case nir_instr_type_call:
    case nir_instr_type_jump:
index 7402d40..d361c52 100644 (file)
@@ -895,7 +895,7 @@ typedef enum ENUM_PACKED {
    nir_instr_type_intrinsic,
    nir_instr_type_load_const,
    nir_instr_type_jump,
-   nir_instr_type_ssa_undef,
+   nir_instr_type_undef,
    nir_instr_type_phi,
    nir_instr_type_parallel_copy,
 } nir_instr_type;
@@ -1069,7 +1069,7 @@ nir_src_is_const(nir_src src)
 static inline bool
 nir_src_is_undef(nir_src src)
 {
-   return src.ssa->parent_instr->type == nir_instr_type_ssa_undef;
+   return src.ssa->parent_instr->type == nir_instr_type_undef;
 }
 
 static inline bool
@@ -2518,8 +2518,8 @@ NIR_DEFINE_CAST(nir_instr_as_intrinsic, nir_instr, nir_intrinsic_instr, instr,
                 type, nir_instr_type_intrinsic)
 NIR_DEFINE_CAST(nir_instr_as_load_const, nir_instr, nir_load_const_instr, instr,
                 type, nir_instr_type_load_const)
-NIR_DEFINE_CAST(nir_instr_as_ssa_undef, nir_instr, nir_undef_instr, instr,
-                type, nir_instr_type_ssa_undef)
+NIR_DEFINE_CAST(nir_instr_as_undef, nir_instr, nir_undef_instr, instr,
+                type, nir_instr_type_undef)
 NIR_DEFINE_CAST(nir_instr_as_phi, nir_instr, nir_phi_instr, instr,
                 type, nir_instr_type_phi)
 NIR_DEFINE_CAST(nir_instr_as_parallel_copy, nir_instr,
@@ -2566,7 +2566,7 @@ nir_scalar_is_const(nir_scalar s)
 static inline bool
 nir_scalar_is_undef(nir_scalar s)
 {
-   return s.def->parent_instr->type == nir_instr_type_ssa_undef;
+   return s.def->parent_instr->type == nir_instr_type_undef;
 }
 
 static inline nir_const_value
index 488d322..d0ac3be 100644 (file)
@@ -434,8 +434,8 @@ clone_instr(clone_state *state, const nir_instr *instr)
       return &clone_intrinsic(state, nir_instr_as_intrinsic(instr))->instr;
    case nir_instr_type_load_const:
       return &clone_load_const(state, nir_instr_as_load_const(instr))->instr;
-   case nir_instr_type_ssa_undef:
-      return &clone_ssa_undef(state, nir_instr_as_ssa_undef(instr))->instr;
+   case nir_instr_type_undef:
+      return &clone_ssa_undef(state, nir_instr_as_undef(instr))->instr;
    case nir_instr_type_tex:
       return &clone_tex(state, nir_instr_as_tex(instr))->instr;
    case nir_instr_type_phi:
index b22e2a7..4e39db8 100644 (file)
@@ -791,8 +791,8 @@ update_instr_divergence(nir_shader *shader, nir_instr *instr)
       return visit_tex(nir_instr_as_tex(instr));
    case nir_instr_type_load_const:
       return visit_load_const(nir_instr_as_load_const(instr));
-   case nir_instr_type_ssa_undef:
-      return visit_ssa_undef(nir_instr_as_ssa_undef(instr));
+   case nir_instr_type_undef:
+      return visit_ssa_undef(nir_instr_as_undef(instr));
    case nir_instr_type_deref:
       return visit_deref(shader, nir_instr_as_deref(instr));
    case nir_instr_type_jump:
@@ -844,7 +844,7 @@ visit_if_merge_phi(nir_phi_instr *phi, bool if_cond_divergent)
          phi->def.divergent = true;
          return true;
       }
-      if (src->src.ssa->parent_instr->type != nir_instr_type_ssa_undef) {
+      if (src->src.ssa->parent_instr->type != nir_instr_type_undef) {
          defined_srcs++;
       }
    }
index a3eaca9..e35f9ae 100644 (file)
@@ -58,10 +58,10 @@ struct from_ssa_state {
 static bool
 def_after(nir_def *a, nir_def *b)
 {
-   if (a->parent_instr->type == nir_instr_type_ssa_undef)
+   if (a->parent_instr->type == nir_instr_type_undef)
       return false;
 
-   if (b->parent_instr->type == nir_instr_type_ssa_undef)
+   if (b->parent_instr->type == nir_instr_type_undef)
       return true;
 
    /* If they're in the same block, we can rely on whichever instruction
@@ -79,7 +79,7 @@ def_after(nir_def *a, nir_def *b)
 static bool
 ssa_def_dominates(nir_def *a, nir_def *b)
 {
-   if (a->parent_instr->type == nir_instr_type_ssa_undef) {
+   if (a->parent_instr->type == nir_instr_type_undef) {
       /* SSA undefs always dominate */
       return true;
    }
@@ -572,7 +572,7 @@ static bool
 def_replace_with_reg(nir_def *def, nir_function_impl *impl)
 {
    /* These are handled elsewhere */
-   assert(def->parent_instr->type != nir_instr_type_ssa_undef &&
+   assert(def->parent_instr->type != nir_instr_type_undef &&
           def->parent_instr->type != nir_instr_type_load_const);
 
    nir_builder b = nir_builder_create(impl);
@@ -1246,9 +1246,9 @@ nir_lower_ssa_defs_to_regs_block(nir_block *block)
    const unsigned num_ssa = impl->ssa_alloc;
 
    nir_foreach_instr_safe(instr, block) {
-      if (instr->type == nir_instr_type_ssa_undef) {
+      if (instr->type == nir_instr_type_undef) {
          /* Undefs are just a read of something never written. */
-         nir_undef_instr *undef = nir_instr_as_ssa_undef(instr);
+         nir_undef_instr *undef = nir_instr_as_undef(instr);
          nir_def *reg = decl_reg_for_ssa_def(&b, &undef->def);
          nir_rewrite_uses_to_load_reg(&b, &undef->def, reg);
       } else if (instr->type == nir_instr_type_load_const) {
index 3d8abc7..b6bac0c 100644 (file)
@@ -127,7 +127,7 @@ can_move(nir_instr *instr, uint8_t current_indirection_level)
        instr->type == nir_instr_type_deref ||
        instr->type == nir_instr_type_tex ||
        instr->type == nir_instr_type_load_const ||
-       instr->type == nir_instr_type_ssa_undef)
+       instr->type == nir_instr_type_undef)
       return true;
 
    if (instr->type == nir_instr_type_intrinsic &&
index d05b9a7..d4f0303 100644 (file)
@@ -29,8 +29,8 @@ _nir_foreach_def(nir_instr *instr, nir_foreach_def_cb cb, void *state)
 
    case nir_instr_type_load_const:
       return cb(&nir_instr_as_load_const(instr)->def, state);
-   case nir_instr_type_ssa_undef:
-      return cb(&nir_instr_as_ssa_undef(instr)->def, state);
+   case nir_instr_type_undef:
+      return cb(&nir_instr_as_undef(instr)->def, state);
 
    case nir_instr_type_call:
    case nir_instr_type_jump:
@@ -133,7 +133,7 @@ nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state)
    }
 
    case nir_instr_type_load_const:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       return true;
 
    default:
index c87992f..ad0558d 100644 (file)
@@ -45,7 +45,7 @@ instr_can_rewrite(const nir_instr *instr)
       return nir_intrinsic_can_reorder(nir_instr_as_intrinsic(instr));
    case nir_instr_type_call:
    case nir_instr_type_jump:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       return false;
    case nir_instr_type_parallel_copy:
    default:
@@ -703,7 +703,7 @@ nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2)
    }
    case nir_instr_type_call:
    case nir_instr_type_jump:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_parallel_copy:
    default:
       unreachable("Invalid instruction type");
index 2814e53..53dba18 100644 (file)
@@ -315,8 +315,8 @@ nir_defs_interfere(nir_def *a, nir_def *b)
        * least one isn't dead.
        */
       return true;
-   } else if (a->parent_instr->type == nir_instr_type_ssa_undef ||
-              b->parent_instr->type == nir_instr_type_ssa_undef) {
+   } else if (a->parent_instr->type == nir_instr_type_undef ||
+              b->parent_instr->type == nir_instr_type_undef) {
       /* If either variable is an ssa_undef, then there's no interference */
       return false;
    } else if (a->parent_instr->index < b->parent_instr->index) {
index 161e948..56f17de 100644 (file)
@@ -147,7 +147,7 @@ nir_lower_array_deref_of_vec_impl(nir_function_impl *impl,
             nir_def *index = nir_ssa_for_src(&b, deref->arr.index, 1);
             nir_def *scalar =
                nir_vector_extract(&b, &intrin->def, index);
-            if (scalar->parent_instr->type == nir_instr_type_ssa_undef) {
+            if (scalar->parent_instr->type == nir_instr_type_undef) {
                nir_def_rewrite_uses(&intrin->def,
                                     scalar);
                nir_instr_remove(&intrin->instr);
index 96fe030..29fb679 100644 (file)
@@ -395,7 +395,7 @@ nir_lower_bool_to_bitsize_instr(nir_builder *b,
    case nir_instr_type_phi:
       return lower_phi_instr(b, nir_instr_as_phi(instr));
 
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_intrinsic: {
       bool progress = false;
       nir_foreach_def(instr, rewrite_1bit_ssa_def_to_32bit, &progress);
index a45bcc0..702bc40 100644 (file)
@@ -236,7 +236,7 @@ nir_lower_bool_to_float_instr(nir_builder *b,
    }
 
    case nir_instr_type_intrinsic:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_phi: {
       bool progress = false;
       nir_foreach_def(instr, rewrite_1bit_ssa_def_to_32bit, &progress);
index f7acf3d..8d4b57b 100644 (file)
@@ -196,7 +196,7 @@ nir_lower_bool_to_int32_instr(UNUSED nir_builder *b,
    }
 
    case nir_instr_type_intrinsic:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_phi: {
       bool progress = false;
       nir_foreach_def(instr, rewrite_1bit_ssa_def_to_32bit, &progress);
index 906390b..72fe6d8 100644 (file)
@@ -286,7 +286,7 @@ nir_lower_int_to_float_impl(nir_function_impl *impl)
          }
 
          case nir_instr_type_intrinsic:
-         case nir_instr_type_ssa_undef:
+         case nir_instr_type_undef:
          case nir_instr_type_phi:
          case nir_instr_type_tex:
             break;
index 41b6c25..a88a5ee 100644 (file)
@@ -72,7 +72,7 @@ is_phi_src_scalarizable(nir_phi_src *src,
       /* These are trivially scalarizable */
       return true;
 
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       /* The caller of this function is going to OR the results and we don't
        * want undefs to count so we return false.
        */
index ca5ad40..6a15c31 100644 (file)
@@ -202,7 +202,7 @@ can_remat_instr(nir_instr *instr, struct sized_bitset *remat)
       }
    }
 
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_load_const:
       return true;
 
index 0cd41fc..d28ca03 100644 (file)
 static bool
 lower_undef_instr_to_zero(nir_builder *b, nir_instr *instr, UNUSED void *_state)
 {
-   if (instr->type != nir_instr_type_ssa_undef)
+   if (instr->type != nir_instr_type_undef)
       return false;
 
-   nir_undef_instr *und = nir_instr_as_ssa_undef(instr);
+   nir_undef_instr *und = nir_instr_as_undef(instr);
    b->cursor = nir_instr_remove(&und->instr);
    nir_def *zero = nir_imm_zero(b, und->def.num_components,
                                 und->def.bit_size);
index 4a85121..b636c15 100644 (file)
@@ -45,7 +45,7 @@ insert_store(nir_builder *b, nir_def *reg, nir_alu_instr *vec,
    }
 
    /* No sense storing from undef, just return the write mask */
-   if (src->parent_instr->type == nir_instr_type_ssa_undef)
+   if (src->parent_instr->type == nir_instr_type_undef)
       return write_mask;
 
    b->cursor = nir_before_instr(&vec->instr);
index 80d9ce3..6b99359 100644 (file)
@@ -84,8 +84,8 @@ is_live(BITSET_WORD *defs_live, nir_instr *instr)
       nir_load_const_instr *lc = nir_instr_as_load_const(instr);
       return is_def_live(&lc->def, defs_live);
    }
-   case nir_instr_type_ssa_undef: {
-      nir_undef_instr *undef = nir_instr_as_ssa_undef(instr);
+   case nir_instr_type_undef: {
+      nir_undef_instr *undef = nir_instr_as_undef(instr);
       return is_def_live(&undef->def, defs_live);
    }
    case nir_instr_type_parallel_copy: {
index 85a35ac..bcf2273 100644 (file)
@@ -186,7 +186,7 @@ is_src_scalarizable(nir_src *src)
       /* These are trivially scalarizable */
       return true;
 
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       return true;
 
    case nir_instr_type_intrinsic: {
@@ -383,7 +383,7 @@ gcm_pin_instructions(nir_function_impl *impl, struct gcm_state *state)
             break;
 
          case nir_instr_type_jump:
-         case nir_instr_type_ssa_undef:
+         case nir_instr_type_undef:
          case nir_instr_type_phi:
             instr->pass_flags = GCM_INSTR_PLACED;
             break;
index 58df68f..df7850d 100644 (file)
@@ -433,7 +433,7 @@ opt_split_alu_of_phi(nir_builder *b, nir_loop *loop)
             nir_foreach_phi_src(src_of_phi, phi) {
                if (src_of_phi->pred == prev_block) {
                   if (src_of_phi->src.ssa->parent_instr->type !=
-                      nir_instr_type_ssa_undef) {
+                      nir_instr_type_undef) {
                      is_prev_result_undef = false;
                   }
 
index 9fa6e33..cc2994b 100644 (file)
@@ -153,7 +153,7 @@ opt_move_discards_to_top_impl(nir_function_impl *impl)
 
          case nir_instr_type_deref:
          case nir_instr_type_load_const:
-         case nir_instr_type_ssa_undef:
+         case nir_instr_type_undef:
          case nir_instr_type_phi:
             /* These are all safe */
             continue;
index cc6f04d..10b38ca 100644 (file)
@@ -70,7 +70,7 @@ block_check_for_allowed_instrs(nir_block *block, unsigned *count,
          case nir_instr_type_deref:
          case nir_instr_type_load_const:
          case nir_instr_type_phi:
-         case nir_instr_type_ssa_undef:
+         case nir_instr_type_undef:
          case nir_instr_type_tex:
             break;
 
@@ -164,7 +164,7 @@ block_check_for_allowed_instrs(nir_block *block, unsigned *count,
 
       case nir_instr_type_deref:
       case nir_instr_type_load_const:
-      case nir_instr_type_ssa_undef:
+      case nir_instr_type_undef:
          break;
 
       case nir_instr_type_alu: {
index 725acb0..8bf3f27 100644 (file)
@@ -86,7 +86,7 @@ get_instr_cost(nir_instr *instr, const nir_opt_preamble_options *options)
     * this for them.
     */
    if (instr->type == nir_instr_type_load_const ||
-       instr->type == nir_instr_type_ssa_undef)
+       instr->type == nir_instr_type_undef)
       return 0;
 
    return options->instr_cost_cb(instr, options->cb_data);
@@ -252,7 +252,7 @@ can_move_instr(nir_instr *instr, opt_preamble_ctx *ctx)
       return can_move_intrinsic(nir_instr_as_intrinsic(instr), ctx);
 
    case nir_instr_type_load_const:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       return true;
 
    case nir_instr_type_deref: {
index b7593e0..d0cf63f 100644 (file)
@@ -514,8 +514,8 @@ opt_shrink_vectors_instr(nir_builder *b, nir_instr *instr)
    case nir_instr_type_load_const:
       return opt_shrink_vectors_load_const(nir_instr_as_load_const(instr));
 
-   case nir_instr_type_ssa_undef:
-      return opt_shrink_vectors_ssa_undef(nir_instr_as_ssa_undef(instr));
+   case nir_instr_type_undef:
+      return opt_shrink_vectors_ssa_undef(nir_instr_as_undef(instr));
 
    case nir_instr_type_phi:
       return opt_shrink_vectors_phi(b, nir_instr_as_phi(instr));
index da6bf4e..db9a3c2 100644 (file)
@@ -40,7 +40,7 @@ nir_can_move_instr(nir_instr *instr, nir_move_options options)
 {
    switch (instr->type) {
    case nir_instr_type_load_const:
-   case nir_instr_type_ssa_undef: {
+   case nir_instr_type_undef: {
       return options & nir_move_const_undef;
    }
    case nir_instr_type_alu: {
index 0430ca7..a77d821 100644 (file)
@@ -43,7 +43,7 @@ opt_undef_csel(nir_alu_instr *instr)
 
    for (int i = 1; i <= 2; i++) {
       nir_instr *parent = instr->src[i].src.ssa->parent_instr;
-      if (parent->type != nir_instr_type_ssa_undef)
+      if (parent->type != nir_instr_type_undef)
          continue;
 
       /* We can't just use nir_alu_src_copy, because we need the def/use
@@ -76,7 +76,7 @@ opt_undef_vecN(nir_builder *b, nir_alu_instr *alu)
       return false;
 
    for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
-      if (alu->src[i].src.ssa->parent_instr->type != nir_instr_type_ssa_undef)
+      if (alu->src[i].src.ssa->parent_instr->type != nir_instr_type_undef)
          return false;
    }
 
@@ -93,7 +93,7 @@ nir_get_undef_mask(nir_def *def)
 {
    nir_instr *instr = def->parent_instr;
 
-   if (instr->type == nir_instr_type_ssa_undef)
+   if (instr->type == nir_instr_type_undef)
       return BITSET_MASK(def->num_components);
 
    if (instr->type != nir_instr_type_alu)
@@ -105,7 +105,7 @@ nir_get_undef_mask(nir_def *def)
    if (nir_op_is_vec(alu->op)) {
       for (int i = 0; i < nir_op_infos[alu->op].num_inputs; i++) {
          if (alu->src[i].src.ssa->parent_instr->type ==
-             nir_instr_type_ssa_undef) {
+             nir_instr_type_undef) {
             undef |= BITSET_MASK(nir_ssa_alu_instr_src_components(alu, i)) << i;
          }
       }
index 860c207..494d61f 100644 (file)
@@ -1863,8 +1863,8 @@ print_instr(const nir_instr *instr, print_state *state, unsigned tabs)
       print_jump_instr(nir_instr_as_jump(instr), state);
       break;
 
-   case nir_instr_type_ssa_undef:
-      print_ssa_undef_instr(nir_instr_as_ssa_undef(instr), state);
+   case nir_instr_type_undef:
+      print_ssa_undef_instr(nir_instr_as_undef(instr), state);
       break;
 
    case nir_instr_type_phi:
@@ -1893,7 +1893,7 @@ block_has_instruction_with_dest(nir_block *block)
       case nir_instr_type_deref:
       case nir_instr_type_alu:
       case nir_instr_type_tex:
-      case nir_instr_type_ssa_undef:
+      case nir_instr_type_undef:
       case nir_instr_type_phi:
       case nir_instr_type_parallel_copy:
          return true;
index 0322aad..cea54e2 100644 (file)
@@ -124,7 +124,7 @@ propagate_invariant_instr(nir_instr *instr, struct set *invariants)
 
    case nir_instr_type_deref:
    case nir_instr_type_jump:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_load_const:
       break; /* Nothing to do */
 
index 8db3315..f89ec8f 100644 (file)
@@ -446,7 +446,7 @@ nir_schedule_calculate_deps(nir_deps_state *state, nir_schedule_node *n)
       add_read_dep(state, state->jump, n);
 
    switch (instr->type) {
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_load_const:
    case nir_instr_type_alu:
    case nir_instr_type_deref:
@@ -1075,7 +1075,7 @@ nir_schedule_get_delay(nir_schedule_scoreboard *scoreboard, nir_instr *instr)
    }
 
    switch (instr->type) {
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_load_const:
    case nir_instr_type_alu:
    case nir_instr_type_deref:
index 05aeac8..b74b155 100644 (file)
@@ -1612,8 +1612,8 @@ write_instr(write_ctx *ctx, const nir_instr *instr)
    case nir_instr_type_load_const:
       write_load_const(ctx, nir_instr_as_load_const(instr));
       break;
-   case nir_instr_type_ssa_undef:
-      write_ssa_undef(ctx, nir_instr_as_ssa_undef(instr));
+   case nir_instr_type_undef:
+      write_ssa_undef(ctx, nir_instr_as_undef(instr));
       break;
    case nir_instr_type_tex:
       write_tex(ctx, nir_instr_as_tex(instr));
@@ -1658,7 +1658,7 @@ read_instr(read_ctx *ctx, nir_block *block)
    case nir_instr_type_load_const:
       instr = &read_load_const(ctx, header)->instr;
       break;
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       instr = &read_ssa_undef(ctx, header)->instr;
       break;
    case nir_instr_type_tex:
index 6ef71f8..371f92a 100644 (file)
@@ -168,7 +168,7 @@ instr_is_invariant(nir_instr *instr, nir_loop *loop)
 
    switch (instr->type) {
    case nir_instr_type_load_const:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       return invariant;
    case nir_instr_type_call:
       return not_invariant;
index 196eabf..00d2bf6 100644 (file)
@@ -414,7 +414,7 @@ trivialize_stores(nir_function_impl *impl, nir_block *block)
             /* SSA-only instruction types */
             nir_instr *parent = value->parent_instr;
             nontrivial |= (parent->type == nir_instr_type_load_const) ||
-                          (parent->type == nir_instr_type_ssa_undef);
+                          (parent->type == nir_instr_type_undef);
 
             /* Must be written in the same block */
             nontrivial |= (parent->block != block);
index f2ab225..7ec9b28 100644 (file)
@@ -1031,8 +1031,8 @@ validate_instr(nir_instr *instr, validate_state *state)
       validate_phi_instr(nir_instr_as_phi(instr), state);
       break;
 
-   case nir_instr_type_ssa_undef:
-      validate_ssa_undef_instr(nir_instr_as_ssa_undef(instr), state);
+   case nir_instr_type_undef:
+      validate_ssa_undef_instr(nir_instr_as_undef(instr), state);
       break;
 
    case nir_instr_type_jump:
index 8220e75..e1e15f8 100644 (file)
@@ -3431,7 +3431,7 @@ read_phi_src(struct ir3_context *ctx, struct ir3_block *blk,
 
    nir_foreach_phi_src (nsrc, nphi) {
       if (blk->nblock == nsrc->pred) {
-         if (nsrc->src.ssa->parent_instr->type == nir_instr_type_ssa_undef) {
+         if (nsrc->src.ssa->parent_instr->type == nir_instr_type_undef) {
             /* Create an ir3 undef */
             return NULL;
          } else {
@@ -3503,8 +3503,8 @@ emit_instr(struct ir3_context *ctx, nir_instr *instr)
    case nir_instr_type_load_const:
       emit_load_const(ctx, nir_instr_as_load_const(instr));
       break;
-   case nir_instr_type_ssa_undef:
-      emit_undef(ctx, nir_instr_as_ssa_undef(instr));
+   case nir_instr_type_undef:
+      emit_undef(ctx, nir_instr_as_undef(instr));
       break;
    case nir_instr_type_tex: {
       nir_tex_instr *tex = nir_instr_as_tex(instr);
index 9e4dfae..5b53c2a 100644 (file)
@@ -181,7 +181,7 @@ lower_64b_undef(nir_builder *b, nir_instr *instr, void *unused)
 {
    (void)unused;
 
-   nir_undef_instr *undef = nir_instr_as_ssa_undef(instr);
+   nir_undef_instr *undef = nir_instr_as_undef(instr);
    unsigned num_comp = undef->def.num_components;
    nir_def *components[num_comp];
 
@@ -201,8 +201,8 @@ lower_64b_undef_filter(const nir_instr *instr, const void *unused)
 {
    (void)unused;
 
-   return instr->type == nir_instr_type_ssa_undef &&
-      nir_instr_as_ssa_undef(instr)->def.bit_size == 64;
+   return instr->type == nir_instr_type_undef &&
+      nir_instr_as_undef(instr)->def.bit_size == 64;
 }
 
 bool
index b88c01d..e1d862d 100644 (file)
@@ -78,7 +78,7 @@ check_precondition_instr(precond_state *state, nir_instr *instr)
    case nir_instr_type_alu:
    case nir_instr_type_deref:
    case nir_instr_type_load_const:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       /* These could be safely moved around */
       break;
    case nir_instr_type_intrinsic: {
index 76b6cbb..d1b9cfc 100644 (file)
@@ -2777,8 +2777,8 @@ visit_block(struct lp_build_nir_context *bld_base, nir_block *block)
       case nir_instr_type_phi:
          assert(0);
          break;
-      case nir_instr_type_ssa_undef:
-         visit_ssa_undef(bld_base, nir_instr_as_ssa_undef(instr));
+      case nir_instr_type_undef:
+         visit_ssa_undef(bld_base, nir_instr_as_undef(instr));
          break;
       case nir_instr_type_jump:
          visit_jump(bld_base, nir_instr_as_jump(instr));
index 46a02fa..4879963 100644 (file)
@@ -1268,7 +1268,7 @@ ntt_get_alu_src(struct ntt_compile *c, nir_alu_instr *instr, int i)
     * the specific swizzles from an undef don't matter)
     */
    if (nir_src_bit_size(instr->src[i].src) == 64 &&
-      !(src.src.is_ssa && src.src.ssa->parent_instr->type == nir_instr_type_ssa_undef)) {
+      !(src.src.is_ssa && src.src.ssa->parent_instr->type == nir_instr_type_undef)) {
       int chan1 = 1;
       if (nir_op_infos[instr->op].input_sizes[i] == 0) {
          chan1 = instr->def.num_components > 1 ? 1 : 0;
@@ -2941,8 +2941,8 @@ ntt_emit_instr(struct ntt_compile *c, nir_instr *instr)
       ntt_emit_jump(c, nir_instr_as_jump(instr));
       break;
 
-   case nir_instr_type_ssa_undef:
-      ntt_emit_ssa_undef(c, nir_instr_as_ssa_undef(instr));
+   case nir_instr_type_undef:
+      ntt_emit_ssa_undef(c, nir_instr_as_undef(instr));
       break;
 
    default:
index cc1d6cf..0f51140 100644 (file)
@@ -399,7 +399,7 @@ get_src(struct etna_compile *c, nir_src *src)
    case nir_instr_type_alu:
    case nir_instr_type_tex:
       return ra_src(c, src);
-   case nir_instr_type_ssa_undef: {
+   case nir_instr_type_undef: {
       /* return zero to deal with broken Blur demo */
       nir_const_value value = CONST(0);
       return src_swizzle(const_src(c, &value, 1), SWIZZLE(X,X,X,X));
@@ -634,7 +634,7 @@ emit_instr(struct etna_compile *c, nir_instr * instr)
       assert(nir_instr_is_last(instr));
       break;
    case nir_instr_type_load_const:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
    case nir_instr_type_deref:
       break;
    default:
index 8e532a1..38bbde4 100644 (file)
@@ -79,7 +79,7 @@ set_src_live(nir_src *src, void *void_state)
 
    switch (instr->type) {
    case nir_instr_type_load_const:
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       return true;
    case nir_instr_type_alu: {
       /* alu op bypass */
index 1f5209c..95613b4 100644 (file)
@@ -851,8 +851,8 @@ emit_instr(struct ir2_context *ctx, nir_instr *instr)
    case nir_instr_type_jump:
       ctx->block_has_jump[ctx->block_idx] = true;
       break;
-   case nir_instr_type_ssa_undef:
-      emit_undef(ctx, nir_instr_as_ssa_undef(instr));
+   case nir_instr_type_undef:
+      emit_undef(ctx, nir_instr_as_undef(instr));
       break;
    default:
       break;
index f85e356..05d1124 100644 (file)
@@ -324,7 +324,7 @@ static bool (*gpir_emit_instr[nir_instr_type_phi])(gpir_block *, nir_instr *) =
    [nir_instr_type_alu]        = gpir_emit_alu,
    [nir_instr_type_intrinsic]  = gpir_emit_intrinsic,
    [nir_instr_type_load_const] = gpir_emit_load_const,
-   [nir_instr_type_ssa_undef]  = gpir_emit_ssa_undef,
+   [nir_instr_type_undef]      = gpir_emit_ssa_undef,
    [nir_instr_type_tex]        = gpir_emit_tex,
    [nir_instr_type_jump]       = gpir_emit_jump,
 };
index 591ff43..3bc129b 100644 (file)
@@ -471,7 +471,7 @@ static bool ppir_emit_load_const(ppir_block *block, nir_instr *ni)
 
 static bool ppir_emit_ssa_undef(ppir_block *block, nir_instr *ni)
 {
-   nir_undef_instr *undef = nir_instr_as_ssa_undef(ni);
+   nir_undef_instr *undef = nir_instr_as_undef(ni);
    ppir_node *node = ppir_node_create_ssa(block, ppir_op_undef, &undef->def);
    if (!node)
       return false;
@@ -665,7 +665,7 @@ static bool (*ppir_emit_instr[nir_instr_type_phi])(ppir_block *, nir_instr *) =
    [nir_instr_type_alu]        = ppir_emit_alu,
    [nir_instr_type_intrinsic]  = ppir_emit_intrinsic,
    [nir_instr_type_load_const] = ppir_emit_load_const,
-   [nir_instr_type_ssa_undef]  = ppir_emit_ssa_undef,
+   [nir_instr_type_undef]      = ppir_emit_ssa_undef,
    [nir_instr_type_tex]        = ppir_emit_tex,
    [nir_instr_type_jump]       = ppir_emit_jump,
 };
index 95780cf..1abcd86 100644 (file)
@@ -127,8 +127,8 @@ InstrFactory::from_nir(nir_instr *instr, Shader& shader)
       return TexInstr::from_nir(nir_instr_as_tex(instr), shader);
    case nir_instr_type_jump:
       return process_jump(nir_instr_as_jump(instr), shader);
-   case nir_instr_type_ssa_undef:
-      return process_undef(nir_instr_as_ssa_undef(instr), shader);
+   case nir_instr_type_undef:
+      return process_undef(nir_instr_as_undef(instr), shader);
    default:
       fprintf(stderr, "Instruction type %d not supported\n", instr->type);
       return false;
index 86a8dad..cb075fe 100644 (file)
@@ -860,8 +860,8 @@ Lower64BitToVec2::filter(const nir_instr *instr) const
       auto lc = nir_instr_as_load_const(instr);
       return lc->def.bit_size == 64;
    }
-   case nir_instr_type_ssa_undef: {
-      auto undef = nir_instr_as_ssa_undef(instr);
+   case nir_instr_type_undef: {
+      auto undef = nir_instr_as_undef(instr);
       return undef->def.bit_size == 64;
    }
    default:
@@ -934,8 +934,8 @@ Lower64BitToVec2::lower(nir_instr *instr)
 
       return nir_build_imm(b, 2 * lc->def.num_components, 32, val);
    }
-   case nir_instr_type_ssa_undef: {
-      auto undef = nir_instr_as_ssa_undef(instr);
+   case nir_instr_type_undef: {
+      auto undef = nir_instr_as_undef(instr);
       undef->def.num_components *= 2;
       undef->def.bit_size = 32;
       return NIR_LOWER_INSTR_PROGRESS;
index 754130a..25165a1 100644 (file)
@@ -2008,8 +2008,8 @@ ntq_emit_instr(struct vc4_compile *c, nir_instr *instr)
                 ntq_emit_load_const(c, nir_instr_as_load_const(instr));
                 break;
 
-        case nir_instr_type_ssa_undef:
-                ntq_emit_ssa_undef(c, nir_instr_as_ssa_undef(instr));
+        case nir_instr_type_undef:
+                ntq_emit_ssa_undef(c, nir_instr_as_undef(instr));
                 break;
 
         case nir_instr_type_tex:
index f507e28..154807f 100644 (file)
@@ -3998,8 +3998,8 @@ emit_block(struct ntv_context *ctx, struct nir_block *block)
       case nir_instr_type_load_const:
          emit_load_const(ctx, nir_instr_as_load_const(instr));
          break;
-      case nir_instr_type_ssa_undef:
-         emit_undef(ctx, nir_instr_as_ssa_undef(instr));
+      case nir_instr_type_undef:
+         emit_undef(ctx, nir_instr_as_undef(instr));
          break;
       case nir_instr_type_tex:
          emit_tex(ctx, nir_instr_as_tex(instr));
index c55b733..5976ab2 100644 (file)
@@ -472,7 +472,7 @@ fs_visitor::nir_emit_instr(nir_instr *instr)
       nir_emit_load_const(abld, nir_instr_as_load_const(instr));
       break;
 
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       /* We create a new VGRF for undefs on every use (by handling
        * them in get_nir_src()), rather than for each definition.
        * This helps register coalescing eliminate MOVs from undef.
index 9eb81bf..0c742f8 100644 (file)
@@ -154,8 +154,8 @@ vec4_visitor::nir_emit_instr(nir_instr *instr)
       nir_emit_texture(nir_instr_as_tex(instr));
       break;
 
-   case nir_instr_type_ssa_undef:
-      nir_emit_undef(nir_instr_as_ssa_undef(instr));
+   case nir_instr_type_undef:
+      nir_emit_undef(nir_instr_as_undef(instr));
       break;
 
    default:
index b5c5791..50e6df8 100644 (file)
@@ -5651,8 +5651,8 @@ static bool emit_instr(struct ntd_context *ctx, struct nir_instr* instr)
       return emit_phi(ctx, nir_instr_as_phi(instr));
    case nir_instr_type_tex:
       return emit_tex(ctx, nir_instr_as_tex(instr));
-   case nir_instr_type_ssa_undef:
-      return emit_undefined(ctx, nir_instr_as_ssa_undef(instr));
+   case nir_instr_type_undef:
+      return emit_undefined(ctx, nir_instr_as_undef(instr));
    default:
       log_nir_instr_unsupported(ctx->logger, "Unimplemented instruction type",
                                 instr);
index b28f008..e9ccf05 100644 (file)
@@ -1527,8 +1527,8 @@ Converter::visit(nir_instr *insn)
       return visit(nir_instr_as_jump(insn));
    case nir_instr_type_load_const:
       return visit(nir_instr_as_load_const(insn));
-   case nir_instr_type_ssa_undef:
-      return visit(nir_instr_as_ssa_undef(insn));
+   case nir_instr_type_undef:
+      return visit(nir_instr_as_undef(insn));
    case nir_instr_type_tex:
       return visit(nir_instr_as_tex(insn));
    default:
index 20add51..7dde6b5 100644 (file)
@@ -2299,7 +2299,7 @@ emit_instr(compiler_context *ctx, struct nir_instr *instr)
       emit_jump(ctx, nir_instr_as_jump(instr));
       break;
 
-   case nir_instr_type_ssa_undef:
+   case nir_instr_type_undef:
       /* Spurious */
       break;