From 1bd9c1b95890de05ccbe1b0b3c849ee7eb1b84b5 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 19 Mar 2024 22:31:02 -0500 Subject: [PATCH] nir: Mark divergent regs in phis_to_regs_block() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way we avoid destroying divergence information which may be used by passes which also need to lower phis. Reviewed-by: Alyssa Rosenzweig Reviewed-by: Daniel Schürmann Part-of: --- src/compiler/nir/nir_from_ssa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/nir/nir_from_ssa.c b/src/compiler/nir/nir_from_ssa.c index 83a57e32df3..d7bf90a6b4e 100644 --- a/src/compiler/nir/nir_from_ssa.c +++ b/src/compiler/nir/nir_from_ssa.c @@ -1169,6 +1169,7 @@ nir_lower_phis_to_regs_block(nir_block *block) bool progress = false; nir_foreach_phi_safe(phi, block) { nir_def *reg = decl_reg_for_ssa_def(&b, &phi->def); + set_reg_divergent(reg, phi->def.divergent); b.cursor = nir_after_instr(&phi->instr); nir_def_rewrite_uses(&phi->def, nir_load_reg(&b, reg));