GCC Middle and Back End API Reference
tree-ssa-loop-niter.h
Go to the documentation of this file.
1/* Header file for loop iteration estimates.
2 Copyright (C) 2013-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_TREE_SSA_LOOP_NITER_H
21#define GCC_TREE_SSA_LOOP_NITER_H
22
25extern bool loop_only_exit_p (const class loop *, basic_block *body,
27extern bool number_of_iterations_exit (class loop *, edge,
28 class tree_niter_desc *niter, bool,
29 bool every_iteration = true,
30 basic_block * = NULL);
32 class tree_niter_desc *,
33 gcond **, bool = true,
34 basic_block * = NULL);
35extern tree find_loop_niter (class loop *, edge *);
36extern bool finite_loop_p (class loop *);
37extern tree loop_niter_by_eval (class loop *, edge);
38extern tree find_loop_niter_by_eval (class loop *, edge *);
39extern bool estimated_loop_iterations (class loop *, widest_int *);
40extern HOST_WIDE_INT estimated_loop_iterations_int (class loop *);
41extern bool max_loop_iterations (class loop *, widest_int *);
42extern HOST_WIDE_INT max_loop_iterations_int (class loop *);
43extern bool likely_max_loop_iterations (class loop *, widest_int *);
44extern HOST_WIDE_INT likely_max_loop_iterations_int (class loop *);
45extern HOST_WIDE_INT max_stmt_executions_int (class loop *);
46extern HOST_WIDE_INT likely_max_stmt_executions_int (class loop *);
47extern HOST_WIDE_INT estimated_stmt_executions_int (class loop *);
48extern bool max_stmt_executions (class loop *, widest_int *);
49extern bool likely_max_stmt_executions (class loop *, widest_int *);
50extern bool estimated_stmt_executions (class loop *, widest_int *);
52extern void estimate_numbers_of_iterations (class loop *);
53extern bool stmt_dominates_stmt_p (gimple *, gimple *);
54extern bool nowrap_type_p (tree);
56extern bool scev_probably_wraps_p (tree, tree, tree, gimple *,
57 class loop *, bool, tree * = nullptr);
58extern void free_numbers_of_iterations_estimates (class loop *);
61 tree, tree (*)(tree, void *) = NULL,
62 void * = NULL, bool do_fold = true);
63extern void substitute_in_loop_info (class loop *, tree, tree);
64
65#endif /* GCC_TREE_SSA_LOOP_NITER_H */
HOST_WIDE_INT likely_max_stmt_executions_int(class loop *loop)
Definition cfgloop.cc:1990
HOST_WIDE_INT max_stmt_executions_int(class loop *loop)
Definition cfgloop.cc:1971
Definition cfgloop.h:120
Definition tree-ssa-loop.h:44
struct basic_block_def * basic_block
Definition coretypes.h:359
class edge_def * edge
Definition coretypes.h:356
const class edge_def * const_edge
Definition coretypes.h:357
union tree_node * tree
Definition coretypes.h:97
Definition function.h:249
Definition gimple.h:864
Definition gimple.h:224
#define NULL
Definition system.h:55
HOST_WIDE_INT estimated_stmt_executions_int(class loop *loop)
Definition tree-ssa-loop-niter.cc:5192
bool max_stmt_executions(class loop *loop, widest_int *nit)
Definition tree-ssa-loop-niter.cc:5211
bool nowrap_type_p(tree type)
Definition tree-ssa-loop-niter.cc:5388
bool number_of_iterations_exit_assumptions(class loop *loop, edge exit, class tree_niter_desc *niter, gcond **at_stmt, bool every_iteration, basic_block *body)
Definition tree-ssa-loop-niter.cc:3252
bool likely_max_loop_iterations(class loop *loop, widest_int *nit)
Definition tree-ssa-loop-niter.cc:5157
tree find_loop_niter(class loop *loop, edge *exit)
Definition tree-ssa-loop-niter.cc:3423
tree simplify_using_initial_conditions(class loop *loop, tree expr)
Definition tree-ssa-loop-niter.cc:3112
bool scev_probably_wraps_p(tree var, tree base, tree step, gimple *at_stmt, class loop *loop, bool use_overflow_semantics, tree *nowrap_bound)
Definition tree-ssa-loop-niter.cc:5651
bool number_of_iterations_exit(class loop *loop, edge exit, class tree_niter_desc *niter, bool warn, bool every_iteration, basic_block *body)
Definition tree-ssa-loop-niter.cc:3396
tree loop_niter_by_eval(class loop *loop, edge exit)
Definition tree-ssa-loop-niter.cc:3687
tree find_loop_niter_by_eval(class loop *loop, edge *exit)
Definition tree-ssa-loop-niter.cc:3823
bool max_loop_iterations(class loop *loop, widest_int *nit)
Definition tree-ssa-loop-niter.cc:5122
tree expand_simple_operations(tree expr, tree stop)
Definition tree-ssa-loop-niter.cc:2980
bool likely_max_stmt_executions(class loop *loop, widest_int *nit)
Definition tree-ssa-loop-niter.cc:5230
bool estimated_stmt_executions(class loop *loop, widest_int *nit)
Definition tree-ssa-loop-niter.cc:5249
void substitute_in_loop_info(class loop *loop, tree name, tree val)
Definition tree-ssa-loop-niter.cc:5754
void estimate_numbers_of_iterations(class loop *loop)
Definition tree-ssa-loop-niter.cc:4975
void free_numbers_of_iterations_estimates(class loop *loop)
Definition tree-ssa-loop-niter.cc:5717
bool stmt_dominates_stmt_p(gimple *s1, gimple *s2)
Definition tree-ssa-loop-niter.cc:5275
HOST_WIDE_INT likely_max_loop_iterations_int(class loop *loop)
Definition tree-ssa-loop-niter.cc:5172
tree simplify_replace_tree(tree expr, tree old, tree new_tree, tree(*valueize)(tree, void *), void *context, bool do_fold)
Definition tree-ssa-loop-niter.cc:2781
bool estimated_loop_iterations(class loop *loop, widest_int *nit)
Definition tree-ssa-loop-niter.cc:5086
HOST_WIDE_INT max_loop_iterations_int(class loop *loop)
Definition tree-ssa-loop-niter.cc:5137
tree get_niter_type_bound(tree type, tree base, tree step)
Definition tree-ssa-loop-niter.cc:5401
bool loop_only_exit_p(const class loop *loop, basic_block *body, const_edge exit)
Definition tree-ssa-loop-niter.cc:3226
bool finite_loop_p(class loop *loop)
Definition tree-ssa-loop-niter.cc:3484
HOST_WIDE_INT estimated_loop_iterations_int(class loop *loop)
Definition tree-ssa-loop-niter.cc:5101
generic_wide_int< widest_int_storage< WIDEST_INT_MAX_PRECISION > > widest_int
Definition wide-int.h:345