diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index 53084b08475..e1a39a9ca9e 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -2371,6 +2371,14 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler, OPT(nir_lower_locals_to_regs, 32); + nir_validate_ssa_dominance(nir, "before nir_convert_from_ssa"); + + /* Rerun the divergence analysis before convert_from_ssa as this pass has + * some assert on consistent divergence flags. + */ + NIR_PASS(_, nir, nir_convert_to_lcssa, true, true); + nir_divergence_analysis(nir); + if (unlikely(debug_enabled || archiver)) { /* Re-index SSA defs so we print more sensible numbers. */ nir_foreach_function_impl(impl, nir) { @@ -2387,14 +2395,6 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler, brw_debug_archive_nir(archiver, nir, dispatch_width, "ssa"); } - nir_validate_ssa_dominance(nir, "before nir_convert_from_ssa"); - - /* Rerun the divergence analysis before convert_from_ssa as this pass has - * some assert on consistent divergence flags. - */ - NIR_PASS(_, nir, nir_convert_to_lcssa, true, true); - nir_divergence_analysis(nir); - OPT(nir_convert_from_ssa, true, true); OPT(nir_opt_dce);