From df37c7ca743f6407cee4cc6cde7a33fdfe8ed3b7 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 12 Aug 2025 14:54:59 +0300 Subject: [PATCH] brw: fix analysis dirtying with pulled constants Signed-off-by: Lionel Landwerlin Fixes: 5c17299084 ("brw: enable A64 pulling of push constants") Part-of: --- src/intel/compiler/brw_analysis.h | 7 +++++++ src/intel/compiler/brw_shader.cpp | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_analysis.h b/src/intel/compiler/brw_analysis.h index cf6aac18a9f..2b423edf0d4 100644 --- a/src/intel/compiler/brw_analysis.h +++ b/src/intel/compiler/brw_analysis.h @@ -82,6 +82,13 @@ operator|(brw_analysis_dependency_class x, brw_analysis_dependency_class y) static_cast(x) | static_cast(y)); } +inline brw_analysis_dependency_class +operator|=(brw_analysis_dependency_class x, brw_analysis_dependency_class y) +{ + return static_cast( + static_cast(x) | static_cast(y)); +} + /** * Instantiate a program analysis class \p L which can calculate an object of * type \p T as result. \p C is a closure that encapsulates whatever diff --git a/src/intel/compiler/brw_shader.cpp b/src/intel/compiler/brw_shader.cpp index e63cb19b322..fadb8d58135 100644 --- a/src/intel/compiler/brw_shader.cpp +++ b/src/intel/compiler/brw_shader.cpp @@ -691,6 +691,8 @@ brw_shader::assign_curb_setup() brw_imm_ud(INTEL_MASK(31, 6))); } + brw_analysis_dependency_class dirty_bits = BRW_DEPENDENCY_INSTRUCTIONS; + /* On Gfx12-HP we load constants at the start of the program using A32 * stateless messages. */ @@ -704,6 +706,7 @@ brw_shader::assign_curb_setup() if (i != 0) { if (pull_constants_a64) { + dirty_bits |= BRW_DEPENDENCY_VARIABLES; /* We need to do the carry manually as when this pass is run, * we're not expecting any 64bit ALUs. Unfortunately all the * 64bit lowering is done in NIR. @@ -765,7 +768,7 @@ brw_shader::assign_curb_setup() i += num_regs; } - invalidate_analysis(BRW_DEPENDENCY_INSTRUCTIONS); + invalidate_analysis(dirty_bits); } /* Map the offsets in the UNIFORM file to fixed HW regs. */