nir/nir_opt_copy_prop_vars: remove extra loop
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 20 Dec 2022 23:29:45 +0000 (10:29 +1100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 16 Feb 2023 23:31:59 +0000 (23:31 +0000)
commit8f6f5730f62a71e4209b2ebe657be9f7ad3727af
treed9553c9af07e6ca17d765f3d22a974e6ffec8f83
parent4e09d37f3bd4b2f5837040cb1695d151672944e1
nir/nir_opt_copy_prop_vars: remove extra loop

The fix in 947f7b452a55 introduced an extra loop over the copies
array to find the correct entry in the case it had been moved.

The problem is these loops can be iterated over millions of times
so lets simply update the entry pointer in the case we change its
location in the array.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
src/compiler/nir/nir_opt_copy_prop_vars.c