From 544a739abc09bcb4150803e687f52736ebabebe3 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 7 Oct 2025 16:12:08 -0400 Subject: [PATCH] brw/nir_lower_fs_barycentrics: avoid nir_def_rewrite_uses_after replace is preferred when appropriate & should be faster. after is when you use the result in your lowering itself. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw/brw_nir_lower_fs_barycentrics.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/intel/compiler/brw/brw_nir_lower_fs_barycentrics.c b/src/intel/compiler/brw/brw_nir_lower_fs_barycentrics.c index 8db4ee832d5..a77db636295 100644 --- a/src/intel/compiler/brw/brw_nir_lower_fs_barycentrics.c +++ b/src/intel/compiler/brw/brw_nir_lower_fs_barycentrics.c @@ -47,13 +47,10 @@ lower_flat_inputs(nir_builder *b, nir_intrinsic_instr *intrin, void *data) nir_def *msaa_flags = nir_load_fs_msaa_intel(b); - nir_def *input_vertex = nir_bcsel(b, - nir_test_mask(b, msaa_flags, - INTEL_MSAA_FLAG_PROVOKING_VERTEX_LAST), - last_vtx, - first_vtx); - nir_def_rewrite_uses_after(&intrin->def, input_vertex); + nir_def *last = nir_test_mask(b, msaa_flags, INTEL_MSAA_FLAG_PROVOKING_VERTEX_LAST); + nir_def *input_vertex = nir_bcsel(b, last, last_vtx, first_vtx); + nir_def_replace(&intrin->def, input_vertex); return true; }