Mercurial > hg > CbC > CbC_gcc
diff gcc/sese.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
line wrap: on
line diff
--- a/gcc/sese.h Tue May 25 18:58:51 2010 +0900 +++ b/gcc/sese.h Tue Mar 22 17:18:12 2011 +0900 @@ -55,9 +55,9 @@ extern sese new_sese (edge, edge); extern void free_sese (sese); extern void sese_insert_phis_for_liveouts (sese, basic_block, edge, edge); -extern void sese_adjust_liveout_phis (sese, htab_t, basic_block, edge, edge); extern void build_sese_loop_nests (sese); -extern edge copy_bb_and_scalar_dependences (basic_block, sese, edge, htab_t); +extern edge copy_bb_and_scalar_dependences (basic_block, sese, edge, + VEC (tree, heap) *); extern struct loop *outermost_loop_in_sese (sese, basic_block); extern void insert_loop_close_phis (htab_t, loop_p); extern void insert_guard_phis (basic_block, edge, edge, htab_t, htab_t); @@ -94,10 +94,6 @@ predecessors of EXIT are dominated by ENTRY. */ FOR_EACH_EDGE (e, ei, exit->preds) dominated_by_p (CDI_DOMINATORS, e->src, entry); - - /* Check that there are no edges going out of the region: the - entry is post-dominated by the exit. FIXME: This cannot be - checked right now as the CDI_POST_DOMINATORS are needed. */ } #endif @@ -118,15 +114,22 @@ return bb_in_region (bb, entry, exit); } +/* Returns true when STMT is defined in REGION. */ + +static inline bool +stmt_in_sese_p (gimple stmt, sese region) +{ + basic_block bb = gimple_bb (stmt); + return bb && bb_in_sese_p (bb, region); +} + /* Returns true when NAME is defined in REGION. */ static inline bool defined_in_sese_p (tree name, sese region) { gimple stmt = SSA_NAME_DEF_STMT (name); - basic_block bb = gimple_bb (stmt); - - return bb && bb_in_sese_p (bb, region); + return stmt_in_sese_p (stmt, region); } /* Returns true when LOOP is in REGION. */ @@ -262,9 +265,6 @@ extern void debug_rename_map (htab_t); extern hashval_t rename_map_elt_info (const void *); extern int eq_rename_map_elts (const void *, const void *); -extern void set_rename (htab_t, tree, tree); -extern void rename_nb_iterations (htab_t); -extern void rename_sese_parameters (htab_t, sese); /* Constructs a new SCEV_INFO_STR structure for VAR and INSTANTIATED_BELOW. */ @@ -313,14 +313,13 @@ { mark_irreducible_loops (); free_dominance_info (CDI_DOMINATORS); - free_dominance_info (CDI_POST_DOMINATORS); calculate_dominance_info (CDI_DOMINATORS); - calculate_dominance_info (CDI_POST_DOMINATORS); } typedef struct gimple_bb { basic_block bb; + struct poly_bb *pbb; /* Lists containing the restrictions of the conditional statements dominating this bb. This bb can only be executed, if all conditions @@ -347,10 +346,11 @@ VEC (data_reference_p, heap) *data_refs; } *gimple_bb_p; -#define GBB_BB(GBB) GBB->bb -#define GBB_DATA_REFS(GBB) GBB->data_refs -#define GBB_CONDITIONS(GBB) GBB->conditions -#define GBB_CONDITION_CASES(GBB) GBB->condition_cases +#define GBB_BB(GBB) (GBB)->bb +#define GBB_PBB(GBB) (GBB)->pbb +#define GBB_DATA_REFS(GBB) (GBB)->data_refs +#define GBB_CONDITIONS(GBB) (GBB)->conditions +#define GBB_CONDITION_CASES(GBB) (GBB)->condition_cases /* Return the innermost loop that contains the basic block GBB. */ @@ -389,4 +389,34 @@ return sese_loop_depth (region, common); } +/* Return true when DEF can be analyzed in REGION by the scalar + evolution analyzer. */ + +static inline bool +scev_analyzable_p (tree def, sese region) +{ + loop_p loop; + tree scev; + tree type = TREE_TYPE (def); + + /* When Graphite generates code for a scev, the code generator + expresses the scev in function of a single induction variable. + This is unsafe for floating point computations, as it may replace + a floating point sum reduction with a multiplication. The + following test returns false for non integer types to avoid such + problems. */ + if (!INTEGRAL_TYPE_P (type) + && !POINTER_TYPE_P (type)) + return false; + + loop = loop_containing_stmt (SSA_NAME_DEF_STMT (def)); + scev = scalar_evolution_in_region (region, loop, def); + + return !chrec_contains_undetermined (scev) + && (TREE_CODE (scev) != SSA_NAME + || !defined_in_sese_p (scev, region)) + && (tree_does_not_contain_chrecs (scev) + || evolution_function_is_affine_p (scev)); +} + #endif