annotate gcc/tree-ssa-loop.h @ 118:fd00160c1b76

ifdef TARGET_64BIT
author mir3636
date Tue, 27 Feb 2018 15:01:35 +0900
parents 04ced10e8804
children 84e7813d76e9
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.
kono
parents:
diff changeset
2 Copyright (C) 2013-2017 Free Software Foundation, Inc.
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
kono
parents:
diff changeset
39 struct tree_niter_desc
kono
parents:
diff changeset
40 {
kono
parents:
diff changeset
41 tree assumptions; /* The boolean expression. If this expression evaluates
kono
parents:
diff changeset
42 to false, then the other fields in this structure
kono
parents:
diff changeset
43 should not be used; there is no guarantee that they
kono
parents:
diff changeset
44 will be correct. */
kono
parents:
diff changeset
45 tree may_be_zero; /* The boolean expression. If it evaluates to true,
kono
parents:
diff changeset
46 the loop will exit in the first iteration (i.e.
kono
parents:
diff changeset
47 its latch will not be executed), even if the niter
kono
parents:
diff changeset
48 field says otherwise. */
kono
parents:
diff changeset
49 tree niter; /* The expression giving the number of iterations of
kono
parents:
diff changeset
50 a loop (provided that assumptions == true and
kono
parents:
diff changeset
51 may_be_zero == false), more precisely the number
kono
parents:
diff changeset
52 of executions of the latch of the loop. */
kono
parents:
diff changeset
53 widest_int max; /* The upper bound on the number of iterations of
kono
parents:
diff changeset
54 the loop. */
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 /* The simplified shape of the exit condition. The loop exits if
kono
parents:
diff changeset
57 CONTROL CMP BOUND is false, where CMP is one of NE_EXPR,
kono
parents:
diff changeset
58 LT_EXPR, or GT_EXPR, and step of CONTROL is positive if CMP is
kono
parents:
diff changeset
59 LE_EXPR and negative if CMP is GE_EXPR. This information is used
kono
parents:
diff changeset
60 by loop unrolling. */
kono
parents:
diff changeset
61 affine_iv control;
kono
parents:
diff changeset
62 tree bound;
kono
parents:
diff changeset
63 enum tree_code cmp;
kono
parents:
diff changeset
64 };
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 extern bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *);
kono
parents:
diff changeset
67 extern char *get_lsm_tmp_name (tree ref, unsigned n, const char *suffix = NULL);
kono
parents:
diff changeset
68 extern unsigned tree_num_loop_insns (struct loop *, struct eni_weights *);
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 /* Returns the loop of the statement STMT. */
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 static inline struct loop *
kono
parents:
diff changeset
73 loop_containing_stmt (gimple *stmt)
kono
parents:
diff changeset
74 {
kono
parents:
diff changeset
75 basic_block bb = gimple_bb (stmt);
kono
parents:
diff changeset
76 if (!bb)
kono
parents:
diff changeset
77 return NULL;
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 return bb->loop_father;
kono
parents:
diff changeset
80 }
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 #endif /* GCC_TREE_SSA_LOOP_H */