]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/tree-ssa-loop.h
[committed] [RISC-V] Don't run new rounding tests on newlib risc-v targets
[thirdparty/gcc.git] / gcc / tree-ssa-loop.h
CommitLineData
71343877 1/* Header file for SSA loop optimizations.
a945c346 2 Copyright (C) 2013-2024 Free Software Foundation, Inc.
71343877
AM
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_H
21#define GCC_TREE_SSA_LOOP_H
22
807e902e 23
71343877
AM
24/* Affine iv. */
25
84562394 26struct affine_iv
71343877
AM
27{
28 /* Iv = BASE + STEP * i. */
29 tree base, step;
30
31 /* True if this iv does not overflow. */
32 bool no_overflow;
84562394 33};
71343877
AM
34
35/* Description of number of iterations of a loop. All the expressions inside
36 the structure can be evaluated at the end of the loop's preheader
37 (and due to ssa form, also anywhere inside the body of the loop). */
38
6c1dae73 39class tree_niter_desc
71343877 40{
6c1dae73 41public:
71343877
AM
42 tree assumptions; /* The boolean expression. If this expression evaluates
43 to false, then the other fields in this structure
44 should not be used; there is no guarantee that they
45 will be correct. */
46 tree may_be_zero; /* The boolean expression. If it evaluates to true,
47 the loop will exit in the first iteration (i.e.
48 its latch will not be executed), even if the niter
49 field says otherwise. */
50 tree niter; /* The expression giving the number of iterations of
51 a loop (provided that assumptions == true and
52 may_be_zero == false), more precisely the number
53 of executions of the latch of the loop. */
807e902e 54 widest_int max; /* The upper bound on the number of iterations of
f80bfdcc
AC
55 the loop. If niter is constant, then these values
56 must agree. */
71343877 57
88ee126e
AC
58 /* The simplified shape of the exit condition. This information is used by
59 loop unrolling. If CMP is ERROR_MARK, then the loop cannot be unrolled.
60 Otherwise, the loop exits if CONTROL CMP BOUND is false, where CMP is one
61 of NE_EXPR, LT_EXPR, or GT_EXPR, and CONTROL.STEP is positive if CMP is
62 LT_EXPR and negative if CMP is GT_EXPR. */
71343877
AM
63 affine_iv control;
64 tree bound;
65 enum tree_code cmp;
66};
67
68extern bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *);
69extern char *get_lsm_tmp_name (tree ref, unsigned n, const char *suffix = NULL);
99b1c316 70extern unsigned tree_num_loop_insns (class loop *, struct eni_weights *);
71343877
AM
71
72/* Returns the loop of the statement STMT. */
73
cb3e0eac 74inline class loop *
355fe088 75loop_containing_stmt (gimple *stmt)
71343877
AM
76{
77 basic_block bb = gimple_bb (stmt);
78 if (!bb)
79 return NULL;
80
81 return bb->loop_father;
82}
83
84#endif /* GCC_TREE_SSA_LOOP_H */