diff options
Diffstat (limited to 'src/compiler/nir/nir_opt_if.c')
-rw-r--r-- | src/compiler/nir/nir_opt_if.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_if.c b/src/compiler/nir/nir_opt_if.c index 863ca630fbd..ec5bf1c9027 100644 --- a/src/compiler/nir/nir_opt_if.c +++ b/src/compiler/nir/nir_opt_if.c @@ -403,6 +403,13 @@ nir_opt_if(nir_shader *shader) * that don't dominate their uses. */ nir_lower_regs_to_ssa_impl(function->impl); + + /* Calling nir_convert_loop_to_lcssa() in opt_peel_loop_initial_if() + * adds extra phi nodes which may not be valid if they're used for + * something such as a deref. Remove any unneeded phis. + */ + nir_opt_remove_phis_impl(function->impl); + progress = true; } } |