From c7861fe1f2e5437eff36458340a61399b9a30d30 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 17 May 2023 09:26:20 -0400 Subject: [PATCH] nir: Drop unused argument from nir_ssa_dest_init_for_type MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Similar to nir_ssa_dest_init, but with fewer call sites to churn through. This was done with the help of Coccinelle: @@ expression A, B, C, D; @@ -nir_ssa_dest_init_for_type(A, B, C, D); +nir_ssa_dest_init_for_type(A, B, C); Signed-off-by: Alyssa Rosenzweig Reviewed-by: Timur Kristóf Reviewed-by: Emma Anholt Part-of: --- src/compiler/nir/nir.h | 3 +-- src/compiler/nir/nir_lower_system_values.c | 3 +-- src/compiler/spirv/vtn_amd.c | 2 +- src/compiler/spirv/vtn_subgroup.c | 12 +++++------- src/compiler/spirv/vtn_variables.c | 3 +-- src/intel/compiler/brw_kernel.c | 3 +-- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index e5a37fb..8e0c73b 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -4455,8 +4455,7 @@ void nir_ssa_def_init(nir_instr *instr, nir_ssa_def *def, unsigned num_components, unsigned bit_size); static inline void nir_ssa_dest_init_for_type(nir_instr *instr, nir_dest *dest, - const struct glsl_type *type, - const char *name) + const struct glsl_type *type) { assert(glsl_type_is_vector_or_scalar(type)); nir_ssa_dest_init(instr, dest, glsl_get_components(type), diff --git a/src/compiler/nir/nir_lower_system_values.c b/src/compiler/nir/nir_lower_system_values.c index 4e443c3..3165b0c 100644 --- a/src/compiler/nir/nir_lower_system_values.c +++ b/src/compiler/nir/nir_lower_system_values.c @@ -173,8 +173,7 @@ lower_system_value_instr(nir_builder *b, nir_instr *instr, void *_state) nir_intrinsic_op op = nir_intrinsic_from_system_value(var->data.location); nir_intrinsic_instr *load = nir_intrinsic_instr_create(b->shader, op); - nir_ssa_dest_init_for_type(&load->instr, &load->dest, - var->type, NULL); + nir_ssa_dest_init_for_type(&load->instr, &load->dest, var->type); load->num_components = load->dest.ssa.num_components; nir_builder_instr_insert(b, &load->instr); return &load->dest.ssa; diff --git a/src/compiler/spirv/vtn_amd.c b/src/compiler/spirv/vtn_amd.c index 12dd3a0..e1e29c9 100644 --- a/src/compiler/spirv/vtn_amd.c +++ b/src/compiler/spirv/vtn_amd.c @@ -80,7 +80,7 @@ vtn_handle_amd_shader_ballot_instruction(struct vtn_builder *b, SpvOp ext_opcode const struct glsl_type *dest_type = vtn_get_type(b, w[1])->type; nir_intrinsic_instr *intrin = nir_intrinsic_instr_create(b->nb.shader, op); - nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest, dest_type, NULL); + nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest, dest_type); if (nir_intrinsic_infos[op].src_components[0] == 0) intrin->num_components = intrin->dest.ssa.num_components; diff --git a/src/compiler/spirv/vtn_subgroup.c b/src/compiler/spirv/vtn_subgroup.c index d3b5521..eef50f2 100644 --- a/src/compiler/spirv/vtn_subgroup.c +++ b/src/compiler/spirv/vtn_subgroup.c @@ -52,8 +52,7 @@ vtn_build_subgroup_instr(struct vtn_builder *b, nir_intrinsic_instr *intrin = nir_intrinsic_instr_create(b->nb.shader, nir_op); - nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest, - dst->type, NULL); + nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest, dst->type); intrin->num_components = intrin->dest.ssa.num_components; intrin->src[0] = nir_src_for_ssa(src0->def); @@ -82,8 +81,7 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode, "OpGroupNonUniformElect must return a Bool"); nir_intrinsic_instr *elect = nir_intrinsic_instr_create(b->nb.shader, nir_intrinsic_elect); - nir_ssa_dest_init_for_type(&elect->instr, &elect->dest, - dest_type->type, NULL); + nir_ssa_dest_init_for_type(&elect->instr, &elect->dest, dest_type->type); nir_builder_instr_insert(&b->nb, &elect->instr); vtn_push_nir_ssa(b, w[2], &elect->dest.ssa); break; @@ -117,7 +115,7 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode, intrin->src[1] = nir_src_for_ssa(nir_load_subgroup_invocation(&b->nb)); nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest, - dest_type->type, NULL); + dest_type->type); nir_builder_instr_insert(&b->nb, &intrin->instr); vtn_push_nir_ssa(b, w[2], &intrin->dest.ssa); @@ -172,7 +170,7 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode, intrin->src[1] = nir_src_for_ssa(src1); nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest, - dest_type->type, NULL); + dest_type->type); nir_builder_instr_insert(&b->nb, &intrin->instr); vtn_push_nir_ssa(b, w[2], &intrin->dest.ssa); @@ -265,7 +263,7 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode, intrin->num_components = src0->num_components; intrin->src[0] = nir_src_for_ssa(src0); nir_ssa_dest_init_for_type(&intrin->instr, &intrin->dest, - dest_type->type, NULL); + dest_type->type); nir_builder_instr_insert(&b->nb, &intrin->instr); vtn_push_nir_ssa(b, w[2], &intrin->dest.ssa); diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index d752f35..4cbd667 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -2802,8 +2802,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode, nir_intrinsic_instr_create(b->nb.shader, nir_intrinsic_load_deref_block_intel); load->src[0] = nir_src_for_ssa(&src->dest.ssa); - nir_ssa_dest_init_for_type(&load->instr, &load->dest, - res_type->type, NULL); + nir_ssa_dest_init_for_type(&load->instr, &load->dest, res_type->type); load->num_components = load->dest.ssa.num_components; nir_builder_instr_insert(&b->nb, &load->instr); diff --git a/src/intel/compiler/brw_kernel.c b/src/intel/compiler/brw_kernel.c index acf0d2a..2776d6e 100644 --- a/src/intel/compiler/brw_kernel.c +++ b/src/intel/compiler/brw_kernel.c @@ -92,8 +92,7 @@ implement_atomic_builtin(nir_function *func, nir_atomic_op atomic_op, atomic->src[i] = nir_src_for_ssa(src); } - nir_ssa_dest_init_for_type(&atomic->instr, &atomic->dest, - data_type, NULL); + nir_ssa_dest_init_for_type(&atomic->instr, &atomic->dest, data_type); nir_builder_instr_insert(&b, &atomic->instr); nir_store_deref(&b, ret, &atomic->dest.ssa, ~0); -- 2.7.4