nir: Remove nir_{src,dest}::is_ssa
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Thu, 3 Aug 2023 19:11:26 +0000 (15:11 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Aug 2023 22:40:29 +0000 (22:40 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>

src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_clone.c
src/compiler/nir/nir_serialize.c
src/gallium/drivers/freedreno/a2xx/ir2_nir.c
src/gallium/drivers/lima/ir/lima_nir_duplicate_intrinsic.c

index 1b104fc..bc6c99a 100644 (file)
@@ -487,7 +487,6 @@ nir_function_create(nir_shader *shader, const char *name)
 static void
 src_copy(nir_src *dest, const nir_src *src, gc_ctx *ctx)
 {
-   dest->is_ssa = true;
    dest->ssa = src->ssa;
 }
 
@@ -599,7 +598,6 @@ nir_block_create(nir_shader *shader)
 static inline void
 src_init(nir_src *src)
 {
-   src->is_ssa = true;
    src->ssa = NULL;
 }
 
@@ -1573,7 +1571,6 @@ void
 nir_ssa_dest_init(nir_instr *instr, nir_dest *dest,
                  unsigned num_components, unsigned bit_size)
 {
-   dest->is_ssa = true;
    nir_ssa_def_init(instr, &dest->ssa, num_components, bit_size);
 }
 
index 7adfbf4..c4d1ecd 100644 (file)
@@ -1014,7 +1014,6 @@ typedef struct nir_src {
       nir_ssa_def *ssa;
    };
 
-   bool is_ssa;
    bool is_if;
 } nir_src;
 
@@ -1077,8 +1076,6 @@ typedef struct {
       nir_register_dest reg;
       nir_ssa_def ssa;
    };
-
-   bool is_ssa;
 } nir_dest;
 
 static inline nir_dest
@@ -1101,7 +1098,6 @@ nir_src_for_ssa(nir_ssa_def *def)
 {
    nir_src src = NIR_SRC_INIT;
 
-   src.is_ssa = true;
    src.ssa = def;
 
    return src;
index 7683162..eabc040 100644 (file)
@@ -199,7 +199,6 @@ static void
 __clone_src(clone_state *state, void *ninstr_or_if,
             nir_src *nsrc, const nir_src *src)
 {
-   nsrc->is_ssa = true;
    nsrc->ssa = remap_local(state, src->ssa);
 }
 
@@ -207,7 +206,6 @@ static void
 __clone_dst(clone_state *state, nir_instr *ninstr,
             nir_dest *ndst, const nir_dest *dst)
 {
-   ndst->is_ssa = true;
    nir_ssa_dest_init(ninstr, ndst, dst->ssa.num_components,
                      dst->ssa.bit_size);
    if (likely(state->remap_table))
index 76238c9..a433bd8 100644 (file)
@@ -488,7 +488,6 @@ read_src(read_ctx *ctx, nir_src *src)
    union packed_src header;
    header.u32 = blob_read_uint32(ctx->blob);
 
-   src->is_ssa = true;
    src->ssa = read_lookup_object(ctx, header.any.object_idx);
    return header;
 }
@@ -798,7 +797,6 @@ read_alu(read_ctx *ctx, union packed_instr header)
    if (header.alu.packed_src_ssa_16bit) {
       for (unsigned i = 0; i < num_srcs; i++) {
          nir_alu_src *src = &alu->src[i];
-         src->src.is_ssa = true;
          src->src.ssa = read_lookup_object(ctx, blob_read_uint16(ctx->blob));
 
          memset(&src->swizzle, 0, sizeof(src->swizzle));
@@ -992,9 +990,7 @@ read_deref(read_ctx *ctx, union packed_instr header)
    case nir_deref_type_array:
    case nir_deref_type_ptr_as_array:
       if (header.deref.packed_src_ssa_16bit) {
-         deref->parent.is_ssa = true;
          deref->parent.ssa = read_lookup_object(ctx, blob_read_uint16(ctx->blob));
-         deref->arr.index.is_ssa = true;
          deref->arr.index.ssa = read_lookup_object(ctx, blob_read_uint16(ctx->blob));
       } else {
          read_src(ctx, &deref->parent);
index 5a775cf..be1f506 100644 (file)
@@ -825,7 +825,7 @@ emit_undef(struct ir2_context *ctx, nir_ssa_undef_instr *undef)
    struct ir2_instr *instr;
 
    instr = instr_create_alu_dest(
-      ctx, nir_op_mov, &(nir_dest){.ssa = undef->def, .is_ssa = true});
+      ctx, nir_op_mov, &(nir_dest){.ssa = undef->def});
    instr->src[0] = ir2_src(0, 0, IR2_SRC_CONST);
 }
 
index bca1043..b653d4b 100644 (file)
@@ -41,7 +41,6 @@ lima_nir_duplicate_intrinsic(nir_builder *b, nir_intrinsic_instr *itr,
          dupl = nir_intrinsic_instr_create(b->shader, op);
          dupl->num_components = itr->num_components;
          memcpy(dupl->const_index, itr->const_index, sizeof(itr->const_index));
-         dupl->src[0].is_ssa = true;
          dupl->src[0].ssa = itr->src[0].ssa;
 
          nir_ssa_dest_init(&dupl->instr, &dupl->dest, dupl->num_components,
@@ -71,7 +70,6 @@ lima_nir_duplicate_intrinsic(nir_builder *b, nir_intrinsic_instr *itr,
          dupl = nir_intrinsic_instr_create(b->shader, op);
          dupl->num_components = itr->num_components;
          memcpy(dupl->const_index, itr->const_index, sizeof(itr->const_index));
-         dupl->src[0].is_ssa = true;
          dupl->src[0].ssa = itr->src[0].ssa;
 
          nir_ssa_dest_init(&dupl->instr, &dupl->dest, dupl->num_components,