intel/fs: prevent large vector ops generated by peephole_ffma
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>
This commit is contained in:

committed by
Marge Bot

parent
bc08f43991
commit
bf59cfcee1
@@ -1458,8 +1458,19 @@ brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler,
|
|||||||
brw_nir_optimize(nir, compiler, is_scalar);
|
brw_nir_optimize(nir, compiler, is_scalar);
|
||||||
|
|
||||||
if (devinfo->ver >= 6) {
|
if (devinfo->ver >= 6) {
|
||||||
/* Try and fuse multiply-adds */
|
/* Try and fuse multiply-adds, if successful, run shrink_vectors to
|
||||||
OPT(brw_nir_opt_peephole_ffma);
|
* avoid peephole_ffma to generate things like this :
|
||||||
|
* vec16 ssa_0 = ...
|
||||||
|
* vec16 ssa_1 = fneg ssa_0
|
||||||
|
* vec1 ssa_2 = ffma ssa_1, ...
|
||||||
|
*
|
||||||
|
* We want this instead :
|
||||||
|
* vec16 ssa_0 = ...
|
||||||
|
* vec1 ssa_1 = fneg ssa_0.x
|
||||||
|
* vec1 ssa_2 = ffma ssa_1, ...
|
||||||
|
*/
|
||||||
|
if (OPT(brw_nir_opt_peephole_ffma))
|
||||||
|
OPT(nir_opt_shrink_vectors);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_scalar)
|
if (is_scalar)
|
||||||
|
Reference in New Issue
Block a user