nir: Get rid of nir_dest_bit_size()
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Mon, 14 Aug 2023 16:08:07 +0000 (11:08 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 14 Aug 2023 21:22:53 +0000 (21:22 +0000)
commit80a1836d8bb68ef156254d72de0b3deb2dad17d1
tree45dd4bb7fb035206abe051adb66a0a3891003ab3
parent0dd76b1abb952476a0d8723c7b0414406ce17f28
nir: Get rid of nir_dest_bit_size()

We could add a nir_def_bit_size() helper but we use ->bit_size about 3x
as often as nir_dest_bit_size() 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_bit_size(D)
    +D.ssa.bit_size
    ...

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>
78 files changed:
src/amd/llvm/ac_nir_to_llvm.c
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_load_mask.c
src/asahi/compiler/agx_nir_lower_texture.c
src/asahi/compiler/agx_nir_lower_ubo.c
src/asahi/lib/agx_nir_lower_msaa.c
src/asahi/lib/agx_nir_lower_sample_intrinsics.c
src/asahi/lib/agx_nir_lower_tilebuffer.c
src/asahi/lib/agx_nir_lower_vbo.c
src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/v3d_nir_lower_load_store_bitsize.c
src/compiler/nir/nir.h
src/compiler/nir/nir_gather_info.c
src/compiler/nir/nir_loop_analyze.c
src/compiler/nir/nir_lower_amul.c
src/compiler/nir/nir_lower_bool_to_bitsize.c
src/compiler/nir/nir_lower_flrp.c
src/compiler/nir/nir_lower_helper_writes.c
src/compiler/nir/nir_lower_image.c
src/compiler/nir/nir_lower_image_atomics_to_global.c
src/compiler/nir/nir_lower_int64.c
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_lower_memcpy.c
src/compiler/nir/nir_lower_robust_access.c
src/compiler/nir/nir_lower_task_shader.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_intrinsics.c
src/compiler/nir/nir_opt_phi_precision.c
src/compiler/nir/nir_opt_undef.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/freedreno/ir3/ir3_image.c
src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
src/freedreno/ir3/ir3_nir_lower_64b.c
src/freedreno/ir3/ir3_nir_lower_wide_load_store.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/r600/sfn/sfn_nir_legalize_image_load_store.cpp
src/gallium/drivers/r600/sfn/sfn_nir_lower_64bit.cpp
src/gallium/drivers/radeonsi/si_shader_nir.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/gallium/frontends/clover/nir/invocation.cpp
src/gallium/frontends/rusticl/rusticl_nir.c
src/intel/compiler/brw_fs_nir.cpp
src/intel/compiler/brw_mesh.cpp
src/intel/compiler/brw_nir_analyze_ubo_ranges.c
src/intel/compiler/brw_nir_blockify_uniform_loads.c
src/intel/compiler/brw_nir_lower_conversions.c
src/intel/compiler/brw_nir_lower_sparse.c
src/intel/compiler/brw_vec4_gs_nir.cpp
src/intel/compiler/brw_vec4_nir.cpp
src/intel/compiler/brw_vec4_tcs.cpp
src/intel/compiler/brw_vec4_tes.cpp
src/intel/vulkan/anv_nir_apply_pipeline_layout.c
src/intel/vulkan/anv_nir_push_descriptor_analysis.c
src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c
src/microsoft/clc/clc_compiler.c
src/microsoft/clc/clc_nir.c
src/microsoft/compiler/dxil_nir.c
src/microsoft/compiler/nir_to_dxil.c
src/microsoft/spirv_to_dxil/dxil_spirv_nir.c
src/panfrost/compiler/bi_lower_divergent_indirects.c
src/panfrost/compiler/bifrost_compile.c
src/panfrost/midgard/midgard_compile.c
src/panfrost/midgard/nir_fuse_io_16.c
src/panfrost/util/pan_lower_64bit_intrin.c
src/panfrost/util/pan_lower_framebuffer.c
src/panfrost/util/pan_lower_sample_position.c
src/panfrost/vulkan/panvk_vX_shader.c
src/vulkan/runtime/vk_nir_convert_ycbcr.c