From 283734b59841ed58ef09df48866a44e8497dd52d 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: (cherry picked from commit f18aca868993576822e41175588e9bd683bb81ac) --- .pick_status.json | 2 +- src/intel/compiler/brw_analysis.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 0f9270ec9b4..2312fcd6879 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6264,7 +6264,7 @@ "description": "intel/brw: Fix implementaiton of |= operator for enum", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "df37c7ca743f6407cee4cc6cde7a33fdfe8ed3b7", "notes": null diff --git a/src/intel/compiler/brw_analysis.h b/src/intel/compiler/brw_analysis.h index 2b423edf0d4..496265fb057 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; } /**