From f9881a9eec7a33a9a4a82842bbd3ecda07cf83d6 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: (cherry picked from commit df37c7ca743f6407cee4cc6cde7a33fdfe8ed3b7) --- .pick_status.json | 2 +- src/intel/compiler/brw_analysis.h | 7 +++++++ src/intel/compiler/brw_shader.cpp | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 4790cffdd14..474a75a2ca4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7124,7 +7124,7 @@ "description": "brw: fix analysis dirtying with pulled constants", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "5c1729908471a1b000fa4ab0b29ac9f79a8b7394", "notes": null 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 1100492c4c3..e4e2e7ead5a 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. */