PIPS
codegen.c
Go to the documentation of this file.
1 /*
2 
3  $Id: codegen.c 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23  */
24 #ifdef HAVE_CONFIG_H
25 #include "pips_config.h"
26 #endif
27 
28 #include "local.h"
29 #include "prettyprint.h" // for debugging
30 #include "effects-generic.h"
31 
32 /* FI: I did not know this was still used... */
34 
35 /*
36  this function checks if a successor su of a vertex is accessible
37  through an arc whose level is less than 'level'
38 
39  dal is the arc label
40 
41  level is the minimum level
42  */
43 static bool AK_ignore_this_level(dg_arc_label dal, int level) {
44  bool true_dep = get_bool_property("RICE_DATAFLOW_DEPENDENCE_ONLY");
46  if(conflict_cone(c) != cone_undefined) {
47  FOREACH(int, l, cone_levels(conflict_cone(c)))
48  {
49  if(l >= level) {
50  if(true_dep) {
53 
54  return (action_write_p( s ) && action_read_p( k ));
55  } else {
56  return (false);
57  }
58  }
59  }
60  }
61  }
62 
63  return (true);
64 }
65 
66 /*
67  this function checks if a vertex v should be ignored, i.e. does not
68  belong to region
69  */
73 
74  return (!set_belong_p(region, (char *)st));
75 }
76 
77 /*
78  this function checks if a successor su of a vertex should be
79  ignored, i.e. if it is linked through an arc whose level is less than
80  'level' or if it does not belong to region
81  */
83  set region,
84  successor su,
85  int level) {
87 
88  bool ignore_p = AK_ignore_this_vertex(region, successor_vertex(su));
89 
90  if(!ignore_p)
91  ignore_p = AK_ignore_this_level(al, level);
92 
93  if(!ignore_p
94  && get_bool_property("PARALLELIZATION_IGNORE_THREAD_SAFE_VARIABLES")) {
96  bool thread_safe_p = true;
97  FOREACH(CONFLICT, c, cl) {
98  effect e = conflict_source(c);
100  entity v = reference_variable(r);
101 
102  if(!thread_safe_variable_p(v)) {
103  thread_safe_p = false;
104  break;
105  }
106  }
107  ignore_p = thread_safe_p;
108  }
109  return ignore_p;
110 }
111 
112 /* Check if a variable is private to loop nest */
113 static bool variable_private_to_loop_p(list /* of loop statement */loops,
114  entity var) {
115  FOREACH(STATEMENT, st, loops) {
116  // We filter-out local declarations and loop locals
118  list
119  d =
121 
122  // There is usually no declaration at this level,
123  // but if we find some, warn the user
124  if(statement_declarations(st) != NIL) {
125  pips_user_warning("We don't expect declarations there... (sn : %d)\n",
126  statement_number(st));
128  }
129 
130  ifdebug(8) {
131  print_statement(st);
132  fprintf(stderr, "The list of privatized/private variables : \n");
133  print_entities(l);
134  fprintf(stderr, "\nThe list of locally declared variables : \n");
135  print_entities(d);
136  fprintf(stderr, "\n");
137  }
138 
139  if(gen_find_eq(var, l) != entity_undefined || gen_find_eq(var, d)
140  != entity_undefined) {
141  return true;
142  }
143  }
144  return false;
145 }
146 
147 /* This function checks if conflict c between vertices v1 and v2 should
148  be ignored at level l.
149 
150  A conflict is to be ignored if the variable that creates the conflict is
151  local to one of the enclosing loops.
152 
153  FI: this should be extended to variables declared within the last loop
154  body for C code?
155 
156  Note: The loops around every statement got by
157  load_statement_loops(statement) here are just these after taking off
158  the loops on which the Kennedy's algo. can't be applied. (YY)
159 
160  FI: I do not understand the note above.
161  */
162 
163 bool ignore_this_conflict(vertex v1, vertex v2, conflict c, int l) {
164  extern int enclosing;
165  effect e1 = conflict_source(c);
167  entity var1 = reference_variable(r1);
170 
171  effect e2 = conflict_sink(c);
172  reference r2 = effect_any_reference( e2 );
173  entity var2 = reference_variable(r2);
176  register int i;
177 
178  if(var1 != var2) {
179  /* equivalences do not deserve more cpu cycles */
180  return (false);
181  }
182  for (i = 1; i < l - enclosing; i++) {
183  if(!ENDP(loops1)) {
184  loops1 = CDR(loops1);
185  }
186  if(!ENDP(loops2)) {
187  loops2 = CDR(loops2);
188  }
189  }
190  ifdebug(8) {
191  pips_debug(8, "verifying the following conflit at level %d: \n",l);
192  fprintf(stderr,
193  "\t%02td --> %02td ",
195  statement_number(s2));
196  fprintf(stderr, "\t\tfrom ");
198 
199  fprintf(stderr, " to ");
201  fprintf(stderr, "\n");
202  }
203 
204  return variable_private_to_loop_p(loops1, var1)
205  || variable_private_to_loop_p(loops2, var2);
206 }
207 
208 /* s is a strongly connected component which is analyzed at level
209  l. Its vertices are enclosed in at least l loops. This gives us a
210  solution to retrieve the level l loop enclosing a scc: to take its
211  first vertex and retrieve the l-th loop around this vertex.
212  */
214  vertex v = VERTEX(CAR(scc_vertices(s)));
217 
218  if(l > 0)
219  MAPL(pl, {
220  if (l-- == 1)
221  return(STATEMENT(CAR(pl)));
222  }, loops);
223  return (statement_undefined);
224 }
225 
228  MAPL(pv, {
230  (char *) vertex_to_statement(VERTEX(CAR(pv))));
231  }, scc_vertices(s));
232  return (region);
233 }
234 
235 /* s is a strongly connected component for which a DO loop is being
236  produced. this function returns false if s contains no dependences at
237  level l. in this case, the loop will be a DOALL loop.
238  */
240  FOREACH(VERTEX, v, scc_vertices(s)) {
243  {
244  vertex vs = successor_vertex(su);
246 
247  if(!AK_ignore_this_vertex(region, vs)) {
250  {
251  if(!ignore_this_conflict(v, vs, c, level)) {
252  if(conflict_cone(c) != cone_undefined) {
253  FOREACH(int, l, cone_levels(conflict_cone(c)))
254  {
255  if(l == level) {
256  ifdebug(7) {
257  pips_debug(7, "containing conflit at level %d: ",level);
258  fprintf(stderr,
259  "\t%02td --> %02td ",
261  statement_number(s2));
262  fprintf(stderr, "\t\tfrom ");
264  fprintf(stderr, " to ");
266  fprintf(stderr, "\n");
267  }
268  return (true);
269  }
270  }
271  }
272  }
273  }
274  }
275  }
276  }
277 
278  return (false);
279 }
280 
281 /* this function returns true if scc s is stronly connected at level l,
282  i.e. dependence arcs at level l or greater form at least one cycle */
283 
284 bool strongly_connected_p(scc s, int l) {
285  cons *pv = scc_vertices(s);
286  vertex v = VERTEX(CAR(pv));
287 
288  /* if s contains more than one vertex, it is strongly connected */
289  if(CDR(pv) != NIL)
290  return (true);
291  /* if there is a dependence from v to v, s is strongly connected */
294  && successor_vertex(s) == v)
295  return (true);
296  }
297 
298  /* s is not strongly connected */
299  return (false);
300 }
301 
302 /* this function creates a nest of parallel loops around an isolated
303  statement whose iterations may execute in parallel.
304 
305  loops is the loop nest that was around body in the original program. l
306  is the current level; it tells us how many loops have already been
307  processed.
308 
309  */
311  cons *loops,
312  statement body,
313  bool task_parallelize_p) {
314  statement s;
315  pips_debug(3, " at level %d ...\n",l);
316 
317  if(loops == NIL)
318  s = body;
319  else if(l > 0)
320  s = MakeNestOfParallelLoops(l - 1, CDR(loops), body, task_parallelize_p);
321  else {
322  statement slo = STATEMENT(CAR(loops));
323  loop lo = statement_loop(slo);
324  tag seq_or_par = ((CDR(loops) == NIL || task_parallelize_p)
327 
328  /* At most one outer loop parallel */
329  bool
330  task_parallelize_inner =
331  (seq_or_par == is_execution_parallel
332  && !get_bool_property("GENERATE_NESTED_PARALLEL_LOOPS")) ? false
333  : task_parallelize_p;
334 
335  s = MakeLoopAs(slo,
336  seq_or_par,
338  CDR(loops),
339  body,
340  task_parallelize_inner));
341  }
342  return (s);
343 }
344 
347  return (gen_length(loops));
348 }
349 
351  int nbl,
352  list *lst,
353  list loops,
354  list * block,
355  list * eblock,
356  bool task_parallelize_p) {
359  extern int enclosing;
360 
361  debug_on("RICE_DEBUG_LEVEL");
362 
363  if(*lst != NIL && nbl) {
364  if(gen_length(*lst) == 1)
365  rst = (STATEMENT(CAR(*lst)));
366  else
367  rst = make_block_statement(*lst);
368  if(nbl >= l - 1)
369  stat = MakeNestOfParallelLoops(l - 1 - enclosing,
370  loops,
371  rst,
372  task_parallelize_p);
373  else
374  stat = rst;
375  *lst = NIL;
376  INSERT_AT_END(*block, *eblock, CONS(STATEMENT, stat, NIL));
377  }
378 
379  debug_off();
380  return (stat);
381 }
382 
383 /* This function implements Allen & Kennedy's algorithm.
384  *
385  * BB (Bruno Baron): task_parallelize_p is true when we want to
386  * parallelize the loop, false when we only want to vectorize
387  * it. Probably called by "rice_cray", but there is no explicit
388  * information about the vectorization facility in PIPS.
389  *
390  * This function is also used to perform loop invariant code motion
391  * (Julien Zory).
392  */
394  graph g,
395  set region,
396  int l,
397  bool task_parallelize_p) {
398  list lst = NIL;
399  cons *lsccs;
400  // cons *ps; unused, but still present in commented out code
401  list loops = NIL;
402 
403  cons *block = NIL, *eblock = NIL;
406  int nbl = 0;
407 
408  debug_on("RICE_DEBUG_LEVEL");
409 
410  pips_debug(9, "Begin: starting at level %d ...\n", l);
411  ifdebug(9)
412  print_statement_set(stderr, region);
413 
414  pips_debug(9, "finding and top-sorting sccs ...\n");
416  lsccs = FindAndTopSortSccs(g, region, l);
418 
419  pips_debug(9, "generating code ...\n");
420 
421  FOREACH(scc,s,lsccs) {
422  stata = statement_undefined;
423  if(strongly_connected_p(s, l))
424  stata = ConnectedStatements(g, s, l, task_parallelize_p);
425  else {
426  if(!get_bool_property("PARTIAL_DISTRIBUTION"))
427  /* if s contains a single vertex and if this vertex is not
428  dependent upon itself, we generate a doall loop for it,
429  unless it is a continue statement. */
430  stata = IsolatedStatement(s, l, task_parallelize_p);
431  else {
432  /* statements that are independent are gathered
433  into the same doall loop */
434  stata = IsolatedStatement(s, l, task_parallelize_p);
435 
436  /* set inner_region = scc_region(s);
437  if (contains_level_l_dependence(s,inner_region,l)) {
438  stat = IsolatedStatement(s, l, task_parallelize_p);
439  debug(9, "CodeGenerate",
440  "isolated comp.that contains dep. at Level %d\n",
441  l);
442  }
443  else {
444  vertex v = VERTEX(CAR(scc_vertices(s)));
445  statement st = vertex_to_statement(v);
446  instruction sbody = statement_instruction(st);
447  nbl = statement_imbrication_level(st);
448  if (instruction_call_p(sbody)
449  && !instruction_continue_p(sbody))
450  if (nbl>=l-1)
451  stat=IsolatedStatement(s, l, task_parallelize_p);
452  else {
453  loops = load_statement_enclosing_loops(st);
454  lst = gen_nconc(lst, CONS(STATEMENT, st, NIL));
455  }
456  }
457  */
458  }
459  }
460 
461  /* In order to preserve the dependences, statements that have
462  been collected should be generated before the isolated statement
463  that has just been detected */
464 
465  if(stata != statement_undefined) {
466  ifdebug(9) {
467  pips_debug(9, "generated statement:\n");
469  }
470  (void)MakeNestOfStatementList(l,
471  nbl,
472  &lst,
473  loops,
474  &block,
475  &eblock,
476  task_parallelize_p);
477  INSERT_AT_END(block, eblock, CONS(STATEMENT, stata, NIL));
478  }
479  }
480  gen_free_list(lsccs);
481 
482  (void)MakeNestOfStatementList(l,
483  nbl,
484  &lst,
485  loops,
486  &block,
487  &eblock,
488  task_parallelize_p);
489 
490  switch(gen_length(block)) {
491  case 0:
492  rst = statement_undefined;
493  break;
494  default:
496  }
497 
498  ifdebug(8) {
499  pips_debug(8, "Result:\n");
500 
501  if(rst == statement_undefined)
502  pips_debug(8, "No code to generate\n");
503  else
505 
506  }
507  debug_off();
508  return (rst);
509 }
510 
511 /* This function creates a new loop whose characteristics (index,
512  * bounds, ...) are similar to those of old_loop. The body and the
513  * execution type are different between the old and the new loop.
514  *
515  * fixed bug about private variable without effects, FC 22/09/93
516  */
517 statement MakeLoopAs(statement old_loop_statement,
518  tag seq_or_par,
519  statement body) {
520  loop old_loop = statement_loop(old_loop_statement);
521  loop new_loop;
522  statement new_loop_s;
523  statement old_body = loop_body (old_loop);
524  list new_locals = gen_copy_seq(loop_locals(old_loop));
525 
527  seq_or_par = is_execution_sequential;
528 
529  // copy declaration from old body to new body
530  if((statement_decls_text (old_body) != string_undefined)
531  && (statement_decls_text (old_body) != NULL)) {
532  if(!statement_block_p(body))
533  body = make_block_statement(CONS(STATEMENT,body,NIL));
535  }
536  if((statement_declarations (old_body) != list_undefined)
537  && (statement_declarations (old_body) != NULL)) {
538  if(!statement_block_p(body))
539  body = make_block_statement(CONS(STATEMENT,body,NIL));
541  = gen_copy_seq(statement_declarations (old_body));
542  }
543 
544  new_loop = make_loop(loop_index(old_loop), copy_range(loop_range(old_loop)), /* avoid sharing */
545  body, entity_empty_label(), make_execution(seq_or_par, UU), new_locals);
546 
547  new_loop_s
549  statement_number(old_loop_statement),
553  NIL,
554  NULL,
556 
557  ifdebug(8) {
558  pips_assert("Execution is either parallel or sequential",
559  seq_or_par==is_execution_sequential || seq_or_par==is_execution_parallel);
560  pips_debug(8, "New %s loop\n",
561  seq_or_par==is_execution_sequential? "sequential" : "parallel");
562  print_parallel_statement(new_loop_s);
563  }
564 
565  return (new_loop_s);
566 }
567 
568 /* If the isolated statement is a CALL and is not a CONTINUE,
569  regenerate the nested loops around it. Otherwise, returns an
570  undefined statement. */
571 statement IsolatedStatement(scc s, int l, bool task_parallelize_p) {
572  vertex v = VERTEX(CAR(scc_vertices(s)));
577  extern int enclosing;
578 
579  pips_debug(8, "Input statement %" PRIdPTR "\n", statement_number(st));
580 
581  /* continue statements are ignored. */
582  /*FI: But they should not be isolated statements if the contain
583  declarations... */
584  //if(declaration_statement_p(st))
585  //pips_internal_error("Declaration statement is junked.");
586 
587  if(!instruction_call_p(sbody) || (continue_statement_p(st)
588  && !declaration_statement_p(st)))
589  ;
590  /* FI: we are likely to end up in trouble here because C allows
591  expressions as instructions... */
592  /* FI: if the statement is any kind of loop or a test, do not go
593  down.*/
594  else
595  rst = MakeNestOfParallelLoops(l - 1 - enclosing,
596  loops,
597  st,
598  task_parallelize_p);
599 
600  ifdebug(8) {
601  pips_debug(8, "Returned statement:\n");
603  }
604 
605  return (rst);
606 }
607 
608 /* BB: ConnectedStatements() is called when s contains more than one
609  vertex or one vertex dependent upon itself. Thus, vectorization can't
610  occur.
611 
612  FI: it may not be true if one of the statements is a C declaration.
613  */
614 statement ConnectedStatements(graph g, scc s, int l, bool task_parallelize_p) {
615  extern int enclosing;
617  loop lo = statement_loop(slo);
618  statement inner_stat;
619  set inner_region;
620  tag seq_or_par;
621  bool task_parallelize_inner;
622 
623  pips_debug(8, "at level %d:\n",l);
624  ifdebug(8)
625  PrintScc(s);
626 
627  inner_region = scc_region(s);
628  seq_or_par = (!task_parallelize_p
629  || contains_level_l_dependence(s, inner_region, l)
632 
633  /* At most one outer loop parallel */
634  task_parallelize_inner
635  = (seq_or_par == is_execution_parallel
636  && !get_bool_property("GENERATE_NESTED_PARALLEL_LOOPS")) ? false
637  : task_parallelize_p;
638 
639  /* CodeGenerate does not use the first parameter... */
640  inner_stat = CodeGenerate(/* big hack */statement_undefined,
641  g,
642  inner_region,
643  l + 1,
644  task_parallelize_inner);
645 
646  set_free(inner_region);
647 
648  if(statement_undefined_p(inner_stat))
649  return inner_stat;
650  else
651  return MakeLoopAs(slo, seq_or_par, inner_stat);
652 }
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
Definition: 3dnow.h:3
execution make_execution(enum execution_utype tag, void *val)
Definition: ri.c:838
range copy_range(range p)
RANGE.
Definition: ri.c:2005
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
Definition: ri.c:1301
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
Definition: ri.c:2222
instruction make_instruction(enum instruction_utype tag, void *val)
Definition: ri.c:1166
synchronization make_synchronization_none(void)
Definition: ri.c:2424
extensions copy_extensions(extensions p)
EXTENSIONS.
Definition: ri.c:947
static list loops
#define dg_vertex_label_statement(x)
Definition: dg.h:235
struct _newgen_struct_dg_arc_label_ * dg_arc_label
Definition: dg.h:60
#define conflict_sink(x)
Definition: dg.h:167
#define cone_levels(x)
Definition: dg.h:128
#define CONFLICT(x)
CONFLICT.
Definition: dg.h:134
#define dg_arc_label_conflicts(x)
Definition: dg.h:201
#define scc_vertices(x)
Definition: dg.h:345
#define conflict_source(x)
Definition: dg.h:165
#define cone_undefined
Definition: dg.h:104
struct _newgen_struct_dg_vertex_label_ * dg_vertex_label
Definition: dg.h:68
#define conflict_cone(x)
Definition: dg.h:169
#define region
simulation of the type region
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_action(x)
Definition: effects.h:642
#define action_write_p(x)
Definition: effects.h:314
#define action_read_p(x)
Definition: effects.h:311
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define successor_vertex(x)
Definition: graph.h:118
#define successor_arc_label(x)
Definition: graph.h:116
#define vertex_vertex_label(x)
Definition: graph.h:152
#define vertex_successors(x)
Definition: graph.h:154
#define SUCCESSOR(x)
SUCCESSOR.
Definition: graph.h:86
#define VERTEX(x)
VERTEX.
Definition: graph.h:122
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
bool index_private_p(loop lo)
returns true if loop lo's index is private for this loop
Definition: loop.c:240
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
list gen_copy_seq(list l)
Copy a list structure.
Definition: list.c:501
size_t gen_length(const list l)
Definition: list.c:150
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
void * gen_find_eq(const void *item, const list seq)
Definition: list.c:422
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
#define list_undefined
Undefined list definition :-)
Definition: newgen_list.h:69
loop statement_loop(statement)
Get the loop of a statement.
Definition: statement.c:1374
bool continue_statement_p(statement)
Test if a statement is a CONTINUE, that is the FORTRAN nop, the ";" in C or the "pass" in Python....
Definition: statement.c:203
bool declaration_statement_p(statement)
Had to be optimized according to Beatrice Creusillet.
Definition: statement.c:224
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
Definition: util.c:45
#define debug_on(env)
Definition: misc-local.h:157
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_user_warning
Definition: misc-local.h:146
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define debug_off()
Definition: misc-local.h:160
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
Definition: newgen-local.h:35
void set_free(set)
Definition: set.c:332
bool set_belong_p(const set, const void *)
Definition: set.c:194
@ set_pointer
Definition: newgen_set.h:44
set set_make(set_type)
Create an empty set of any type but hash_private.
Definition: set.c:102
set set_add_element(set, const set, const void *)
Definition: set.c:152
int tag
TAG.
Definition: newgen_types.h:92
#define string_undefined
Definition: newgen_types.h:40
#define copy_string(s)
Definition: newgen_types.h:42
#define UU
Definition: newgen_types.h:98
statement ordering_to_statement(int o)
Get the statement associated to a given ordering.
Definition: ordering.c:111
#define print_effect(e)
Definition: print.c:336
void print_statement_set(FILE *, set)
statement.c
Definition: statement.c:49
void print_parallel_statement(statement)
Definition: statement.c:156
void print_statement(statement)
Print a statement on stderr.
Definition: statement.c:98
void safe_print_statement(statement)
Definition: statement.c:140
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
Definition: properties.c:783
#define statement_block_p(stat)
entity entity_empty_label(void)
Definition: entity.c:1105
void print_entities(list l)
Definition: entity.c:167
bool thread_safe_variable_p(entity v)
Definition: entity.c:2539
list load_statement_enclosing_loops(statement)
#define loop_body(x)
Definition: ri.h:1644
#define reference_variable(x)
Definition: ri.h:2326
#define instruction_loop(x)
Definition: ri.h:1520
#define entity_undefined
Definition: ri.h:2761
@ is_instruction_loop
Definition: ri.h:1471
#define statement_extensions(x)
Definition: ri.h:2464
#define instruction_call_p(x)
Definition: ri.h:1527
#define loop_locals(x)
Definition: ri.h:1650
#define statement_declarations(x)
Definition: ri.h:2460
#define statement_instruction(x)
Definition: ri.h:2458
#define statement_decls_text(x)
Definition: ri.h:2462
#define loop_range(x)
Definition: ri.h:1642
@ is_execution_parallel
Definition: ri.h:1190
@ is_execution_sequential
Definition: ri.h:1189
#define statement_undefined_p(x)
Definition: ri.h:2420
#define statement_number(x)
Definition: ri.h:2452
#define loop_index(x)
Definition: ri.h:1640
#define statement_undefined
Definition: ri.h:2419
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
bool rice_distribute_only
to know if do loop parallelization must be done
Definition: rice.h:53
#define INSERT_AT_END(bl, el, c)
a macro to insert an element at the end of a list.
Definition: rice-local.h:34
statement MakeLoopAs(statement old_loop_statement, tag seq_or_par, statement body)
This function creates a new loop whose characteristics (index, bounds, ...) are similar to those of o...
Definition: codegen.c:517
static bool variable_private_to_loop_p(list loops, entity var)
Check if a variable is private to loop nest.
Definition: codegen.c:113
entity current_module_entity
FI: I did not know this was still used...
bool contains_level_l_dependence(scc s, set region, int level)
s is a strongly connected component for which a DO loop is being produced.
Definition: codegen.c:239
static bool AK_ignore_this_vertex(set region, vertex v)
Definition: codegen.c:70
bool strongly_connected_p(scc s, int l)
this function returns true if scc s is stronly connected at level l, i.e.
Definition: codegen.c:284
set scc_region(scc s)
Definition: codegen.c:226
statement find_level_l_loop_statement(scc s, int l)
s is a strongly connected component which is analyzed at level l.
Definition: codegen.c:213
statement MakeNestOfStatementList(int l, int nbl, list *lst, list loops, list *block, list *eblock, bool task_parallelize_p)
Definition: codegen.c:350
int statement_imbrication_level(statement st)
Definition: codegen.c:345
statement IsolatedStatement(scc s, int l, bool task_parallelize_p)
If the isolated statement is a CALL and is not a CONTINUE, regenerate the nested loops around it.
Definition: codegen.c:571
statement ConnectedStatements(graph g, scc s, int l, bool task_parallelize_p)
BB: ConnectedStatements() is called when s contains more than one vertex or one vertex dependent upon...
Definition: codegen.c:614
statement CodeGenerate(statement __attribute__((unused)) stat, graph g, set region, int l, bool task_parallelize_p)
This function implements Allen & Kennedy's algorithm.
Definition: codegen.c:393
static bool AK_ignore_this_successor(vertex __attribute__((unused)) v, set region, successor su, int level)
Definition: codegen.c:82
statement MakeNestOfParallelLoops(int l, cons *loops, statement body, bool task_parallelize_p)
this function creates a nest of parallel loops around an isolated statement whose iterations may exec...
Definition: codegen.c:310
static bool AK_ignore_this_level(dg_arc_label dal, int level)
Definition: codegen.c:43
bool ignore_this_conflict(vertex v1, vertex v2, conflict c, int l)
This function checks if conflict c between vertices v1 and v2 should be ignored at level l.
Definition: codegen.c:163
int enclosing
This is an horrendous hack.
Definition: rice.c:67
void set_sccs_drivers(bool(*)(set, vertex), bool(*)(vertex, set, successor, int))
scc.c
void reset_sccs_drivers(void)
Definition: scc.c:98
void PrintScc(scc)
Definition: scc.c:346
list FindAndTopSortSccs(graph, set, int)
Definition: scc.c:317
#define level
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
s1
Definition: set.c:247
#define ifdebug(n)
Definition: sg.c:47
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59
The structure used to build lists in NewGen.
Definition: newgen_list.h:41