mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 06:20:09 +01:00
intel/compiler: Combine control barriers with identical memory semantics
This prevents the second barrier generating a spurious, identical fence message as the first barrier. fossil-db stats on Alchemist: Totals: Instrs: 196513342 -> 196512777 (-0.00%); split: -0.00%, +0.00% Cycles: 14271426028 -> 14271404569 (-0.00%); split: -0.00%, +0.00% Send messages: 8021892 -> 8021770 (-0.00%) Totals from 46 (0.01% of 653252) affected shaders: Instrs: 76761 -> 76196 (-0.74%); split: -0.75%, +0.01% Cycles: 2027946 -> 2006487 (-1.06%); split: -1.45%, +0.39% Send messages: 7589 -> 7467 (-1.61%) Nothing in shader-db was affected. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24842>
This commit is contained in:
parent
9f98f20c58
commit
5eddf60e56
1 changed files with 12 additions and 0 deletions
|
|
@ -1350,6 +1350,18 @@ bool combine_all_memory_barriers(nir_intrinsic_instr *a,
|
|||
nir_intrinsic_instr *b,
|
||||
void *data)
|
||||
{
|
||||
/* Combine control barriers with identical memory semantics. This prevents
|
||||
* the second barrier generating a spurious, identical fence message as the
|
||||
* first barrier.
|
||||
*/
|
||||
if (nir_intrinsic_memory_modes(a) == nir_intrinsic_memory_modes(b) &&
|
||||
nir_intrinsic_memory_semantics(a) == nir_intrinsic_memory_semantics(b) &&
|
||||
nir_intrinsic_memory_scope(a) == nir_intrinsic_memory_scope(b)) {
|
||||
nir_intrinsic_set_execution_scope(a, MAX2(nir_intrinsic_execution_scope(a),
|
||||
nir_intrinsic_execution_scope(b)));
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Only combine pure memory barriers */
|
||||
if ((nir_intrinsic_execution_scope(a) != SCOPE_NONE) ||
|
||||
(nir_intrinsic_execution_scope(b) != SCOPE_NONE))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue