GCC Middle and Back End API Reference
|
Functions | |
static void | apply_loop_flags () |
void | loop_optimizer_init () |
void | loop_optimizer_finalize () |
unsigned | fix_loop_structure () |
static bool | gate_handle_loop2 () |
rtl_opt_pass * | make_pass_loop2 () |
static unsigned int | rtl_loop_init () |
rtl_opt_pass * | make_pass_rtl_loop_init () |
static unsigned int | rtl_loop_done () |
rtl_opt_pass * | make_pass_rtl_loop_done () |
static bool | gate_rtl_move_loop_invariants () |
static unsigned int | rtl_move_loop_invariants () |
rtl_opt_pass * | make_pass_rtl_move_loop_invariants () |
static bool | gate_rtl_unswitch () |
static unsigned int | rtl_unswitch () |
rtl_opt_pass * | make_pass_rtl_unswitch () |
static bool | gate_rtl_unroll_and_peel_loops () |
static unsigned int | rtl_unroll_and_peel_loops () |
rtl_opt_pass * | make_pass_rtl_unroll_and_peel_loops () |
static bool | gate_rtl_doloop () |
static unsigned int | rtl_doloop () |
rtl_opt_pass * | make_pass_rtl_doloop () |
|
static |
@verbatim Loop optimizer initialization routines and RTL loop optimization passes.
Copyright (C) 2002-2013 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 version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 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 http://www.gnu.org/licenses/.
Apply FLAGS to the loop state.
References CP_FALLTHRU_PREHEADERS, CP_SIMPLE_PREHEADERS, create_preheaders(), disambiguate_loops_with_multiple_latches(), force_single_succ_latches(), 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().
unsigned fix_loop_structure | ( | ) |
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 loops.
References apply_loop_flags(), basic_block_def::aux, bb_loop_header_p(), bitmap_set_bit(), CDI_DOMINATORS, cfun, 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(), get_loops(), loop::header, 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(), loop::num, number_of_loops(), release_recorded_exits(), timevar_pop(), timevar_push(), and verify_loop_structure().
|
static |
Gate for the RTL loop superpass. The actual passes are subpasses. See passes.c for more on that.
References cfun, function::curr_properties, and loop_optimizer_finalize().
|
static |
The doloop optimization.
|
static |
Loop invariant code motion.
|
static |
Loop unswitching for RTL.
|
static |
Loop unswitching for RTL.
void loop_optimizer_finalize | ( | void | ) |
Finalize loop structures.
References cfun, function::curr_properties, flow_loops_free(), free_numbers_of_iterations_estimates(), free_simple_loop_desc(), ggc_free(), LOOP_CLOSED_SSA, basic_block_def::loop_father, 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_clear(), loops_state_satisfies_p(), loops_state_set(), release_recorded_exits(), timevar_pop(), and timevar_push().
Referenced by analyze_function(), compute_alignments(), copy_loop_headers(), do_pre(), do_reload(), estimate_function_body_sizes(), execute_sink_code(), execute_strength_reduction(), execute_vrp(), fini_reassoc(), fwprop_done(), gate_handle_loop2(), if_convert(), ira(), perform_tree_ssa_dce(), rebuild_frequencies(), release_function_body(), rtl_loop_done(), sms_schedule(), tree_complete_unroll_inner(), tree_estimate_probability_driver(), tree_ssa_cs_elim(), tree_ssa_dominator_optimize(), and tree_ssa_loop_done().
void loop_optimizer_init | ( | ) |
Initialize loop structures. This is used by the tree and RTL loop optimizers. FLAGS specify what properties to compute and/or ensure for loops.
References apply_loop_flags(), calculate_dominance_info(), CDI_DOMINATORS, cfun, function::curr_properties, dump_file, fix_loop_structure(), flow_loops_dump(), flow_loops_find(), LOOPS_HAVE_RECORDED_EXITS, LOOPS_NEED_FIXUP, loops_state_clear(), loops_state_satisfies_p(), release_recorded_exits(), timevar_pop(), timevar_push(), and verify_loop_structure().
rtl_opt_pass* make_pass_loop2 | ( | ) |
rtl_opt_pass* make_pass_rtl_doloop | ( | ) |
rtl_opt_pass* make_pass_rtl_loop_done | ( | ) |
rtl_opt_pass* make_pass_rtl_loop_init | ( | ) |
rtl_opt_pass* make_pass_rtl_move_loop_invariants | ( | ) |
rtl_opt_pass* make_pass_rtl_unroll_and_peel_loops | ( | ) |
rtl_opt_pass* make_pass_rtl_unswitch | ( | ) |
|
static |
References cfun, doloop_optimize_loops(), and number_of_loops().
|
static |
Finalization of the RTL loop passes.
References CDI_DOMINATORS, cfun, cleanup_cfg(), function::curr_properties, dump_file, dump_flags, dump_flow_info(), dump_reg_info(), free_dominance_info(), and loop_optimizer_finalize().
|
static |
Initialization of the RTL loop passes.
References current_ir_type(), dump_file, dump_flags, dump_flow_info(), dump_reg_info(), IR_RTL_CFGLAYOUT, and loop_optimizer_init().
|
static |
References cfun, move_loop_invariants(), and number_of_loops().
|
static |
References cfun, df_dump(), dump_file, number_of_loops(), UAP_PEEL, UAP_UNROLL, UAP_UNROLL_ALL, and unroll_and_peel_loops().
|
static |
References cfun, number_of_loops(), and unswitch_loops().