summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>2023-05-17 09:26:20 -0400
committerMarge Bot <emma+marge@anholt.net>2023-05-17 23:46:16 +0000
commitc7861fe1f2e5437eff36458340a61399b9a30d30 (patch)
tree8c07953a1c927db9db87ab95d21384940bd8ce08
parent01e9ee79f70e9047fd37796416165c5174d8c70f (diff)
downloadmesa-c7861fe1f2e5437eff36458340a61399b9a30d30.tar.gz
nir: Drop unused argument from nir_ssa_dest_init_for_type
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 <alyssa@rosenzweig.io> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23078>
-rw-r--r--src/compiler/nir/nir.h3
-rw-r--r--src/compiler/nir/nir_lower_system_values.c3
-rw-r--r--src/compiler/spirv/vtn_amd.c2
-rw-r--r--src/compiler/spirv/vtn_subgroup.c12
-rw-r--r--src/compiler/spirv/vtn_variables.c3
-rw-r--r--src/intel/compiler/brw_kernel.c3
6 files changed, 10 insertions, 16 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index e5a37fb47fa..8e0c73b3459 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 4e443c3da79..3165b0c1cf4 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 12dd3a04e5e..e1e29c91591 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 d3b552132f3..eef50f22f9e 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 d752f35b885..4cbd667b3ab 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 acf0d2aee92..2776d6ec892 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);