nir: Get rid of nir_dest_num_components()
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Mon, 14 Aug 2023 16:19:15 +0000 (11:19 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Aug 2023 21:22:53 +0000 (21:22 +0000)
commit9d81f13a757d4a525dd28671882709934c41f8a1
tree6cb9ea497c4a33056ad6f5729e08476fd4a8705b
parent80a1836d8bb68ef156254d72de0b3deb2dad17d1
nir: Get rid of nir_dest_num_components()

We could add a nir_def_num_components() helper but we use
ssa.num_components about 3x as often as nir_dest_num_components() today
so that's a major Coccinelle refactor anyway and this doesn't make it
much worse.  Most of this commit was generated byt the following
semantic patch:

    @@
    expression D;
    @@

    <...
    -nir_dest_num_components(D)
    +D.ssa.num_components
    ...

Some manual fixup was needed, especially in cpp files where Coccinelle
tends to give up the moment it sees any interesting C++.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>
58 files changed:
src/asahi/compiler/agx_compile.c
src/asahi/compiler/agx_nir_lower_address.c
src/asahi/compiler/agx_nir_lower_interpolation.c
src/asahi/compiler/agx_nir_lower_texture.c
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_legacy.c
src/compiler/nir/nir_lower_flrp.c
src/compiler/nir/nir_lower_helper_writes.c
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_lower_shader_calls.c
src/compiler/nir/nir_lower_tex.c
src/compiler/nir/nir_lower_vec_to_regs.c
src/compiler/nir/nir_opt_if.c
src/compiler/nir/nir_opt_phi_precision.c
src/compiler/nir/nir_opt_undef.c
src/compiler/nir/nir_serialize.c
src/compiler/nir/nir_split_64bit_vec3_and_vec4.c
src/compiler/nir/nir_validate.c
src/freedreno/ir3/ir3_compiler_nir.c
src/gallium/auxiliary/gallivm/lp_bld_nir.c
src/gallium/auxiliary/nir/nir_to_tgsi.c
src/gallium/drivers/asahi/agx_nir_lower_sysvals.c
src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c
src/gallium/drivers/lima/ir/lima_nir_lower_txp.c
src/gallium/drivers/lima/ir/lima_nir_split_load_input.c
src/gallium/drivers/lima/lima_program.c
src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp
src/gallium/drivers/r600/sfn/sfn_instr_mem.cpp
src/gallium/drivers/r600/sfn/sfn_nir.cpp
src/gallium/drivers/r600/sfn/sfn_nir_legalize_image_load_store.cpp
src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp
src/gallium/drivers/r600/sfn/sfn_nir_lower_tess_io.cpp
src/gallium/drivers/r600/sfn/sfn_shader.cpp
src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp
src/gallium/drivers/r600/sfn/sfn_shader_gs.cpp
src/gallium/drivers/r600/sfn/sfn_shader_vs.cpp
src/gallium/drivers/vc4/vc4_program.c
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/gallium/drivers/zink/zink_compiler.c
src/gallium/drivers/zink/zink_lower_cubemap_to_array.c
src/imagination/rogue/rogue_compile.c
src/intel/compiler/brw_fs_nir.cpp
src/intel/compiler/brw_mesh.cpp
src/intel/compiler/brw_nir_blockify_uniform_loads.c
src/intel/compiler/brw_vec4_nir.cpp
src/microsoft/clc/clc_nir.c
src/microsoft/compiler/dxil_nir.c
src/microsoft/compiler/dxil_nir_lower_int_samplers.c
src/microsoft/compiler/dxil_nir_tess.c
src/microsoft/compiler/nir_to_dxil.c
src/microsoft/spirv_to_dxil/dxil_spirv_nir.c
src/nouveau/codegen/nv50_ir_from_nir.cpp
src/panfrost/compiler/bi_lower_divergent_indirects.c
src/panfrost/compiler/bifrost_compile.c
src/panfrost/midgard/midgard_compile.c
src/panfrost/util/pan_collect_varyings.c
src/panfrost/vulkan/panvk_vX_shader.c