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>
This commit is contained in:
Mykhailo Skorokhodov 2023-05-23 23:26:43 +03:00 committed by Marge Bot
parent fb8c48f4fc
commit 40042ed25a

View file

@ -397,6 +397,7 @@ opt_dead_cf_impl(nir_function_impl *impl)
if (progress) {
nir_metadata_preserve(impl, nir_metadata_none);
nir_rematerialize_derefs_in_use_blocks_impl(impl);
/* The CF manipulation code called by this pass is smart enough to keep
* from breaking any SSA use/def chains by replacing any uses of removed