GCC Middle and Back End API Reference
cfgloopmanip.h
Go to the documentation of this file.
1/* Loop manipulation header.
2 Copyright (C) 2014-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
14for 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_CFGLOOPMANIP_H
21#define GCC_CFGLOOPMANIP_H
22
23enum
24{
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. */
35#define DLTHE_FLAG_FLAT_PROFILE 8 /* Profile is flat; do not reduce
36 count by unroll factor. */
37extern bool remove_path (edge, bool * = NULL, bitmap = NULL);
38extern void place_new_loop (struct function *, class loop *);
39extern void add_loop (class loop *, class loop *);
44 tree *, tree *, class loop *);
45extern void unloop (class loop *, bool *, bitmap);
46extern void unloop_loops (vec<class loop *> &loops_to_unloop,
47 vec<int> &loops_to_unloop_nunroll,
48 vec<edge> &edges_to_remove,
49 bitmap loop_closed_ssa_invalidated,
50 bool *irred_invalidated);
51extern void copy_loop_info (class loop *loop, class loop *target);
52extern class loop * duplicate_loop (class loop *, class loop *,
53 class loop * = NULL);
54extern void duplicate_subloops (class loop *, class loop *);
55extern bool can_duplicate_loop_p (const class loop *loop);
56extern bool
58 vec<edge> *, int);
59extern bool mfb_keep_just (edge, void *);
60basic_block create_preheader (class loop *, int);
61extern void create_preheaders (int);
62extern void force_single_succ_latches (void);
63class loop * loop_version (class loop *, void *,
67void adjust_loop_info_after_peeling (class loop *loop, int npeel, bool precise);
71 (class loop *loop, edge exit_edge = NULL,
74
75#endif /* GCC_CFGLOOPMANIP_H */
bool can_duplicate_loop_p(const class loop *loop)
Definition cfgloopmanip.cc:1198
bool duplicate_loop_body_to_header_edge(class loop *loop, edge e, unsigned int ndupl, sbitmap wont_exit, edge orig, vec< edge > *to_remove, int flags)
Definition cfgloopmanip.cc:1222
void scale_loop_frequencies(class loop *loop, profile_probability p)
Definition cfgloopmanip.cc:502
class loop * create_empty_loop_on_edge(edge entry_edge, tree initial_value, tree stride, tree upper_bound, tree iv, tree *iv_before, tree *iv_after, class loop *outer)
Definition cfgloopmanip.cc:911
edge update_loop_exit_probability_scale_dom_bbs(class loop *loop, edge exit_edge, profile_count desired_count)
Definition cfgloopmanip.cc:564
void duplicate_subloops(class loop *loop, class loop *target)
Definition cfgloopmanip.cc:1151
void create_preheaders(int flags)
Definition cfgloopmanip.cc:1707
void copy_loop_info(class loop *loop, class loop *target)
Definition cfgloopmanip.cc:1100
bool remove_path(edge e, bool *irred_invalidated, bitmap loop_closed_ssa_invalidated)
Definition cfgloopmanip.cc:309
void add_loop(class loop *loop, class loop *outer)
Definition cfgloopmanip.cc:450
bool mfb_keep_just(edge e, void *data)
Definition cfgloopmanip.cc:1570
void scale_loop_profile(class loop *loop, profile_probability p, gcov_type iteration_bound)
Definition cfgloopmanip.cc:697
void scale_dominated_blocks_in_loop(class loop *loop, basic_block bb, profile_count num, profile_count den)
Definition cfgloopmanip.cc:515
void force_single_succ_latches(void)
Definition cfgloopmanip.cc:1720
void unloop(class loop *loop, bool *irred_invalidated, bitmap loop_closed_ssa_invalidated)
Definition cfgloopmanip.cc:1005
void place_new_loop(struct function *fn, class loop *loop)
Definition cfgloopmanip.cc:439
basic_block create_preheader(class loop *loop, int flags)
Definition cfgloopmanip.cc:1599
class loop * duplicate_loop(class loop *loop, class loop *target, class loop *after)
Definition cfgloopmanip.cc:1130
edge create_empty_if_region_on_edge(edge entry_edge, tree condition)
Definition cfgloopmanip.cc:832
class loop * loop_version(class loop *loop, void *cond_expr, basic_block *condition_bb, profile_probability then_prob, profile_probability else_prob, profile_probability then_scale, profile_probability else_scale, bool place_after)
Definition cfgloopmanip.cc:1811
void adjust_loop_info_after_peeling(class loop *loop, int npeel, bool precise)
Definition tree-ssa-loop-ivcanon.cc:1060
@ CP_FALLTHRU_PREHEADERS
Definition cfgloopmanip.h:26
@ CP_SIMPLE_PREHEADERS
Definition cfgloopmanip.h:25
void update_exit_probability_after_unrolling(class loop *loop, edge new_exit)
void unloop_loops(vec< class loop * > &loops_to_unloop, vec< int > &loops_to_unloop_nunroll, vec< edge > &edges_to_remove, bitmap loop_closed_ssa_invalidated, bool *irred_invalidated)
Definition tree-ssa-loop-ivcanon.cc:680
Definition cfgloop.h:120
int num
Definition cfgloop.h:124
Definition profile-count.h:149
struct basic_block_def * basic_block
Definition coretypes.h:359
class edge_def * edge
Definition coretypes.h:356
struct simple_bitmap_def * sbitmap
Definition coretypes.h:54
class bitmap_head * bitmap
Definition coretypes.h:51
int64_t gcov_type
Definition coretypes.h:46
union tree_node * tree
Definition coretypes.h:97
Definition function.h:249
Definition profile-count.h:789
static profile_count uninitialized()
Definition profile-count.h:873
Definition vec.h:450
#define NULL
Definition system.h:55