This will be used by the loop unroll and lcssa passes. Reviewed-by: Thomas Helland <thomashellan...@gmail.com> --- 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 491859e..0ddd4e2 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2627,6 +2627,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@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev