From 5828b66b658d83c6b3dfec7313722f27c299ea25 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 23 Apr 2026 10:40:00 -0400 Subject: [PATCH] jay: convert to LCSSA for correctness with loops. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/intel/compiler/jay/jay_nir.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/intel/compiler/jay/jay_nir.c b/src/intel/compiler/jay/jay_nir.c index b2c32667328..7d9b4bfd724 100644 --- a/src/intel/compiler/jay/jay_nir.c +++ b/src/intel/compiler/jay/jay_nir.c @@ -459,6 +459,12 @@ jay_process_nir(const struct intel_device_info *devinfo, NIR_PASS(_, nir, nir_opt_copy_prop); NIR_PASS(_, nir, nir_opt_dce); + /* Jay requires LCSSA for correctness reading convergent loop-dependent + * values outside of a divergent loop. Converting to LCSSA inserts the + * required divergent 1-source phi after the loop. + */ + NIR_PASS(_, nir, nir_convert_to_lcssa, true, true); + /* Run divergence analysis at the end */ nir_sweep(nir); nj_index_ssa_defs(nir);