GCC Middle and Back End API Reference
sese.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  sese_l
 
class  sese_info_t
 
struct  ifsese_s
 
struct  gimple_poly_bb
 

Macros

#define GBB_BB(GBB)
 
#define GBB_PBB(GBB)
 
#define GBB_DATA_REFS(GBB)
 
#define GBB_CONDITIONS(GBB)
 
#define GBB_CONDITION_CASES(GBB)
 

Typedefs

typedef struct ifsese_sifsese
 
typedef class sese_info_tsese_info_p
 
typedef std::pair< gimple *, treescalar_use
 
typedef struct gimple_poly_bbgimple_poly_bb_p
 

Functions

void print_edge (FILE *file, const_edge e)
 
void print_sese (FILE *file, const sese_l &s)
 
void dump_edge (const_edge e)
 
void dump_sese (const sese_l &)
 
basic_block get_entry_bb (const sese_l &s)
 
basic_block get_exit_bb (const sese_l &s)
 
template<typename T >
int vec_find (const vec< T > &v, const T &elem)
 
sese_info_p new_sese_info (edge, edge)
 
void free_sese_info (sese_info_p)
 
void sese_insert_phis_for_liveouts (sese_info_p, basic_block, edge, edge)
 
class loopoutermost_loop_in_sese (sese_l &, basic_block)
 
tree scalar_evolution_in_region (const sese_l &, loop_p, tree)
 
bool scev_analyzable_p (tree, sese_l &)
 
bool invariant_in_sese_p_rec (tree, const sese_l &, bool *)
 
void sese_build_liveouts (sese_info_p)
 
bool sese_trivially_empty_bb_p (basic_block)
 
unsigned sese_nb_params (sese_info_p region)
 
bool bb_in_region (const_basic_block bb, const_basic_block entry, const_basic_block exit)
 
bool bb_in_sese_p (basic_block bb, const sese_l &r)
 
bool stmt_in_sese_p (gimple *stmt, const sese_l &r)
 
bool defined_in_sese_p (tree name, const sese_l &r)
 
bool loop_in_sese_p (class loop *loop, const sese_l &region)
 
unsigned int sese_loop_depth (const sese_l &region, loop_p loop)
 
ifsese move_sese_in_condition (sese_info_p)
 
void set_ifsese_condition (ifsese, tree)
 
edge get_true_edge_from_guard_bb (basic_block)
 
edge get_false_edge_from_guard_bb (basic_block)
 
edge if_region_entry (ifsese if_region)
 
edge if_region_exit (ifsese if_region)
 
basic_block if_region_get_condition_block (ifsese if_region)
 
class loopgbb_loop (gimple_poly_bb_p gbb)
 
loop_p gbb_loop_at_index (gimple_poly_bb_p gbb, sese_l &region, int index)
 
int nb_common_loops (sese_l &region, gimple_poly_bb_p gbb1, gimple_poly_bb_p gbb2)
 

Macro Definition Documentation

◆ GBB_BB

#define GBB_BB ( GBB)
Value:
(GBB)->bb

Referenced by gbb_loop(), and pbb_bb().

◆ GBB_CONDITION_CASES

#define GBB_CONDITION_CASES ( GBB)
Value:
(GBB)->condition_cases

◆ GBB_CONDITIONS

#define GBB_CONDITIONS ( GBB)

◆ GBB_DATA_REFS

#define GBB_DATA_REFS ( GBB)
Value:
(GBB)->data_refs

◆ GBB_PBB

#define GBB_PBB ( GBB)
Value:
(GBB)->pbb

Typedef Documentation

◆ gimple_poly_bb_p

typedef struct gimple_poly_bb * gimple_poly_bb_p

◆ ifsese

typedef struct ifsese_s * ifsese
Single entry single exit control flow regions.
   Copyright (C) 2008-2024 Free Software Foundation, Inc.
   Contributed by Jan Sjodin <jan.sjodin@amd.com> and
   Sebastian Pop <sebastian.pop@amd.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/>.   
A single entry single exit specialized for conditions.   

◆ scalar_use

typedef std::pair<gimple *, tree> scalar_use

◆ sese_info_p

