From: Alyssa Rosenzweig Date: Sat, 12 Aug 2023 20:36:52 +0000 (-0400) Subject: nir: Assert that nir_ssa_for_src components matches X-Git-Tag: upstream/23.3.3~3279 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eff5e187144a6ac082f1ce21f1f4bbf5d907c324;p=platform%2Fupstream%2Fmesa.git nir: Assert that nir_ssa_for_src components matches In prep for removing the helper. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Emma Anholt Part-of: --- diff --git a/src/compiler/nir/nir_builder.c b/src/compiler/nir/nir_builder.c index 713864b..cbd0623 100644 --- a/src/compiler/nir/nir_builder.c +++ b/src/compiler/nir/nir_builder.c @@ -343,19 +343,10 @@ nir_vec_scalars(nir_builder *build, nir_scalar *comp, unsigned num_components) * See nir_ssa_for_alu_src() for alu instructions. */ nir_def * -nir_ssa_for_src(nir_builder *build, nir_src src, int num_components) +nir_ssa_for_src(nir_builder *build, nir_src src, ASSERTED int num_components) { - if (src.ssa->num_components == num_components) - return src.ssa; - - assert((unsigned)num_components <= nir_src_num_components(src)); - - nir_alu_src alu = { NIR_SRC_INIT }; - alu.src = src; - for (int j = 0; j < NIR_MAX_VEC_COMPONENTS; j++) - alu.swizzle[j] = j; - - return nir_mov_alu(build, alu, num_components); + assert(src.ssa->num_components == num_components && "now required"); + return src.ssa; } /**