From 3e493e03ccf0344fa14b36efb6255436f35e4960 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 11 Aug 2025 14:05:44 -0700 Subject: [PATCH] brw: Move "SSA form" printing to after divergence analysis is run We were printing the SSA form, then immediately running divergence analysis. This patch flips those, so we can see con/div in INTEL_DEBUG output for SSA form, which is really useful. Reviewed-by: Lionel Landwerlin Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_nir.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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);