typedef class sese_info_t * sese_info_p
A helper structure for bookkeeping information about a scop in graphite.   

Function Documentation

◆ bb_in_region()

bool bb_in_region ( const_basic_block bb,
const_basic_block entry,
const_basic_block exit )
inline
Checks whether BB is contained in the region delimited by ENTRY and
EXIT blocks.   

References CDI_DOMINATORS, and dominated_by_p().

Referenced by bb_in_sese_p(), and do_rpo_vn_1().

◆ bb_in_sese_p()

bool bb_in_sese_p ( basic_block bb,
const sese_l & r )
inline
Checks whether BB is contained in the region delimited by ENTRY and
EXIT blocks.   

References bb_in_region(), and r.

Referenced by loop_in_sese_p(), sese_build_liveouts(), sese_build_liveouts_use(), sese_reset_debug_liveouts(), and stmt_in_sese_p().

◆ defined_in_sese_p()

bool defined_in_sese_p ( tree name,
const sese_l & r )
inline
Returns true when NAME is defined in REGION.   

References r, SSA_NAME_DEF_STMT, and stmt_in_sese_p().

Referenced by invariant_in_sese_p_rec(), scalar_evolution_in_region(), and scev_analyzable_p().

◆ dump_edge()

void dump_edge ( const_edge e)

◆ dump_sese()

void dump_sese ( const sese_l & )

◆ free_sese_info()

void free_sese_info ( sese_info_p region)
extern
Deletes REGION.   

References BITMAP_FREE, and NULL.

◆ gbb_loop()

class loop * gbb_loop ( gimple_poly_bb_p gbb)
inline
Return the innermost loop that contains the basic block GBB.   

References GBB_BB.

Referenced by gbb_loop_at_index(), nb_common_loops(), and pbb_loop().

◆ gbb_loop_at_index()

loop_p gbb_loop_at_index ( gimple_poly_bb_p gbb,
sese_l & region,
int index )
inline
Returns the gimple loop, that corresponds to the loop_iterator_INDEX.
If there is no corresponding gimple loop, we return NULL.   

References gbb_loop(), gcc_assert, loop_in_sese_p(), loop_outer(), and sese_loop_depth().

◆ get_entry_bb()

basic_block get_entry_bb ( const sese_l & s)
inline
Get the entry of an sese S.   

References sese_l::entry.

◆ get_exit_bb()

basic_block get_exit_bb ( const sese_l & s)
inline
Get the exit of an sese S.   

References sese_l::exit.

◆ get_false_edge_from_guard_bb()

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

References FOR_EACH_EDGE, gcc_unreachable, NULL, and basic_block_def::succs.

◆ get_true_edge_from_guard_bb()

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

References FOR_EACH_EDGE, gcc_unreachable, NULL, and basic_block_def::succs.

◆ if_region_entry()

edge if_region_entry ( ifsese if_region)
inline

◆ if_region_exit()

edge if_region_exit ( ifsese if_region)
inline

References ifsese_s::region.

◆ if_region_get_condition_block()

basic_block if_region_get_condition_block ( ifsese if_region)
inline

References if_region_entry().

◆ invariant_in_sese_p_rec()

bool invariant_in_sese_p_rec ( tree t,
const sese_l & region,
bool * has_vdefs )
extern
Return true when T is defined outside REGION or when no definitions are
variant in REGION.  When HAS_VDEFS is a valid pointer, sets HAS_VDEFS to true
when T depends on memory that may change in REGION.   

References defined_in_sese_p(), FOR_EACH_SSA_USE_OPERAND, gimple_vdef(), gimple_vuse(), invariant_in_sese_p_rec(), SSA_NAME_DEF_STMT, SSA_OP_USE, and USE_FROM_PTR.

Referenced by invariant_in_sese_p_rec().

◆ loop_in_sese_p()

bool loop_in_sese_p ( class loop * loop,
const sese_l & region )
inline

◆ move_sese_in_condition()

◆ nb_common_loops()

int nb_common_loops ( sese_l & region,
gimple_poly_bb_p gbb1,
gimple_poly_bb_p gbb2 )
inline
The number of common loops in REGION for GBB1 and GBB2.   

