GCC Middle and Back End API Reference
cfgloopanal.c File Reference

Functions

bool just_once_each_iteration_p ()
bool mark_irreducible_loops ()
int num_loop_insns ()
int average_num_loop_insns ()
gcov_type expected_loop_iterations_unbounded ()
unsigned expected_loop_iterations ()
unsigned get_loop_level ()
static unsigned seq_cost ()
void init_set_costs ()
unsigned estimate_reg_pressure_cost (unsigned n_new, unsigned n_old, bool speed, bool call_p)
void mark_loop_exit_edges ()
edge single_likely_exit ()
vec< basic_blockget_loop_hot_path ()

Variables

struct target_cfgloop default_target_cfgloop
struct target_cfgloopthis_target_cfgloop = &default_target_cfgloop

Function Documentation

int average_num_loop_insns ( )
Counts number of insns executed on average per iteration LOOP.   

References free(), basic_block_def::frequency, get_loop_body(), loop::header, loop::ninsns, and loop::num_nodes.

unsigned estimate_reg_pressure_cost ( unsigned  n_new,
unsigned  n_old,
bool  speed,
bool  call_p 
)
Estimates cost of increased register pressure caused by making N_NEW new
   registers live around the loop.  N_OLD is the number of registers live
   around the loop.  If CALL_P is true, also take into account that
   call-used registers may be clobbered in the loop body, reducing the
   number of available registers before we spill.   

References cfun, IRA_REGION_ALL, IRA_REGION_MIXED, and number_of_loops().

Referenced by gain_for_invariant(), and ivopts_global_cost_for_size().

unsigned expected_loop_iterations ( )
Returns expected number of LOOP iterations.  The returned value is bounded
   by REG_BR_PROB_BASE.   

References expected_loop_iterations_unbounded().

gcov_type expected_loop_iterations_unbounded ( )
Returns expected number of iterations of LOOP, according to
   measured or guessed profile.  No bounding is done on the
   value.   

References edge_def::count, basic_block_def::count, loop::header, loop::latch, basic_block_def::preds, and edge_def::src.

vec<basic_block> get_loop_hot_path ( )
Gets basic blocks of a LOOP.  Header is the 0-th block, rest is in dfs
   order against direction of edges from latch.  Specially, if
   header != latch, latch is the 1-st block.   

References bitmap_bit_p(), bitmap_set_bit(), edge_def::dest, loop::header, basic_block_def::index, loop_exit_edge_p(), path, edge_def::probability, basic_block_def::succs, visited, and vNULL.

unsigned get_loop_level ( )
Returns the maximum level of nesting of subloops of LOOP.   

References get_loop_level(), loop::inner, and loop::next.

void init_set_costs ( void  )
bool just_once_each_iteration_p ( )
Checks whether BB is executed exactly once in each LOOP iteration.   

References CDI_DOMINATORS, dominated_by_p(), basic_block_def::flags, loop::latch, and basic_block_def::loop_father.

void mark_loop_exit_edges ( void  )
Sets EDGE_LOOP_EXIT flag for all loop exits.   

References cfun, edge_def::flags, loop_exit_edge_p(), basic_block_def::loop_father, loop_outer(), number_of_loops(), and basic_block_def::succs.

Referenced by if_convert().

int num_loop_insns ( )
Counts number of insns inside LOOP.   

References free(), get_loop_body(), loop::ninsns, and loop::num_nodes.

static unsigned seq_cost ( )
static
Returns estimate on cost of computing SEQ.   

References set_rtx_cost().

Referenced by init_set_costs().

edge single_likely_exit ( )
Return exit edge if loop has only one exit that is likely
   to be executed on runtime (i.e. it is not EH or leading
   to noreturn call.   

References edge_def::count, loop::exits, edge_def::flags, get_loop_exit_edges(), edge_def::probability, PROFILE_ABSENT, and single_exit().


Variable Documentation

struct target_cfgloop default_target_cfgloop
@verbatim Natural loop analysis code for GNU compiler.

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/.

struct target_cfgloop* this_target_cfgloop = &default_target_cfgloop