]>
Commit | Line | Data |
---|---|---|
893479de | 1 | /* Loop manipulation header. |
a945c346 | 2 | Copyright (C) 2014-2024 Free Software Foundation, Inc. |
893479de AM |
3 | |
4 | This file is part of GCC. | |
5 | ||
6 | GCC is free software; you can redistribute it and/or modify it under | |
7 | the terms of the GNU General Public License as published by the Free | |
8 | Software Foundation; either version 3, or (at your option) any later | |
9 | version. | |
10 | ||
11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GCC; see the file COPYING3. If not see | |
18 | <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | #ifndef GCC_CFGLOOPMANIP_H | |
21 | #define GCC_CFGLOOPMANIP_H | |
22 | ||
23 | enum | |
24 | { | |
25 | CP_SIMPLE_PREHEADERS = 1, | |
26 | CP_FALLTHRU_PREHEADERS = 2 | |
27 | }; | |
28 | ||
29 | #define DLTHE_FLAG_UPDATE_FREQ 1 /* Update frequencies in | |
30 | duplicate_loop_to_header_edge. */ | |
31 | #define DLTHE_RECORD_COPY_NUMBER 2 /* Record copy number in the aux | |
32 | field of newly create BB. */ | |
33 | #define DLTHE_FLAG_COMPLETTE_PEEL 4 /* Update frequencies expecting | |
34 | a complete peeling. */ | |
9bd1ee6d JH |
35 | #define DLTHE_FLAG_FLAT_PROFILE 8 /* Profile is flat; do not reduce |
36 | count by unroll factor. */ | |
893479de AM |
37 | extern edge mfb_kj_edge; |
38 | ||
eb2afa1a | 39 | extern bool remove_path (edge, bool * = NULL, bitmap = NULL); |
99b1c316 MS |
40 | extern void place_new_loop (struct function *, class loop *); |
41 | extern void add_loop (class loop *, class loop *); | |
42 | extern void scale_loop_frequencies (class loop *, profile_probability); | |
43 | extern void scale_loop_profile (class loop *, profile_probability, gcov_type); | |
893479de | 44 | extern edge create_empty_if_region_on_edge (edge, tree); |
99b1c316 MS |
45 | extern class loop *create_empty_loop_on_edge (edge, tree, tree, tree, tree, |
46 | tree *, tree *, class loop *); | |
99b1c316 | 47 | extern void unloop (class loop *, bool *, bitmap); |
f2d6beb7 JH |
48 | extern void unloop_loops (vec<class loop *> &loops_to_unloop, |
49 | vec<int> &loops_to_unloop_nunroll, | |
8ff02df6 | 50 | vec<edge> &edges_to_remove, |
f2d6beb7 JH |
51 | bitmap loop_closed_ssa_invalidated, |
52 | bool *irred_invalidated); | |
99b1c316 MS |
53 | extern void copy_loop_info (class loop *loop, class loop *target); |
54 | extern class loop * duplicate_loop (class loop *, class loop *, | |
55 | class loop * = NULL); | |
56 | extern void duplicate_subloops (class loop *, class loop *); | |
57 | extern bool can_duplicate_loop_p (const class loop *loop); | |
4851c80c XL |
58 | extern bool |
59 | duplicate_loop_body_to_header_edge (class loop *, edge, unsigned, sbitmap, edge, | |
60 | vec<edge> *, int); | |
893479de | 61 | extern bool mfb_keep_just (edge); |
99b1c316 | 62 | basic_block create_preheader (class loop *, int); |
893479de AM |
63 | extern void create_preheaders (int); |
64 | extern void force_single_succ_latches (void); | |
99b1c316 | 65 | class loop * loop_version (class loop *, void *, |
357067f2 JH |
66 | basic_block *, |
67 | profile_probability, profile_probability, | |
af2bbc51 | 68 | profile_probability, profile_probability, bool); |
cda246f8 | 69 | void adjust_loop_info_after_peeling (class loop *loop, int npeel, bool precise); |
9bd1ee6d JH |
70 | void scale_dominated_blocks_in_loop (class loop *loop, basic_block bb, |
71 | profile_count num, profile_count den); | |
88618fa0 H |
72 | edge update_loop_exit_probability_scale_dom_bbs |
73 | (class loop *loop, edge exit_edge = NULL, | |
74 | profile_count desired_count = profile_count::uninitialized ()); | |
a7d4310a | 75 | void update_exit_probability_after_unrolling (class loop *loop, edge new_exit); |
893479de AM |
76 | |
77 | #endif /* GCC_CFGLOOPMANIP_H */ |