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: df37c7ca74 ("brw: fix analysis dirtying with pulled constants")
CID: 1665293
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37263>
(cherry picked from commit f18aca8689)
This commit is contained in:
Dylan Baker 2025-09-09 12:04:21 -07:00 committed by Eric Engestrom
parent c6aed295dc
commit 283734b598
2 changed files with 3 additions and 4 deletions

View file

@ -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

View file

@ -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<brw_analysis_dependency_class>(
static_cast<unsigned>(x) | static_cast<unsigned>(y));
return x = x | y;
}
/**