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

Data Structures

struct  rename_map_hasher

Typedefs

typedef hash_table
< rename_map_hasher
rename_map_type

Functions

static void debug_rename_elt ()
int debug_rename_map_1 ()
DEBUG_FUNCTION void debug_rename_map ()
hashval_t rename_map_elt_info ()
int eq_rename_map_elts ()
static void sese_record_loop ()
void build_sese_loop_nests ()
static void sese_build_liveouts_use (sese region, bitmap liveouts, basic_block bb, tree use)
static void sese_build_liveouts_bb ()
static bool sese_bad_liveouts_use (sese region, bitmap liveouts, basic_block bb, tree use)
static void sese_reset_debug_liveouts_bb ()
static void sese_build_liveouts ()
sese new_sese ()
void free_sese ()
static void sese_add_exit_phis_edge ()
void sese_insert_phis_for_liveouts (sese region, basic_block bb, edge false_e, edge true_e)
edge get_true_edge_from_guard_bb ()
edge get_false_edge_from_guard_bb ()
static tree get_rename ()
static void set_rename ()
static bool rename_uses (gimple copy, rename_map_type rename_map, gimple_stmt_iterator *gsi_tgt, sese region, loop_p loop, vec< tree > iv_map, bool *gloog_error)
static void graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, rename_map_type rename_map, vec< tree > iv_map, sese region, bool *gloog_error)
edge copy_bb_and_scalar_dependences (basic_block bb, sese region, edge next_e, vec< tree > iv_map, bool *gloog_error)
struct loopoutermost_loop_in_sese ()
void if_region_set_false_region ()
static ifsese create_if_region_on_edge ()
ifsese move_sese_in_condition ()
void set_ifsese_condition ()
tree scalar_evolution_in_region ()

Typedef Documentation


Function Documentation

void build_sese_loop_nests ( )
Build the loop nests contained in REGION.  Returns true when the
   operation was successful.   

References bb_in_sese_p(), loop::header, loop::latch, basic_block_def::loop_father, loop::num, and sese_record_loop().

Referenced by build_poly_scop(), and limit_scops().

edge copy_bb_and_scalar_dependences ( basic_block  bb,
sese  region,
edge  next_e,
vec< tree iv_map,
bool *  gloog_error 
)
Copies BB and includes in the copied BB all the statements that can
   be reached following the use-def chains from the memory accesses,
   and returns the next edge following this new block.  GLOOG_ERROR is
   set when the code generation cannot continue.   

References hash_table< Descriptor, Allocator >::create(), hash_table< Descriptor, Allocator >::dispose(), graphite_copy_stmts_from_block(), remove_phi_nodes(), single_succ_edge(), and split_edge().

Referenced by translate_clast_user().

static void debug_rename_elt ( )
static
@verbatim Single entry single exit control flow regions.

Copyright (C) 2008-2013 Free Software Foundation, Inc. Contributed by Jan Sjodin jan.s.nosp@m.jodi.nosp@m.n@amd.nosp@m..com and Sebastian Pop sebas.nosp@m.tian.nosp@m..pop@.nosp@m.amd..nosp@m.com.

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

Print to stderr the element ELT.   

References rename_map_elt_s::expr, rename_map_elt_s::old_name, and print_generic_expr().

Referenced by debug_rename_map_1().

DEBUG_FUNCTION void debug_rename_map ( )
Print to stderr all the elements of RENAME_MAP.   

References debug_rename_map_1(), and hash_table< Descriptor, Allocator >::traverse().

int debug_rename_map_1 ( )
Helper function for debug_rename_map.   

References debug_rename_elt().

Referenced by debug_rename_map().

int eq_rename_map_elts ( )
Compares database elements E1 and E2.   

References rename_map_elt_s::old_name.

void free_sese ( )
Deletes REGION.   

Referenced by free_scops().

edge get_false_edge_from_guard_bb ( )
Returns the first successor edge of BB with EDGE_TRUE_VALUE flag cleared.   

References edge_def::flags, and basic_block_def::succs.

Referenced by if_region_set_false_region().

static tree get_rename ( )
static
Returns the expression associated to OLD_NAME in RENAME_MAP.   

References hash_table< Descriptor, Allocator >::find_slot(), and rename_map_elt_s::old_name.

Referenced by rename_uses().

edge get_true_edge_from_guard_bb ( )
Returns the first successor edge of BB with EDGE_TRUE_VALUE flag set.   

References edge_def::flags, and basic_block_def::succs.

Referenced by translate_clast_for(), and translate_clast_guard().

static void graphite_copy_stmts_from_block ( basic_block  bb,
basic_block  new_bb,
rename_map_type  rename_map,
vec< tree iv_map,
sese  region,
bool *  gloog_error 
)
static
Duplicates the statements of basic block BB into basic block NEW_BB
   and compute the new induction variables according to the IV_MAP.
   GLOOG_ERROR is set when the code generation cannot continue.   

References cfun, copy(), create_new_def_for(), fold_stmt_inplace(), gimple_assign_lhs(), gimple_copy(), gimple_duplicate_stmt_histograms(), gsi_end_p(), gsi_insert_after(), GSI_NEW_STMT, gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_assign(), is_gimple_reg(), basic_block_def::loop_father, maybe_duplicate_eh_stmt(), rename_map_elt_s::old_name, rename_uses(), scev_analyzable_p(), set_rename(), and update_stmt().

Referenced by copy_bb_and_scalar_dependences().

