annotate gcc/tree-ssa-loop.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Header file for SSA loop optimizations.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2013-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #ifndef GCC_TREE_SSA_LOOP_H
kono
parents:
diff changeset
21 #define GCC_TREE_SSA_LOOP_H
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 /* Affine iv. */
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 struct affine_iv
kono
parents:
diff changeset
27 {
kono
parents:
diff changeset
28 /* Iv = BASE + STEP * i. */
kono
parents:
diff changeset
29 tree base, step;
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 /* True if this iv does not overflow. */
kono
parents:
diff changeset
32 bool no_overflow;
kono
parents:
diff changeset
33 };
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 /* Description of number of iterations of a loop. All the expressions inside
kono
parents:
diff changeset
36 the structure can be evaluated at the end of the loop's preheader
kono
parents:
diff changeset
37 (and due to ssa form, also anywhere inside the body of the loop). */
kono
parents:
diff changeset
38
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
39 class tree_niter_desc
111
kono
parents:
diff changeset
40 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
41 public:
111
kono
parents:
diff changeset
42 tree assumptions; /* The boolean expression. If this expression evaluates
kono
parents:
diff changeset
43 to false, then the other fields in this structure
kono
parents:
diff changeset
44 should not be used; there is no guarantee that they
kono
parents:
diff changeset
45 will be correct. */
kono
parents:
diff changeset
46 tree may_be_zero; /* The boolean expression. If it evaluates to true,
kono
parents:
diff changeset
47 the loop will exit in the first iteration (i.e.
kono
parents:
diff changeset
48 its latch will not be executed), even if the niter
kono
parents:
diff changeset
49 field says otherwise. */
kono
parents:
diff changeset
50 tree niter; /* The expression giving the number of iterations of
kono
parents:
diff changeset
51 a loop (provided that assumptions == true and
kono
parents:
diff changeset
52 may_be_zero == false), more precisely the number
kono
parents:
diff changeset
53 of executions of the latch of the loop. */
kono
parents:
diff changeset
54 widest_int max; /* The upper bound on the number of iterations of
kono
parents:
diff changeset
55 the loop. */
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 /* The simplified shape of the exit condition. The loop exits if
kono
parents:
diff changeset
58 CONTROL CMP BOUND is false, where CMP is one of NE_EXPR,
kono
parents:
diff changeset
59 LT_EXPR, or GT_EXPR, and step of CONTROL is positive if CMP is
kono
parents:
diff changeset
60 LE_EXPR and negative if CMP is GE_EXPR. This information is used
kono
parents:
diff changeset
61 by loop unrolling. */
kono
parents:
diff changeset
62 affine_iv control;
kono
parents:
diff changeset
63 tree bound;
kono
parents:
diff changeset
64 enum tree_code cmp;
kono
parents:
diff changeset
65 };
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 extern bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *);
kono
parents:
diff changeset
68 extern char *get_lsm_tmp_name (tree ref, unsigned n, const char *suffix = NULL);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
69 extern unsigned tree_num_loop_insns (class loop *, struct eni_weights *);
111
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 /* Returns the loop of the statement STMT. */
kono
parents:
diff changeset
72
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
73 static inline class loop *
111
kono
parents:
diff changeset
74 loop_containing_stmt (gimple *stmt)
kono
parents:
diff changeset
75 {
kono
parents:
diff changeset
76 basic_block bb = gimple_bb (stmt);
kono
parents:
diff changeset
77 if (!bb)
kono
parents:
diff changeset
78 return NULL;
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 return bb->loop_father;
kono
parents:
diff changeset
81 }
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 #endif /* GCC_TREE_SSA_LOOP_H */