comparison 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
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
53 #define SESE_ADD_PARAMS(S) (S->add_params) 53 #define SESE_ADD_PARAMS(S) (S->add_params)
54 54
55 extern sese new_sese (edge, edge); 55 extern sese new_sese (edge, edge);
56 extern void free_sese (sese); 56 extern void free_sese (sese);
57 extern void sese_insert_phis_for_liveouts (sese, basic_block, edge, edge); 57 extern void sese_insert_phis_for_liveouts (sese, basic_block, edge, edge);
58 extern void sese_adjust_liveout_phis (sese, htab_t, basic_block, edge, edge);
59 extern void build_sese_loop_nests (sese); 58 extern void build_sese_loop_nests (sese);
60 extern edge copy_bb_and_scalar_dependences (basic_block, sese, edge, htab_t); 59 extern edge copy_bb_and_scalar_dependences (basic_block, sese, edge,
60 VEC (tree, heap) *);
61 extern struct loop *outermost_loop_in_sese (sese, basic_block); 61 extern struct loop *outermost_loop_in_sese (sese, basic_block);
62 extern void insert_loop_close_phis (htab_t, loop_p); 62 extern void insert_loop_close_phis (htab_t, loop_p);
63 extern void insert_guard_phis (basic_block, edge, edge, htab_t, htab_t); 63 extern void insert_guard_phis (basic_block, edge, edge, htab_t, htab_t);
64 extern tree scalar_evolution_in_region (sese, loop_p, tree); 64 extern tree scalar_evolution_in_region (sese, loop_p, tree);
65 65
92 92
93 /* Check that there are no edges coming in the region: all the 93 /* Check that there are no edges coming in the region: all the
94 predecessors of EXIT are dominated by ENTRY. */ 94 predecessors of EXIT are dominated by ENTRY. */
95 FOR_EACH_EDGE (e, ei, exit->preds) 95 FOR_EACH_EDGE (e, ei, exit->preds)
96 dominated_by_p (CDI_DOMINATORS, e->src, entry); 96 dominated_by_p (CDI_DOMINATORS, e->src, entry);
97
98 /* Check that there are no edges going out of the region: the
99 entry is post-dominated by the exit. FIXME: This cannot be
100 checked right now as the CDI_POST_DOMINATORS are needed. */
101 } 97 }
102 #endif 98 #endif
103 99
104 return dominated_by_p (CDI_DOMINATORS, bb, entry) 100 return dominated_by_p (CDI_DOMINATORS, bb, entry)
105 && !(dominated_by_p (CDI_DOMINATORS, bb, exit) 101 && !(dominated_by_p (CDI_DOMINATORS, bb, exit)
116 basic_block exit = SESE_EXIT_BB (region); 112 basic_block exit = SESE_EXIT_BB (region);
117 113
118 return bb_in_region (bb, entry, exit); 114 return bb_in_region (bb, entry, exit);
119 } 115 }
120 116
117 /* Returns true when STMT is defined in REGION. */
118
119 static inline bool
120 stmt_in_sese_p (gimple stmt, sese region)
121 {
122 basic_block bb = gimple_bb (stmt);
123 return bb && bb_in_sese_p (bb, region);
124 }
125
121 /* Returns true when NAME is defined in REGION. */ 126 /* Returns true when NAME is defined in REGION. */
122 127
123 static inline bool 128 static inline bool
124 defined_in_sese_p (tree name, sese region) 129 defined_in_sese_p (tree name, sese region)
125 { 130 {
126 gimple stmt = SSA_NAME_DEF_STMT (name); 131 gimple stmt = SSA_NAME_DEF_STMT (name);
127 basic_block bb = gimple_bb (stmt); 132 return stmt_in_sese_p (stmt, region);
128
129 return bb && bb_in_sese_p (bb, region);
130 } 133 }
131 134
132 /* Returns true when LOOP is in REGION. */ 135 /* Returns true when LOOP is in REGION. */
133 136
134 static inline bool 137 static inline bool
260 DEF_VEC_ALLOC_P (rename_map_elt, heap); 263 DEF_VEC_ALLOC_P (rename_map_elt, heap);
261 264
262 extern void debug_rename_map (htab_t); 265 extern void debug_rename_map (htab_t);
263 extern hashval_t rename_map_elt_info (const void *); 266 extern hashval_t rename_map_elt_info (const void *);
264 extern int eq_rename_map_elts (const void *, const void *); 267 extern int eq_rename_map_elts (const void *, const void *);
265 extern void set_rename (htab_t, tree, tree);
266 extern void rename_nb_iterations (htab_t);
267 extern void rename_sese_parameters (htab_t, sese);
268 268
269 /* Constructs a new SCEV_INFO_STR structure for VAR and INSTANTIATED_BELOW. */ 269 /* Constructs a new SCEV_INFO_STR structure for VAR and INSTANTIATED_BELOW. */
270 270
271 static inline rename_map_elt 271 static inline rename_map_elt
272 new_rename_map_elt (tree old_name, tree expr) 272 new_rename_map_elt (tree old_name, tree expr)
311 static inline void 311 static inline void
312 recompute_all_dominators (void) 312 recompute_all_dominators (void)
313 { 313 {
314 mark_irreducible_loops (); 314 mark_irreducible_loops ();
315 free_dominance_info (CDI_DOMINATORS); 315 free_dominance_info (CDI_DOMINATORS);
316 free_dominance_info (CDI_POST_DOMINATORS);
317 calculate_dominance_info (CDI_DOMINATORS); 316 calculate_dominance_info (CDI_DOMINATORS);
318 calculate_dominance_info (CDI_POST_DOMINATORS);
319 } 317 }
320 318
321 typedef struct gimple_bb 319 typedef struct gimple_bb
322 { 320 {
323 basic_block bb; 321 basic_block bb;
322 struct poly_bb *pbb;
324 323
325 /* Lists containing the restrictions of the conditional statements 324 /* Lists containing the restrictions of the conditional statements
326 dominating this bb. This bb can only be executed, if all conditions 325 dominating this bb. This bb can only be executed, if all conditions
327 are true. 326 are true.
328 327
345 VEC (gimple, heap) *conditions; 344 VEC (gimple, heap) *conditions;
346 VEC (gimple, heap) *condition_cases; 345 VEC (gimple, heap) *condition_cases;
347 VEC (data_reference_p, heap) *data_refs; 346 VEC (data_reference_p, heap) *data_refs;
348 } *gimple_bb_p; 347 } *gimple_bb_p;
349 348
350 #define GBB_BB(GBB) GBB->bb 349 #define GBB_BB(GBB) (GBB)->bb
351 #define GBB_DATA_REFS(GBB) GBB->data_refs 350 #define GBB_PBB(GBB) (GBB)->pbb
352 #define GBB_CONDITIONS(GBB) GBB->conditions 351 #define GBB_DATA_REFS(GBB) (GBB)->data_refs
353 #define GBB_CONDITION_CASES(GBB) GBB->condition_cases 352 #define GBB_CONDITIONS(GBB) (GBB)->conditions
353 #define GBB_CONDITION_CASES(GBB) (GBB)->condition_cases
354 354
355 /* Return the innermost loop that contains the basic block GBB. */ 355 /* Return the innermost loop that contains the basic block GBB. */
356 356
357 static inline struct loop * 357 static inline struct loop *
358 gbb_loop (struct gimple_bb *gbb) 358 gbb_loop (struct gimple_bb *gbb)
387 loop_p common = find_common_loop (l1, l2); 387 loop_p common = find_common_loop (l1, l2);
388 388
389 return sese_loop_depth (region, common); 389 return sese_loop_depth (region, common);
390 } 390 }
391 391
392 /* Return true when DEF can be analyzed in REGION by the scalar
393 evolution analyzer. */
394
395 static inline bool
396 scev_analyzable_p (tree def, sese region)
397 {
398 loop_p loop;
399 tree scev;
400 tree type = TREE_TYPE (def);
401
402 /* When Graphite generates code for a scev, the code generator
403 expresses the scev in function of a single induction variable.
404 This is unsafe for floating point computations, as it may replace
405 a floating point sum reduction with a multiplication. The
406 following test returns false for non integer types to avoid such
407 problems. */
408 if (!INTEGRAL_TYPE_P (type)
409 && !POINTER_TYPE_P (type))
410 return false;
411
412 loop = loop_containing_stmt (SSA_NAME_DEF_STMT (def));
413 scev = scalar_evolution_in_region (region, loop, def);
414
415 return !chrec_contains_undetermined (scev)
416 && (TREE_CODE (scev) != SSA_NAME
417 || !defined_in_sese_p (scev, region))
418 && (tree_does_not_contain_chrecs (scev)
419 || evolution_function_is_affine_p (scev));
420 }
421
392 #endif 422 #endif