[Mesa-dev] [PATCH 04/12] nir: add is_simple_for_loop() helper
Thomas Helland
thomashelland90 at gmail.com
Sat Aug 27 13:50:25 UTC 2016
This patch is:
Reviewed-by: Thomas Helland <thomashelland90 at gmail.com>
2016-08-27 8:03 GMT+02:00 Timothy Arceri <timothy.arceri at collabora.com>:
> This will be used by the loop unroll and lcssa passes.
> ---
> src/compiler/nir/nir.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
> index f85e829..6b0a73f 100644
> --- a/src/compiler/nir/nir.h
> +++ b/src/compiler/nir/nir.h
> @@ -2614,6 +2614,14 @@ bool nir_normalize_cubemap_coords(nir_shader *shader);
>
> void nir_live_ssa_defs_impl(nir_function_impl *impl);
>
> +static inline bool
> +is_simple_for_loop(nir_shader *shader, nir_loop_info *li)
> +{
> + unsigned max_iter = shader->options->max_unroll_iterations;
> + return li->is_trip_count_known && li->trip_count < max_iter &&
> + list_is_singular(&li->loop_terminator_list);
> +}
> +
> void nir_loop_analyze_impl(nir_function_impl *impl);
> void nir_loop_analyze(nir_shader *shader);
>
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list