References find_common_loop(), gbb_loop(), and sese_loop_depth().

◆ new_sese_info()

sese_info_p new_sese_info ( edge entry,
edge exit )
extern
Builds a new SESE region from edges ENTRY and EXIT.   

References NULL.

◆ outermost_loop_in_sese()

class loop * outermost_loop_in_sese ( sese_l & region,
basic_block bb )
extern
Same as outermost_loop_in_sese_1, returns the outermost loop
containing BB in REGION, but makes sure that the returned loop
belongs to the REGION, and so this returns the first loop in the
REGION when the loop containing BB does not belong to REGION.   

References gcc_assert, loop_in_sese_p(), and outermost_loop_in_sese_1().

◆ print_edge()

void print_edge ( FILE * file,
const_edge e )
Pretty print edge E to FILE.   

Referenced by debug_edge(), and print_sese().

◆ print_sese()

void print_sese ( FILE * file,
const sese_l & s )
Pretty print sese S to FILE.   

References sese_l::entry, sese_l::exit, and print_edge().

Referenced by debug_sese().

◆ scalar_evolution_in_region()

tree scalar_evolution_in_region ( const sese_l & region,
loop_p loop,
tree t )
extern
Returns the scalar evolution of T in REGION.  Every variable that
is not defined in the REGION is considered a parameter.   

References analyze_scalar_evolution(), defined_in_sese_p(), sese_l::entry, instantiate_scev(), loop_in_sese_p(), NULL, and TREE_CODE.

Referenced by scev_analyzable_p().

◆ scev_analyzable_p()

◆ sese_build_liveouts()

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

References bb_in_sese_p(), BITMAP_ALLOC, cfun, FOR_EACH_BB_FN, gcc_assert, NULL, and sese_build_liveouts_bb().

◆ sese_insert_phis_for_liveouts()

void sese_insert_phis_for_liveouts ( sese_info_p region,
basic_block bb,
edge false_e,
edge true_e )
extern
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 EXECUTE_IF_SET_IN_BITMAP, i, MAY_HAVE_DEBUG_BIND_STMTS, sese_add_exit_phis_edge(), sese_reset_debug_liveouts(), ssa_name, and virtual_operand_p().

◆ sese_loop_depth()

unsigned int sese_loop_depth ( const sese_l & region,
loop_p loop )
inline
Returns the loop depth of LOOP in REGION.  The loop depth
is the same as the normal loop depth, but limited by a region.

Example:

loop_0
  loop_1
    {
      S0
         <- region start
      S1

      loop_2
        S2

      S3
         <- region end
    }

 loop_0 does not exist in the region -> invalid
 loop_1 exists, but is not completely contained in the region -> depth 0
 loop_2 is completely contained -> depth 1   

References loop_in_sese_p(), and loop_outer().

Referenced by gbb_loop_at_index(), and nb_common_loops().

◆ sese_nb_params()

unsigned sese_nb_params ( sese_info_p region)
inline
The number of parameters in REGION.  

◆ sese_trivially_empty_bb_p()

bool sese_trivially_empty_bb_p ( basic_block bb)
extern
Return true if BB is empty, contains only DEBUG_INSNs.   

References gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), and is_gimple_debug().

◆ set_ifsese_condition()

void set_ifsese_condition ( ifsese if_region,
tree condition )
extern
Replaces the condition of the IF_REGION with CONDITION:
  | if (CONDITION)
  |   true_region;
  | else
  |   false_region;

References force_gimple_operand_gsi_1(), gcc_assert, gimple_build_cond_from_tree(), gsi_insert_before(), gsi_last_bb(), gsi_remove(), GSI_SAME_STMT, is_gimple_condexpr_for_cond(), NULL_TREE, and ifsese_s::region.

◆ stmt_in_sese_p()

bool stmt_in_sese_p ( gimple * stmt,
const sese_l & r )
inline
Returns true when STMT is defined in REGION.   

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

Referenced by defined_in_sese_p().

◆ vec_find()

template<typename T >
int vec_find ( const vec< T > & v,
const T & elem )
Returns the index of V where ELEM can be found. -1 Otherwise.   

References FOR_EACH_VEC_ELT, and i.