Module: Mesa Branch: main Commit: c39896b17b48178fdf89400ce209c22a61f583db URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c39896b17b48178fdf89400ce209c22a61f583db
Author: Alyssa Rosenzweig <[email protected]> Date: Mon Aug 14 09:58:47 2023 -0400 nir: Use getters for nir_src::parent_* First, we need to give the parent_instr field a unique name to be able to replace with a helper. We have parent_instr fields for both nir_src and nir_def, so let's rename nir_src::parent_instr in preparation for rework. This was done with a combination of sed and manual fix-ups. Then we use semantic patches plus manual fixups: @@ expression s; @@ -s->renamed_parent_instr +nir_src_parent_instr(s) @@ expression s; @@ -s.renamed_parent_instr +nir_src_parent_instr(&s) @@ expression s; @@ -s->parent_if +nir_src_parent_if(s) @@ expression s; @@ -s.renamed_parent_if +nir_src_parent_if(&s) @@ expression s; @@ -s->is_if +nir_src_is_if(s) @@ expression s; @@ -s.is_if +nir_src_is_if(&s) Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Acked-by: Faith Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671> --- .../compiler/aco_instruction_selection_setup.cpp | 8 ++--- src/asahi/compiler/agx_nir_opt_preamble.c | 11 +++---- src/compiler/nir/nir.c | 20 ++++++------- src/compiler/nir/nir.h | 34 +++++++++++----------- src/compiler/nir/nir_deref.c | 21 ++++++------- src/compiler/nir/nir_from_ssa.c | 10 +++---- src/compiler/nir/nir_group_loads.c | 4 +-- src/compiler/nir/nir_legacy.c | 14 ++++----- src/compiler/nir/nir_loop_analyze.c | 2 +- src/compiler/nir/nir_lower_flrp.c | 2 +- src/compiler/nir/nir_lower_mediump.c | 4 +-- src/compiler/nir/nir_lower_reg_intrinsics_to_ssa.c | 2 +- src/compiler/nir/nir_lower_scratch.c | 10 +++---- src/compiler/nir/nir_lower_shader_calls.c | 20 ++++++------- src/compiler/nir/nir_lower_vec_to_regs.c | 4 +-- src/compiler/nir/nir_move_vec_src_uses_to_dest.c | 10 +++---- src/compiler/nir/nir_opt_comparison_pre.c | 2 +- src/compiler/nir/nir_opt_copy_propagate.c | 4 +-- src/compiler/nir/nir_opt_dead_cf.c | 6 ++-- src/compiler/nir/nir_opt_gcm.c | 4 +-- src/compiler/nir/nir_opt_if.c | 16 +++++----- src/compiler/nir/nir_opt_intrinsics.c | 10 +++---- src/compiler/nir/nir_opt_move.c | 2 +- src/compiler/nir/nir_opt_peephole_select.c | 12 ++++---- src/compiler/nir/nir_opt_phi_precision.c | 6 ++-- src/compiler/nir/nir_opt_preamble.c | 2 +- src/compiler/nir/nir_opt_reassociate_bfi.c | 4 +-- src/compiler/nir/nir_opt_rematerialize_compares.c | 16 +++++----- src/compiler/nir/nir_opt_shrink_vectors.c | 12 ++++---- src/compiler/nir/nir_opt_sink.c | 6 ++-- src/compiler/nir/nir_opt_undef.c | 6 ++-- src/compiler/nir/nir_opt_vectorize.c | 6 ++-- src/compiler/nir/nir_range_analysis.c | 8 ++--- src/compiler/nir/nir_remove_dead_variables.c | 6 ++-- src/compiler/nir/nir_repair_ssa.c | 20 ++++++------- src/compiler/nir/nir_schedule.c | 14 ++++----- src/compiler/nir/nir_search.c | 4 +-- src/compiler/nir/nir_search_helpers.h | 6 ++-- src/compiler/nir/nir_to_lcssa.c | 20 ++++++------- src/compiler/nir/nir_trivialize_registers.c | 4 +-- src/compiler/nir/nir_validate.c | 14 ++++----- src/freedreno/ir3/ir3_nir_opt_preamble.c | 10 +++---- src/gallium/auxiliary/nir/nir_to_tgsi.c | 8 ++--- src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c | 4 +-- src/gallium/drivers/etnaviv/etnaviv_compiler_nir.h | 4 +-- src/gallium/drivers/lima/ir/gp/nir.c | 4 +-- .../drivers/lima/ir/lima_nir_duplicate_consts.c | 10 +++---- .../drivers/lima/ir/lima_nir_duplicate_intrinsic.c | 10 +++---- src/gallium/drivers/lima/ir/lima_nir_split_loads.c | 14 ++++----- src/gallium/drivers/r300/compiler/nir_to_rc.c | 8 ++--- .../drivers/r600/sfn/sfn_nir_lower_tess_io.cpp | 2 +- .../drivers/zink/nir_to_spirv/nir_to_spirv.c | 4 +-- .../frontends/lavapipe/lvp_lower_exec_graph.c | 3 +- src/intel/compiler/brw_fs.cpp | 6 ++-- .../brw_nir_lower_non_uniform_resource_intel.c | 2 +- src/intel/compiler/brw_nir_opt_peephole_ffma.c | 4 +-- src/microsoft/clc/clc_compiler.c | 8 ++--- src/microsoft/compiler/dxil_nir.c | 6 ++-- src/microsoft/compiler/nir_to_dxil.c | 2 +- src/panfrost/midgard/nir_fuse_io_16.c | 4 +-- 60 files changed, 251 insertions(+), 248 deletions(-) Diff: http://cgit.freedesktop.org/mesa/mesa/diff/?id=c39896b17b48178fdf89400ce209c22a61f583db
