mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
nir/opt_remove_phis: skip unreachable phis
block->imm_dom is NULL for unreachable phis, so the dominance checks would crash.
These blocks should be removed by nir_opt_dead_cf, so don't bother optimizing
them here.
Fixes: 60776f87c3 ("nir/opt_remove_phis: rematerialize constants")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35935>
This commit is contained in:
parent
f4166ab1e1
commit
fcc9203550
1 changed files with 4 additions and 0 deletions
|
|
@ -95,6 +95,10 @@ remove_phis_instr(nir_builder *b, nir_phi_instr *phi, void *unused)
|
|||
nir_def *def = NULL;
|
||||
bool needs_remat = false;
|
||||
|
||||
/* Skip unreachable phis, they should be removed by nir_opt_dead_cf. */
|
||||
if (nir_block_is_unreachable(block))
|
||||
return false;
|
||||
|
||||
nir_foreach_phi_src(src, phi) {
|
||||
/* For phi nodes at the beginning of loops, we may encounter some
|
||||
* sources from backedges that point back to the destination of the
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue