nir: allow to fine tune unrolling for loops with soft fp64 ops

Lowered fp64 ops can blow up the loop bodies while still being
suitable for unrolling.
Allow for using different parameters to unroll loops with
soft fp64.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18863>
This commit is contained in:
SoroushIMG
2022-09-29 15:04:21 +01:00
committed by Marge Bot
parent 121f30005f
commit 1e8e785a07
3 changed files with 7 additions and 1 deletions

View File

@@ -875,6 +875,9 @@ check_unrolling_restrictions(nir_shader *shader, nir_loop *loop)
/* Unroll much more aggressively if it can hide load latency. */
if (shader->options->max_unroll_iterations_aggressive && can_pipeline_loads(loop))
max_iter = shader->options->max_unroll_iterations_aggressive;
/* Tune differently if the loop has double ops and soft fp64 is in use */
else if (shader->options->max_unroll_iterations_fp64 && loop->info->has_soft_fp64)
max_iter = shader->options->max_unroll_iterations_fp64;
unsigned trip_count =
li->max_trip_count ? li->max_trip_count : li->guessed_trip_count;