ifsese move_sese_in_condition ( )
Moves REGION in a condition expression:
   | if (1)
   |   ;
   | else
   |   REGION;

References create_if_region_on_edge(), if_region_set_false_region(), single_pred_edge(), single_succ_edge(), and split_edge().

Referenced by gloog().

sese new_sese ( )
Builds a new SESE region from edges ENTRY and EXIT.   

Referenced by build_graphite_scops(), and split_region_for_bb().

struct loop* outermost_loop_in_sese ( )
read
Returns the outermost loop in SCOP that contains BB.   

References basic_block_def::loop_father, loop_in_sese_p(), and loop_outer().

Referenced by outermost_loop_in_sese_1(), and scop_to_lst().

hashval_t rename_map_elt_info ( )
Computes a hash function for database element ELT.   
static bool rename_uses ( gimple  copy,
rename_map_type  rename_map,
gimple_stmt_iterator gsi_tgt,
sese  region,
loop_p  loop,
vec< tree iv_map,
bool *  gloog_error 
)
static
Renames the scalar uses of the statement COPY, using the
   substitution map RENAME_MAP, inserting the gimplification code at
   GSI_TGT, for the translation REGION, with the original copied
   statement in LOOP, and using the induction variable renaming map
   IV_MAP.  Returns true when something has been renamed.  GLOOG_ERROR
   is set when the code generation cannot continue.   

References build_zero_cst(), changed, chrec_apply_map(), chrec_contains_undetermined(), create_tmp_var(), force_gimple_operand(), get_rename(), gimple_assign_rhs1(), gimple_debug_bind_p(), gimple_debug_bind_reset_value(), gimple_debug_source_bind_p(), gsi_insert_seq_before(), GSI_SAME_STMT, is_gimple_assign(), is_gimple_debug(), rename_map_elt_s::old_name, recompute_tree_invariant_for_addr_expr(), replace_exp(), scalar_evolution_in_region(), set_rename(), tree_contains_chrecs(), unshare_expr(), and useless_type_conversion_p().

Referenced by graphite_copy_stmts_from_block().

static void sese_add_exit_phis_edge ( )
static
Add exit phis for USE on EXIT.   

References add_phi_arg(), create_new_def_for(), create_phi_node(), and gimple_phi_result_ptr().

Referenced by sese_insert_phis_for_liveouts().

static bool sese_bad_liveouts_use ( sese  region,
bitmap  liveouts,
basic_block  bb,
tree  use 
)
static
For a USE in BB, return true if BB is outside REGION and it's not
   in the LIVEOUTS set.   

References bb_in_sese_p(), bitmap_bit_p(), and gimple_bb().

Referenced by sese_reset_debug_liveouts_bb().

static void sese_build_liveouts ( )
static
Build the LIVEOUTS of REGION: the set of variables defined inside
   and used outside the REGION.   

References sese_build_liveouts_bb(), and sese_reset_debug_liveouts_bb().

Referenced by sese_insert_phis_for_liveouts().

static void sese_build_liveouts_bb ( )
static
Marks for rewrite all the SSA_NAMES defined in REGION and that are
   used in BB that is outside of the REGION.   

References edge_def::dest, gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), is_gimple_debug(), sese_build_liveouts_use(), and basic_block_def::succs.

Referenced by sese_build_liveouts().

static void sese_build_liveouts_use ( sese  region,
bitmap  liveouts,
basic_block  bb,
tree  use 
)
static
For a USE in BB, if BB is outside REGION, mark the USE in the
   LIVEOUTS set.   

References bb_in_sese_p(), bitmap_set_bit(), and gimple_bb().

Referenced by sese_build_liveouts_bb().

void sese_insert_phis_for_liveouts ( sese  region,
basic_block  bb,
edge  false_e,
edge  true_e 
)
Insert in the block BB phi nodes for variables defined in REGION
   and used outside the REGION.  The code generation moves REGION in
   the else clause of an "if (1)" and generates code in the then
   clause that is at this point empty:

   | if (1)
   |   empty;
   | else
   |   REGION;

References sese_add_exit_phis_edge(), sese_build_liveouts(), and update_ssa().

Referenced by gloog().

static void sese_record_loop ( )
static
Record LOOP as occurring in REGION.   

References bitmap_set_bit(), loop::num, and sese_contains_loop().

Referenced by build_sese_loop_nests().

static void sese_reset_debug_liveouts_bb ( )
static
Reset debug stmts that reference SSA_NAMES defined in REGION that
   are not marked as liveouts.   

References gimple_debug_bind_reset_value(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), is_gimple_debug(), sese_bad_liveouts_use(), and update_stmt().

Referenced by sese_build_liveouts().

void set_ifsese_condition ( )
Replaces the condition of the IF_REGION with CONDITION:
   | if (CONDITION)
   |   true_region;
   | else
   |   false_region;

References edge_def::dest, sese_s::entry, force_gimple_operand_gsi(), gimple_build_cond_from_tree(), gsi_insert_after(), gsi_last_bb(), GSI_NEW_STMT, gsi_remove(), last, last_stmt(), and ifsese_s::region.

Referenced by gloog().

static void set_rename ( )
static
Register in RENAME_MAP the rename tuple (OLD_NAME, EXPR).   

References hash_table< Descriptor, Allocator >::find_slot(), free(), new_rename_map_elt(), and rename_map_elt_s::old_name.

Referenced by graphite_copy_stmts_from_block(), and rename_uses().