mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-20 00:28:08 +02:00
nir/opt_uniform_subgroup: preserve divergence during optimization
nir_def_init sets divergent = true, this means for something like reduce(reduce(convergent)) we previously only optimized the inner reduce. No fossil changes at the moment, but I hit this when trying to optimize shared memory to subgroup operations. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41542>
This commit is contained in:
parent
e44cb38c3b
commit
0be2d71ad1
1 changed files with 6 additions and 0 deletions
|
|
@ -323,6 +323,12 @@ opt_uniform_subgroup_instr(nir_builder *b, nir_intrinsic_instr *intrin, void *_s
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* Divergence shouldn't change from the optimization that we have done,
|
||||
* so preserve it in case another subgroup operation uses the result.
|
||||
*/
|
||||
replacement->divergent = intrin->def.divergent;
|
||||
|
||||
nir_def_replace(&intrin->def, replacement);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue