27 #if defined(BUILDER_LOOP_FUSION) || \
28 defined(BUILDER_LOOP_FUSION_WITH_REGIONS)
71 typedef struct fusion_params {
72 bool maximize_parallelism;
75 unsigned int max_fused_per_loop;
78 typedef struct fusion_block **fbset;
82 static bool fusion_loops(
statement sloop1,
83 set contained_stmts_loop1,
85 set contained_stmts_loop2,
86 bool maximize_parallelism,
94 typedef struct fusion_block {
103 fbset rr_predecessors;
105 unsigned int count_fusion;
111 #define fusion_block_TYPE fusion_block
112 #define fusion_block_CAST(x) ((fusion_block)((x).p))
114 static size_t max_num;
116 #include <xmmintrin.h>
117 static inline void fbset_clear(fbset
self) {
118 __m128i z = _mm_setzero_si128();
119 for(fbset iter =
self,
end=
self+max_num;iter!=
end;iter+=
sizeof(__m128i)/
sizeof(fusion_block))
120 _mm_store_si128((__m128i*)iter,z);
122 static inline fbset fbset_make() {
123 fbset
self =_mm_malloc(max_num*
sizeof(fusion_block),32);
127 static inline void fbset_free(fbset fb) {
130 static void fbset_union(fbset
self, fbset other) {
131 for(
size_t i=0;i<max_num;i+=
sizeof(__m128i)/
sizeof(fusion_block)){
132 __m128i s = _mm_load_si128((__m128i*)&
self[i]),
133 o = _mm_load_si128((__m128i*)&other[i]);
135 _mm_store_si128((__m128i*)&
self[i],s);
139 static inline void fbset_clear(fbset
self) {
140 memset(
self,0,
sizeof(*
self)*max_num);
142 static inline fbset fbset_make() {
143 return calloc(max_num,
sizeof(fusion_block));
145 static inline void fbset_free(fbset fb) {
148 static void fbset_union(fbset
self, fbset other) {
149 for(
size_t i=0;i<max_num;i++)
155 static void fbset_difference(fbset
self, fbset other) {
156 for(
size_t i=0;i<max_num;i++)
160 static inline void fbset_del_element(fbset
self, fusion_block e) {
164 static inline void fbset_add_element(fbset
self, fusion_block e) {
168 static bool fbset_belong_p(fbset
self, fusion_block e) {
170 return self[e->id]!=NULL;
172 static bool fbset_empty_p(fbset
self) {
173 for(
size_t i=0;i<max_num;i++)
179 #define FBSET_FOREACH(e,s) \
181 for(size_t __i=0;__i<max_num;__i++)\
188 static vertex ordering_to_vertex(
int ordering) {
189 long int lordering = ordering;
190 return (
vertex)
hash_get(ordering_to_dg_mapping, (
void *)lordering);
240 static void print_block(fusion_block
block) {
241 fprintf(stderr,
"Block %d (fused %d times), predecessors : ",
243 FBSET_FOREACH(pred,
block->predecessors) {
244 fprintf(stderr,
"%d, ", pred->num);
246 fprintf(stderr,
" | successors : ");
247 FBSET_FOREACH(succ,
block->successors) {
248 fprintf(stderr,
"%d, ", succ->num);
250 fprintf(stderr,
" | rr_predecessors : ");
251 FBSET_FOREACH(rr_pred,
block->rr_predecessors) {
252 fprintf(stderr,
"%d, ", rr_pred->num);
254 fprintf(stderr,
" | rr_successors : ");
255 FBSET_FOREACH(rr_succ,
block->rr_successors) {
256 fprintf(stderr,
"%d, ", rr_succ->num);
283 static bool loops_have_same_bounds_p(
loop loop1,
loop loop2) {
306 if(loops_have_same_bounds_p(
loop1,loop2) && index1 == index2) {
325 static void replace_entity_effects_walker(
statement s,
void *_thecouple ) {
326 struct entity_pair *thecouple = _thecouple;
351 static int next_ordering = 999999;
370 return fused_statement;
376 static void free_temporary_fused_statement() {
391 static bool coarse_fusable_loops_p(
statement sloop1,
393 bool maximize_parallelism) {
409 pips_debug(1,
"non feasible inner statement (empty precondition), abort fusion\n");
425 bool may_conflicts_p =
false;
431 fprintf(stderr,
"original invariant regions:\n");
483 fprintf(stderr,
"testing conflict from:\n");
530 NIL, &gs, &levelsop, &gsop);
540 fprintf(stderr,
"\tno dependence\n");
543 fprintf(stderr,
"\tdependence at levels: ");
551 fprintf(stderr,
"\tdependence cone:\n");
554 fprintf(stderr,
"\tcorresponding linear system:\n");
559 if (!
ENDP(levelsop)) {
560 fprintf(stderr,
"\topposite dependence at levels: ");
567 fprintf(stderr,
"\tdependence cone:\n");
570 fprintf(stderr,
"\tcorresponding linear system:\n");
583 pips_debug(1,
"Loop carried forward dependence, break parallelism ");
585 if(maximize_parallelism) {
587 fprintf(stderr,
"then it is fusion preventing!\n");
589 may_conflicts_p =
true;
592 fprintf(stderr,
" but both loops are sequential, then fuse!\n");
596 fprintf(stderr,
" but fuse anyway!\n");
600 pips_debug(1,
"Loop independent forward dependence, safe...\n");
601 may_conflicts_p =
false;
608 if (!
ENDP(levelsop)) {
614 pips_debug(1,
"Loop carried backward dependence, fusion preventing !\n");
615 may_conflicts_p =
true;
652 return !may_conflicts_p;
660 static bool coarse_fusion_loops(
statement sloop1,
662 bool maximize_parallelism) {
669 if(!loops_have_same_bounds_p(
loop1, loop2)) {
670 pips_debug(4,
"Fusion aborted because of incompatible loop headers\n");
674 bool coarse_fusable_p = coarse_fusable_loops_p(sloop1,sloop2,maximize_parallelism);
676 if(coarse_fusable_p) {
684 pips_debug(3,
"First loop index (%s) is used in the second loop, we don't"
685 " know how to handle this case !\n",
743 return coarse_fusable_p;
755 static bool fine_fusion_loops(
statement sloop1,
756 set contained_stmts_loop1,
758 set contained_stmts_loop2,
759 bool maximize_parallelism) {
771 if(!loops_have_same_bounds_p(
loop1, loop2)) {
772 pips_debug(4,
"Fusion aborted because of incompatible loop headers\n");
781 pips_debug(4,
"Replace second loop index (%s) with first one (%s)\n",
790 pips_debug(3,
"First loop index (%s) is used in the second loop, we don't"
791 " know how to handle this case !\n",
799 struct entity_pair thecouple = { index2, index1 };
802 replace_entity_effects_walker);
851 print_graph(candidate_dg);
866 print_graph(candidate_dg);
922 pips_debug(2,
"This loop carried dependence is breaking parallism !\n");
958 "Considering arc : from statement %d :",
961 pips_debug(6,
" to statement %d :", statement_ordering2);
981 "Arc preventing fusion : from statement %d :",
984 pips_debug(6,
" to statement %d :", statement_ordering2);
993 "Arc ignored (%d,%d) : from statement %d :",
996 pips_debug(6,
" to statement %d :", statement_ordering2);
1008 bool inner_success =
false;
1016 pips_debug(4,
"Ensure that we don't break parallel loop nests !\n");
1027 success = fusion_loops(inner_loop1,stmts1,inner_loop2,stmts2,maximize_parallelism,
false);
1029 inner_success =
true;
1032 pips_debug(4,
"Inner loops not fusable :-(\n");
1068 if(!inner_success) {
1083 if(index1!=index2) {
1085 struct entity_pair thecouple = { index1, index2 };
1110 static bool fusion_loops(
statement sloop1,
1111 set contained_stmts_loop1,
1113 set contained_stmts_loop2,
1114 bool maximize_parallelism,
1115 bool coarse_grain) {
1125 pips_debug(4,
"Fusion aborted because of fuse_maximize_parallelism property"
1126 ", loop_parallel_p(loop1)=>%d | loop_parallel_p(loop2)=>%d\n"
1134 return coarse_fusion_loops(sloop1,sloop2,maximize_parallelism);
1136 return fine_fusion_loops(sloop1,contained_stmts_loop1,sloop2,contained_stmts_loop2,
1137 maximize_parallelism);
1145 static fusion_block make_empty_block(
int num) {
1146 fusion_block
block = (fusion_block)
malloc(
sizeof(
struct fusion_block));
1151 block->successors = fbset_make();
1152 block->rr_successors = fbset_make();
1153 block->predecessors = fbset_make();
1154 block->rr_predecessors = fbset_make();
1155 block->is_a_loop =
false;
1156 block->count_fusion = 0;
1157 block->processed =
false;
1166 fbset_free(b->successors);
1167 fbset_free(b->rr_successors);
1168 fbset_free(b->predecessors);
1169 fbset_free(b->rr_predecessors);
1178 static fusion_block make_block_from_statement(
statement s,
int num) {
1180 fusion_block b = make_empty_block(
num);
1190 b->is_a_loop =
true;
1195 pips_debug(3,
"Block created : num %d ; is_a_loop : %d\n",
1196 b->num,b->is_a_loop);
1203 static fusion_block get_block_from_ordering(
int ordering,
list block_list) {
1205 FOREACH(fusion_block, b, block_list) {
1217 static void compute_successors(fusion_block b,
list block_list) {
1218 pips_assert(
"Expect successors list to be initially empty",
1219 fbset_empty_p(b->successors) && fbset_empty_p(b->rr_successors));
1224 vertex v = ordering_to_vertex(ordering);
1241 pips_debug(5,
"Considering dependence to statement %d\n",
1248 fusion_block sink_block = get_block_from_ordering(sink_ordering,
1250 if(sink_block == NULL) {
1251 pips_debug(2,
"No block found for ordering %d, dependence ignored\n",
1256 if(sink_block->num > b->num) {
1261 fbset_add_element(b->successors,
1262 (
void *)sink_block);
1264 fbset_add_element(sink_block->predecessors,
1269 fbset_add_element(b->rr_successors,
1270 (
void *)sink_block);
1272 fbset_add_element(sink_block->rr_predecessors,
1284 fbset_difference(b->rr_successors, b->successors);
1285 fbset_difference(b->rr_predecessors, b->predecessors);
1294 static void prune_successors_tree_aux(fusion_block b, fbset full_succ) {
1297 fbset full_succ_of_succ = fbset_make();
1298 FBSET_FOREACH(succ, b->successors) {
1299 prune_successors_tree_aux(succ, full_succ_of_succ);
1300 fbset_union(full_succ,full_succ_of_succ);
1301 fbset_clear(full_succ_of_succ);
1303 fbset_free(full_succ_of_succ);
1305 FBSET_FOREACH(succ_of_succ,full_succ){
1306 fbset_del_element(succ_of_succ->predecessors, b);
1307 fbset_del_element(succ_of_succ->rr_predecessors, b);
1308 fbset_del_element(b->successors,succ_of_succ);
1309 fbset_del_element(b->rr_successors,succ_of_succ);
1311 fbset_union(full_succ,b->successors);
1314 static fbset prune_successors_tree(fusion_block b) {
1316 fbset full_succ = fbset_make();
1317 prune_successors_tree_aux(b, full_succ);
1322 static void get_all_path_heads(fusion_block b,
set heads) {
1323 if(fbset_empty_p(b->predecessors)) {
1326 FBSET_FOREACH(pred,b->predecessors) {
1327 get_all_path_heads(pred,heads);
1335 static void merge_blocks(fusion_block block1, fusion_block block2) {
1341 print_block(block1);
1342 print_block(block2);
1346 fbset_union(block1->predecessors, block2->predecessors);
1348 fbset_union(block1->rr_predecessors, block2->rr_predecessors);
1350 fbset_union( block1->successors, block2->successors);
1352 fbset_union(block1->rr_successors, block2->rr_successors);
1354 set_union(block1->statements, block1->statements, block2->statements);
1357 FBSET_FOREACH(succ,block2->successors) {
1358 fbset_add_element(succ->predecessors, block1);
1359 fbset_del_element(succ->predecessors, block2);
1363 FBSET_FOREACH(rr_succ,block2->rr_successors) {
1364 fbset_add_element(rr_succ->rr_predecessors, block1);
1365 fbset_del_element(rr_succ->rr_predecessors, block2);
1369 FBSET_FOREACH(pred,block2->predecessors) {
1370 if(pred != block1) {
1371 fbset_add_element(pred->successors, block1);
1373 fbset_del_element(pred->successors, block2);
1377 FBSET_FOREACH(rr_pred,block2->rr_predecessors) {
1378 if(rr_pred != block1) {
1379 fbset_add_element(rr_pred->rr_successors, block1);
1381 fbset_del_element(rr_pred->rr_successors, block2);
1385 fbset_del_element(block1->predecessors, block1);
1386 fbset_del_element(block1->successors, block1);
1388 fbset_del_element(block1->rr_predecessors, block1);
1389 fbset_del_element(block1->rr_successors, block1);
1397 get_all_path_heads(block1,heads);
1399 fbset_free(prune_successors_tree(b));
1410 block1->count_fusion++;
1414 print_block(block1);
1415 print_block(block2);
1423 static bool fusable_blocks_p( fusion_block
b1, fusion_block
b2,
unsigned int fuse_limit) {
1424 bool fusable_p =
false;
1425 if(
b1!=
b2 &&
b1->num>=0 &&
b2->num>=0 &&
b1->is_a_loop &&
b2->is_a_loop
1426 &&
b1->count_fusion<fuse_limit &&
b2->count_fusion<fuse_limit) {
1429 if(fbset_belong_p(
b2->successors,
b1)) {
1431 pips_debug(6,
"b1 is a successor of b2, fusion prevented !\n");
1436 }
else if(fbset_belong_p(
b1->successors,
b2)) {
1439 pips_debug(6,
"blocks are fusable because directly connected\n");
1448 pips_debug(6,
"Getting full successors for b1 (%d)\n",
b1->num);
1449 fusion_block* full_succ_b1 = prune_successors_tree(
b1);
1450 if(!fbset_belong_p(full_succ_b1,
b2)) {
1453 pips_debug(6,
"Getting full successors for b2 (%d)\n",
b2->num);
1454 fusion_block* full_succ_b2 = prune_successors_tree(
b2);
1455 if(!fbset_belong_p(full_succ_b2,
b1)) {
1458 fbset_free(full_succ_b2);
1460 fbset_free(full_succ_b1);
1471 static bool fuse_block( fusion_block
b1,
1473 bool maximize_parallelism,
1475 bool return_val =
false;
1476 if(!
b1->is_a_loop) {
1477 pips_debug(5,
"B1 (%d) is a not a loop, skip !\n",
b1->num);
1478 }
else if(!
b2->is_a_loop) {
1479 pips_debug(5,
"B2 (%d) is a not a loop, skip !\n",
b2->num);
1480 }
else if(
b1->num==-1) {
1482 }
else if(
b2->num==-1) {
1487 if(fusion_loops(
b1->s,
b1->statements,
b2->s,
b2->statements, maximize_parallelism, coarse)) {
1490 merge_blocks(
b1,
b2);
1505 static bool try_to_fuse_with_successors(fusion_block b,
1507 bool maximize_parallelism,
1508 unsigned int fuse_limit,
1511 if(!b->processed && b->is_a_loop && b->num>=0 && b->count_fusion < fuse_limit) {
1512 pips_debug(5,
"Block %d is a loop, try to fuse with successors !\n",b->num);
1513 FBSET_FOREACH( succ, b->successors)
1515 pips_debug(6,
"Handling successor : %d\n",succ->num);
1516 if(fuse_block(b, succ, maximize_parallelism,coarse)) {
1527 FBSET_FOREACH(succ, b->successors) {
1528 if(try_to_fuse_with_successors(succ,
1530 maximize_parallelism,
1536 b->processed =
false;
1548 static void try_to_fuse_with_rr_successors(fusion_block b,
1550 bool maximize_parallelism,
1551 unsigned int fuse_limit,
1553 if(b->is_a_loop && b->count_fusion < fuse_limit) {
1554 pips_debug(5,
"Block %d is a loop, try to fuse with rr_successors !\n",b->num);
1555 FBSET_FOREACH(succ, b->rr_successors)
1557 if(fusable_blocks_p(b,succ,fuse_limit) &&
1558 fuse_block(b, succ, maximize_parallelism,coarse)) {
1568 try_to_fuse_with_rr_successors(b,
1570 maximize_parallelism,
1589 static void fuse_all_possible_blocks(
list blocks,
1591 bool maximize_parallelism,
1592 unsigned int fuse_limit,
1595 if(
b1->is_a_loop &&
b1->count_fusion<fuse_limit) {
1597 if(fusable_blocks_p(
b1,
b2,fuse_limit)) {
1598 if(fuse_block(
b1,
b2, maximize_parallelism,coarse)) {
1611 static bool fusion_in_sequence(
sequence s, fusion_params
params) {
1622 int number_of_loop = 0, i=0;
1630 max_num=4*((max_num+3)/4);
1633 fusion_block b = make_block_from_statement(st, i);
1634 block_list =
gen_cons(b, block_list);
1644 if(number_of_loop > 1) {
1647 compute_successors(
block, block_list);
1653 if(fbset_empty_p(
block->predecessors)) {
1654 fbset_free(prune_successors_tree(
block));
1659 print_blocks(block_list);
1669 if(fbset_empty_p(
block->predecessors)) {
1671 "Operate on block %d (is_a_loop %d)\n",
1675 if(try_to_fuse_with_successors(
block,
1677 params->maximize_parallelism,
1678 params->max_fused_per_loop,
1694 try_to_fuse_with_rr_successors(
block,
1696 params->maximize_parallelism,
1697 params->max_fused_per_loop,
1708 print_blocks(block_list);
1710 fuse_all_possible_blocks(block_list,
1712 params->maximize_parallelism,
1713 params->max_fused_per_loop,
1719 if(fuse_count > 0) {
1723 list block_iter = block_list;
1725 while(block_iter != NULL) {
1726 fusion_block
block = (fusion_block)
CAR(block_iter).p;
1728 if(
block->num < 0) {
1729 if(prev_block_iter==
NIL) {
1730 block_list =
CDR(block_iter);
1732 CDR(prev_block_iter) =
CDR(block_iter);
1734 list garbage = block_iter;
1735 block_iter =
CDR(block_iter);
1738 prev_block_iter = block_iter;
1739 block_iter =
CDR(block_iter);
1753 print_blocks(block_list);
1758 while(block_count > 0) {
1761 int active_blocks = 0;
1762 bool at_least_one_block_scheduled =
false;
1766 if(
block->num < 0) {
1771 if(fbset_empty_p(
block->predecessors)) {
1780 at_least_one_block_scheduled =
true;
1783 FBSET_FOREACH(succ,
block->successors)
1785 fbset_del_element(succ->predecessors,
block);
1790 goto restart_generation;
1801 if(!at_least_one_block_scheduled && active_blocks>0) {
1803 "in the block tree, which means it's not a tree ! Abort...\n");
1813 free_block_list(block_list);
1821 static void compute_fusion_on_statement(
statement s,
bool coarse) {
1823 struct fusion_params
params;
1836 static bool module_loop_fusion(
char *
module_name,
bool region_based) {
1886 debug_on(
"LOOP_FUSION_DEBUG_LEVEL");
1900 free_temporary_fused_statement();
1902 ordering_to_dg_mapping = NULL;
int get_int_property(const string)
void free_conflict(conflict p)
conflict make_conflict(effect a1, effect a2, cone a3)
effect copy_effect(effect p)
EFFECT.
void free_statement(statement p)
struct paramStruct params
dg_vertex_label vertex_label
static graph dependence_graph
static statement module_statement
graph statement_dependence_graph(statement s)
Compute from a given statement, the dependency graph.
Psysteme sg_to_sc_chernikova(Ptsg sg)
bool clean_up_sequences(statement s)
Recursively clean up the statement sequences by fusing them if possible and by removing useless one.
struct _newgen_struct_statement_ * statement
static list predecessors(statement st, graph tg)
static list successors(list l)
static list blocks
lisp of loops
#define dg_vertex_label_statement(x)
#define CONFLICT(x)
CONFLICT.
#define dg_arc_label_conflicts(x)
#define conflict_source(x)
#define conflict_undefined
struct _newgen_struct_dg_vertex_label_ * dg_vertex_label
#define region_write_p(reg)
#define region_entity(reg)
#define region_system(reg)
#define region_read_p(reg)
useful region macros
void all_regions_variable_rename(list, entity, entity)
void project_regions_along_variables(list, list)
void project_regions_along_variables(list l_reg, list l_param) input : a list of regions to project,...
list load_invariant_rw_effects_list(statement)
void store_proper_rw_effects_list(statement, list)
list load_proper_rw_effects_list(statement)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void reset_invariant_rw_effects(void)
void store_invariant_rw_effects_list(statement, list)
void set_invariant_rw_effects(statement_effects)
void reset_cumulated_rw_effects(void)
list words_effect(effect)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_write_p(eff)
#define effect_variable(e)
For COMPATIBILITY purpose only - DO NOT USE anymore.
entity effect_entity(effect)
cproto-generated files
bool store_effect_p(effect)
bool effect_scalar_p(effect)
#define action_write_p(x)
bool blank_string_p(const char *s)
const char * module_name(const char *s)
Return the module part of an entity name.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_chunk_undefined_p(c)
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define successor_vertex(x)
#define successor_arc_label(x)
struct _newgen_struct_graph_ * graph
#define vertex_vertex_label(x)
#define vertex_successors(x)
#define SUCCESSOR(x)
SUCCESSOR.
#define graph_vertices(x)
statement make_block_statement(list)
Make a block statement from a list of statement.
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
entity set_current_module_entity(entity)
static.c
void replace_entity(void *s, entity old, entity new)
per variable version of replace_entities.
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
bool loop_parallel_p(loop l)
Test if a loop is parallel.
void clean_enclosing_loops(void)
statement get_first_inner_perfectly_nested_loop(statement stat)
Return the inner loop in a perfect loop-nest.
statement_mapping loops_mapping_of_statement(statement stat)
#define ENDP(l)
Test if a list is empty.
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
size_t gen_length(const list l)
list gen_cons(const void *item, const list next)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
bool gen_in_list_p(const void *vo, const list lx)
tell whether vo belongs to lx
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
void * gen_find_eq(const void *item, const list seq)
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
list gen_full_copy_list(list l)
Copy a list structure with element copy.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
sequence statement_sequence(statement)
Get the sequence of a statement sequence.
loop statement_loop(statement)
Get the loop of a statement.
bool statement_loop_p(statement)
bool statement_sequence_p(statement)
Statement classes induced from instruction type.
void append_comments_to_statement(statement, string)
Append a comment string (if non empty) to the comments of a statement, if the c.
void insert_statement(statement, statement, bool)
This is the normal entry point.
bool empty_comments_p(const char *)
bool statement_may_contain_exiting_intrinsic_call_p(statement)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
loop loop1
tiling_sequence.c
void * memset(void *str, int c, size_t len)
memset.c – set an area of memory to a given value Copyright (C) 1991, 2003, 2009-2011 Free Software F...
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
set set_del_element(set, const set, const void *)
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
bool set_belong_p(const set, const void *)
set set_union(set, const set, const set)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
statement ordering_to_statement(int o)
Get the statement associated to a given ordering.
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
bool overwrite_ordering_of_the_statement_to_current_mapping(statement stat)
Overwrite the statement for its ordering, if any, in the hash-map.
bool ordering_to_statement_initialized_p()
Test if the ordering to statement is initialized.
void print_statement(statement)
Print a statement on stderr.
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
bool same_entity_p(entity e1, entity e2)
predicates on entities
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
set get_referenced_entities(void *elem)
retrieves the set of entities used in elem beware that this entities may be formal parameters,...
bool range_equal_p(range r1, range r2)
void reset_enclosing_loops_map(void)
void set_enclosing_loops_map(statement_mapping)
struct _newgen_struct_sequence_ * sequence
#define statement_ordering(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define sequence_statements(x)
#define reference_indices(x)
#define statement_extensions(x)
#define instruction_sequence(x)
#define statement_instruction(x)
#define statement_comments(x)
#define extensions_extension(x)
#define statement_undefined_p(x)
#define sequence_domain
newgen_reference_domain_defined
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
list TestCoupleOfReferences(list n1, Psysteme sc1 __attribute__((unused)), statement s1, effect ef1, reference r1, list n2, Psysteme sc2 __attribute__((unused)), statement s2, effect ef2, reference r2, list llv, Ptsg *gs __attribute__((unused)), list *levelsop __attribute__((unused)), Ptsg *gsop __attribute__((unused)))
graph compute_dg_on_statement_from_chains_in_place(statement s, graph chains)
int vertex_ordering(vertex)
hash_table compute_ordering_to_dg_mapping(graph)
Define a mapping from the statement ordering to the dependence graph vertices:
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Value b1
booleen indiquant quel membre est en cours d'analyse
void sc_fprint(FILE *fp, Psysteme ps, get_variable_name_t nom_var)
void sc_fprint(FILE * f, Psysteme ps, char * (*nom_var)()): cette fonction imprime dans le fichier po...
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
transformer load_statement_precondition(statement)
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)
#define SG_UNDEFINED_P(sg)
void sg_rm(Ptsg sg)
void sg_rm(Ptsg sg): liberation de l'espace memoire occupe par un systeme generateur
void sg_fprint_as_dense(FILE *f, Ptsg sg, Pbase b)
void sg_fprint_as_dense(FILE * f, Ptsg sg): impression d'un systeme generateur
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
Representation d'un systeme generateur par trois ensembles de sommets de rayons et de droites.
void print_words(FILE *fd, cons *lw)
char *(* get_variable_name_t)(Variable)