GCC Middle and Back End API Reference
loop-init.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "cfghooks.h"
#include "df.h"
#include "regs.h"
#include "cfgcleanup.h"
#include "cfgloop.h"
#include "tree-pass.h"
#include "tree-ssa-loop-niter.h"
#include "loop-unroll.h"
#include "tree-scalar-evolution.h"
#include "tree-cfgcleanup.h"
Include dependency graph for loop-init.cc:


static void apply_loop_flags (unsigned flags)
void loop_optimizer_init (unsigned flags)
void loop_optimizer_finalize (struct function *fn, bool clean_loop_closed_phi)
unsigned fix_loop_structure (bitmap changed_bbs)
rtl_opt_passmake_pass_loop2 (gcc::context *ctxt)
static unsigned int rtl_loop_init (void)
rtl_opt_passmake_pass_rtl_loop_init (gcc::context *ctxt)
rtl_opt_passmake_pass_rtl_loop_done (gcc::context *ctxt)
rtl_opt_passmake_pass_rtl_move_loop_invariants (gcc::context *ctxt)
rtl_opt_passmake_pass_rtl_unroll_loops (gcc::context *ctxt)
rtl_opt_passmake_pass_rtl_doloop (gcc::context *ctxt)

Function Documentation

◆ apply_loop_flags()

static void apply_loop_flags ( unsigned flags)
Loop optimizer initialization routines and RTL loop optimization passes.
   Copyright (C) 2002-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
Apply FLAGS to the loop state.   

References CP_FALLTHRU_PREHEADERS, CP_SIMPLE_PREHEADERS, create_preheaders(), disambiguate_loops_with_multiple_latches(), force_single_succ_latches(), gcc_assert, ggc_alloc(), LOOPS_HAVE_FALLTHRU_PREHEADERS, LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS, LOOPS_HAVE_PREHEADERS, LOOPS_HAVE_RECORDED_EXITS, LOOPS_HAVE_SIMPLE_LATCHES, LOOPS_MAY_HAVE_MULTIPLE_LATCHES, loops_state_set(), mark_irreducible_loops(), and record_loop_exits().

Referenced by fix_loop_structure(), and loop_optimizer_init().

◆ fix_loop_structure()

unsigned fix_loop_structure ( bitmap changed_bbs)
The structure of loops might have changed.  Some loops might get removed
(and their headers and latches were set to NULL), loop exists might get
removed (thus the loop nesting may be wrong), and some blocks and edges
were changed (so the information about bb --> loop mapping does not have
to be correct).  But still for the remaining loops the header dominates
the latch, and loops did not get new subloops (new loops might possibly
get created, but we are not interested in them).  Fix up the mess.

If CHANGED_BBS is not NULL, basic blocks whose loop depth has changed are
marked in it.

Returns the number of new discovered plus the number of removed loops.   

References apply_loop_flags(), basic_block_def::aux, BASIC_BLOCK_FOR_FN, basic_block_info_for_fn, bb_loop_header_p(), bitmap_set_bit, CDI_DOMINATORS, cfun, checking_verify_loop_structure(), current_loops, dom_info_state(), DOM_OK, dump_file, dump_flags, flow_loop_free(), flow_loop_tree_node_add(), flow_loop_tree_node_remove(), flow_loops_find(), FOR_EACH_BB_FN, FOR_EACH_VEC_ELT, loop::former_header, gcc_assert, get_loops(), ggc_alloc(), loop::header, i, basic_block_def::index, loop::inner, LI_FROM_INNERMOST, loop_depth(), basic_block_def::loop_father, loop_outer(), LOOPS_HAVE_RECORDED_EXITS, LOOPS_NEED_FIXUP, loops_state_clear(), loops_state_satisfies_p(), NULL, loop::num, number_of_loops(), release_recorded_exits(), scev_initialized_p(), scev_reset_htab(), TDF_DETAILS, timevar_pop(), and timevar_push().

Referenced by cleanup_cfg(), loop_optimizer_init(), repair_loop_structures(), tree_function_versioning(), and unroll_loops().

◆ loop_optimizer_finalize()

◆ loop_optimizer_init()

◆ make_pass_loop2()

rtl_opt_pass * make_pass_loop2 ( gcc::context * ctxt)

References ggc_alloc().

◆ make_pass_rtl_doloop()

rtl_opt_pass * make_pass_rtl_doloop ( gcc::context * ctxt)

References ggc_alloc().

◆ make_pass_rtl_loop_done()

rtl_opt_pass * make_pass_rtl_loop_done ( gcc::context * ctxt)

References ggc_alloc().

◆ make_pass_rtl_loop_init()

rtl_opt_pass * make_pass_rtl_loop_init ( gcc::context * ctxt)

References ggc_alloc().

◆ make_pass_rtl_move_loop_invariants()

rtl_opt_pass * make_pass_rtl_move_loop_invariants ( gcc::context * ctxt)

References ggc_alloc().

◆ make_pass_rtl_unroll_loops()

rtl_opt_pass * make_pass_rtl_unroll_loops ( gcc::context * ctxt)

References ggc_alloc().

◆ rtl_loop_init()