Module: Mesa
Branch: main
Commit: 84e0f5ce753468d2dd2fc02d6c115ab89f0b4629
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=84e0f5ce753468d2dd2fc02d6c115ab89f0b4629

Author: Timothy Arceri <[email protected]>
Date:   Wed Sep  6 14:04:39 2023 +1000

nir: remove unused param from nir_alu_src_copy()

Reviewed-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24986>

---

 src/compiler/nir/nir.c                              | 3 +--
 src/compiler/nir/nir.h                              | 3 +--
 src/compiler/nir/nir_lower_alu_width.c              | 8 ++++----
 src/compiler/nir/nir_lower_bit_size.c               | 2 +-
 src/compiler/nir/nir_search.c                       | 2 +-
 src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c  | 2 +-
 src/intel/compiler/brw_nir_opt_peephole_ffma.c      | 2 +-
 src/intel/compiler/brw_nir_opt_peephole_imul32x16.c | 4 ++--
 8 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index dd5d9e7bb9f..c52906b5210 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -490,8 +490,7 @@ nir_function_create(nir_shader *shader, const char *name)
 }
 
 void
-nir_alu_src_copy(nir_alu_src *dest, const nir_alu_src *src,
-                 nir_alu_instr *instr)
+nir_alu_src_copy(nir_alu_src *dest, const nir_alu_src *src)
 {
    dest->src = nir_src_for_ssa(src->src.ssa);
    for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++)
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 76d2e3f1fb6..d3812b56645 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -1465,8 +1465,7 @@ typedef struct nir_alu_instr {
    nir_alu_src src[];
 } nir_alu_instr;
 
-void nir_alu_src_copy(nir_alu_src *dest, const nir_alu_src *src,
-                      nir_alu_instr *instr);
+void nir_alu_src_copy(nir_alu_src *dest, const nir_alu_src *src);
 
 /* is this source channel used? */
 bool
diff --git a/src/compiler/nir/nir_lower_alu_width.c 
b/src/compiler/nir/nir_lower_alu_width.c
index eb2202ffcaf..2704e299fb5 100644
--- a/src/compiler/nir/nir_lower_alu_width.c
+++ b/src/compiler/nir/nir_lower_alu_width.c
@@ -103,11 +103,11 @@ lower_reduction(nir_alu_instr *alu, nir_op chan_op, 
nir_op merge_op,
       int channel = reverse_order ? num_components - 1 - i : i;
       nir_alu_instr *chan = nir_alu_instr_create(builder->shader, chan_op);
       nir_alu_ssa_dest_init(chan, 1, alu->def.bit_size);
-      nir_alu_src_copy(&chan->src[0], &alu->src[0], chan);
+      nir_alu_src_copy(&chan->src[0], &alu->src[0]);
       chan->src[0].swizzle[0] = chan->src[0].swizzle[channel];
       if (nir_op_infos[chan_op].num_inputs > 1) {
          assert(nir_op_infos[chan_op].num_inputs == 2);
-         nir_alu_src_copy(&chan->src[1], &alu->src[1], chan);
+         nir_alu_src_copy(&chan->src[1], &alu->src[1]);
          chan->src[1].swizzle[0] = chan->src[1].swizzle[channel];
       }
       chan->exact = alu->exact;
@@ -163,7 +163,7 @@ lower_fdot(nir_alu_instr *alu, nir_builder *builder)
          builder->shader, prev ? nir_op_ffma : nir_op_fmul);
       nir_alu_ssa_dest_init(instr, 1, alu->def.bit_size);
       for (unsigned j = 0; j < 2; j++) {
-         nir_alu_src_copy(&instr->src[j], &alu->src[j], instr);
+         nir_alu_src_copy(&instr->src[j], &alu->src[j]);
          instr->src[j].swizzle[0] = alu->src[j].swizzle[channel];
       }
       if (i != 0)
