From f18aca868993576822e41175588e9bd683bb81ac Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 9 Sep 2025 12:04:21 -0700 Subject: [PATCH] intel/brw: Fix implementaiton of |= operator for enum The current implementation does nothing, since it has no side effects, only a return value. By passing `x` as a reference we can mutate the value before returning. Fixes: df37c7ca743 ("brw: fix analysis dirtying with pulled constants") CID: 1665293 Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_analysis.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/intel/compiler/brw_analysis.h b/src/intel/compiler/brw_analysis.h index d4b63904d96..ed8ec1a70fa 100644 --- a/src/intel/compiler/brw_analysis.h +++ b/src/intel/compiler/brw_analysis.h @@ -83,10 +83,9 @@ operator|(brw_analysis_dependency_class x, brw_analysis_dependency_class y) } inline brw_analysis_dependency_class -operator|=(brw_analysis_dependency_class x, brw_analysis_dependency_class y) +operator|=(brw_analysis_dependency_class &x, brw_analysis_dependency_class y) { - return static_cast( - static_cast(x) | static_cast(y)); + return x = x | y; } /**