mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18: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> (cherry picked from commitfcc9203550)
This commit is contained in:
parent
fdb16f8eab
commit
bf7ee3de20
2 changed files with 5 additions and 1 deletions
|
|
@ -3144,7 +3144,7 @@
|
|||
"description": "nir/opt_remove_phis: skip unreachable phis",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "60776f87c38f69507d60591b46b3ea2efba8e188",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -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