@@ -391,7 +391,7 @@ lower_alu_instr_width(nir_builder *b, nir_instr *instr, 
void *_data)
       nir_alu_instr *lower = nir_alu_instr_create(b->shader, alu->op);
 
       for (i = 0; i < num_src; i++) {
-         nir_alu_src_copy(&lower->src[i], &alu->src[i], lower);
+         nir_alu_src_copy(&lower->src[i], &alu->src[i]);
 
          /* We only handle same-size-as-dest (input_sizes[] == 0) or scalar
           * args (input_sizes[] == 1).
diff --git a/src/compiler/nir/nir_lower_bit_size.c 
b/src/compiler/nir/nir_lower_bit_size.c
index cfe37f6b0ab..37889a39faf 100644
--- a/src/compiler/nir/nir_lower_bit_size.c
+++ b/src/compiler/nir/nir_lower_bit_size.c
@@ -41,7 +41,7 @@ convert_to_bit_size(nir_builder *bld, nir_def *src,
    if ((type & (nir_type_uint | nir_type_int)) && bit_size == 32 &&
        alu && (alu->op == nir_op_b2i8 || alu->op == nir_op_b2i16)) {
       nir_alu_instr *instr = nir_alu_instr_create(bld->shader, nir_op_b2i32);
-      nir_alu_src_copy(&instr->src[0], &alu->src[0], instr);
+      nir_alu_src_copy(&instr->src[0], &alu->src[0]);
       return nir_builder_alu_instr_finish_and_insert(bld, instr);
    }
 
diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
index 49e610807d2..fe7a6d0e91e 100644
--- a/src/compiler/nir/nir_search.c
+++ b/src/compiler/nir/nir_search.c
@@ -492,7 +492,7 @@ construct_value(nir_builder *build,
       assert(state->variables_seen & (1 << var->variable));
 
       nir_alu_src val = { NIR_SRC_INIT };
-      nir_alu_src_copy(&val, &state->variables[var->variable], NULL);
+      nir_alu_src_copy(&val, &state->variables[var->variable]);
       assert(!var->is_constant);
 
       for (unsigned i = 0; i < NIR_MAX_VEC_COMPONENTS; i++)
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c 
b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c
index a1ced1c1808..aafd796bf60 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c
@@ -706,7 +706,7 @@ insert_vec_mov(nir_alu_instr *vec, unsigned start_idx, 
nir_shader *shader)
    unsigned write_mask = (1u << start_idx);
 
    nir_alu_instr *mov = nir_alu_instr_create(shader, nir_op_mov);
-   nir_alu_src_copy(&mov->src[0], &vec->src[start_idx], mov);
+   nir_alu_src_copy(&mov->src[0], &vec->src[start_idx]);
 
    mov->src[0].swizzle[0] = vec->src[start_idx].swizzle[0];
 
diff --git a/src/intel/compiler/brw_nir_opt_peephole_ffma.c 
b/src/intel/compiler/brw_nir_opt_peephole_ffma.c
index 5a7f629a79b..66b887e8fe4 100644
--- a/src/intel/compiler/brw_nir_opt_peephole_ffma.c
+++ b/src/intel/compiler/brw_nir_opt_peephole_ffma.c
@@ -230,7 +230,7 @@ brw_nir_opt_peephole_ffma_instr(nir_builder *b,
       for (unsigned j = 0; j < add->def.num_components; j++)
          ffma->src[i].swizzle[j] = mul->src[i].swizzle[swizzle[j]];
    }
-   nir_alu_src_copy(&ffma->src[2], &add->src[1 - add_mul_src], ffma);
+   nir_alu_src_copy(&ffma->src[2], &add->src[1 - add_mul_src]);
 
    nir_def_init(&ffma->instr, &ffma->def,
                 add->def.num_components, bit_size);
diff --git a/src/intel/compiler/brw_nir_opt_peephole_imul32x16.c 
b/src/intel/compiler/brw_nir_opt_peephole_imul32x16.c
index 89a20d62344..14962d30ce1 100644
--- a/src/intel/compiler/brw_nir_opt_peephole_imul32x16.c
+++ b/src/intel/compiler/brw_nir_opt_peephole_imul32x16.c
@@ -42,8 +42,8 @@ replace_imul_instr(nir_builder *b, nir_alu_instr *imul, 
unsigned small_val,
 
    nir_alu_instr *imul_32x16 = nir_alu_instr_create(b->shader, new_opcode);
 
-   nir_alu_src_copy(&imul_32x16->src[0], &imul->src[1 - small_val], 
imul_32x16);
-   nir_alu_src_copy(&imul_32x16->src[1], &imul->src[small_val], imul_32x16);
+   nir_alu_src_copy(&imul_32x16->src[0], &imul->src[1 - small_val]);
+   nir_alu_src_copy(&imul_32x16->src[1], &imul->src[small_val]);
 
    nir_def_init(&imul_32x16->instr, &imul_32x16->def,
                 imul->def.num_components, 32);

Reply via email to