pan/bi: Add and use bi_replace_src helper
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 26 Jul 2022 17:35:34 +0000 (13:35 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Sep 2022 16:03:24 +0000 (16:03 +0000)
commit875a34160acfbd4d3a7ce3e250da83719af4e2af
tree851fda26a8fcd837590f385ca2616f64b4ad1779
parentf01ccdbf69b742f9f4c86d3cb73a770e0293fc02
pan/bi: Add and use bi_replace_src helper

This is a common pattern. Make it more ergonomic. With the help of Coccinelle:

   @@
   expression E;
   expression R;
   expression instruction;
   @@

   -instruction->src[E] = bi_replace_index(instruction->src[E], R);
   +bi_replace_src(instruction, E, R);

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>
src/panfrost/bifrost/bi_lower_swizzle.c
src/panfrost/bifrost/bi_opt_copy_prop.c
src/panfrost/bifrost/bi_opt_cse.c
src/panfrost/bifrost/bi_ra.c
src/panfrost/bifrost/bi_schedule.c
src/panfrost/bifrost/compiler.h
src/panfrost/bifrost/valhall/va_validate.c