nir: Rematerialize derefs after opt_dead_cf
authorMykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Tue, 23 May 2023 20:26:43 +0000 (23:26 +0300)
committerMarge Bot <emma+marge@anholt.net>
Fri, 9 Jun 2023 21:35:21 +0000 (21:35 +0000)
commit40042ed25aecda65d5477c517ae13807e4a4b39f
treeb4ce5eca9d0695537c237406ab58166bd937dc4b
parentfb8c48f4fcc6c3d95e2b4608e92013fadad42c57
nir: Rematerialize derefs after opt_dead_cf

Adding `nir_rematerialize_derefs_in_use_blocks_impl`
solves some cases when 'opt_dead_cf()' generates
a phi instruction for the first argument
of the `deref_store` intrinsic.

Signed-off-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6742
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22983>
src/compiler/nir/nir_opt_dead_cf.c