PIPS
manage_pragma.c
Go to the documentation of this file.
1 /*
2  Copyright 1989-2016 MINES ParisTech
3 
4  This file is part of PIPS.
5 
6  PIPS is free software: you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  any later version.
10 
11  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
12  WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE.
14 
15  See the GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
19 
20  Pierre.Villalon@hpc-project.com
21  Copyright HPC Project
22  */
23 
24 /**
25  * @file manage_pragma.c
26  * @brief This file holds transformations on OpenMP pragmas
27  * store in the RI as extension expression.
28  * Here is the list of transformations:
29  * 1- add an OpenMP if clause
30  * 2- Merge nested OpenMP clause
31  */
32 
33 #ifdef HAVE_CONFIG_H
34 #include "pips_config.h"
35 #endif
36 
37 #include "genC.h"
38 #include "linear.h"
39 
40 #include "misc.h"
41 #include "pipsdbm.h"
42 #include "properties.h"
43 
44 #include "ri.h"
45 #include "ri-util.h"
46 #include "text-util.h"
47 #include "pipsdbm.h"
48 #include "prettyprint.h"
49 
50 #include "control.h" // PIPS_PHASE_POSTLUDE
51 
53  bool found = false;
55  pragma p = extension_pragma(ex);
56  if(pragma_string_p(p)) {
57  string ps = pragma_string(p);
58  if((found = (strstr(ps, "omp parallel") || strstr(ps, "OMP PARALLEL"))))
59  goto found;
60  } else if(pragma_expression_p(p)) {
62  {
63  if(expression_call_p(pe)) {
64  call c = expression_call(pe);
65  if((found = (same_entity_p(call_function(c),
67  goto found;
68  }
69  }
70  }
71  }
72  found: return found;
73 }
74 
75 /**
76  * Check that a pragma is an "omp" one
77  */
79  bool pragma_omp = false;
80  if(pragma_expression_p(p)) {
81  list expr = pragma_expression(p);
82  // The list is reversed !
83  expression begin = EXPRESSION(CAR(gen_last(expr)));
84  if(expression_call_p(begin)) {
85  entity called = call_function(expression_call(begin));
87  pragma_omp = true;
88  }
89  }
90  } else if(pragma_string_p(p)) {
91  if(strncasecmp("omp", pragma_string(p), 3) == 0) {
92  pragma_omp = true;
93  }
94  } else {
95  pips_internal_error("We don't know how to handle this kind of pragma !\n");
96  }
97  return pragma_omp;
98 }
99 
100 /**
101  * Callback for gen_recurse that build a list of OpenMP pragma to be merged.
102  * Also remove them from the list they currently belongs to.
103  * It'll ignore string pragma (at that time, all that aren't generated by PIPS).
104  * A pragma that begin with "omp" in the original code will lead to a warning
105  * It'll ignore all pragma that are not begining with "omp".
106  */
107 
108 static void build_omp_pragma_list(extensions exts, list *l_pragma) {
109  list tmp = NIL;
110  list l_exts = extensions_extension (exts);
111  FOREACH(EXTENSION, ext, l_exts) {
112  // today extension is only pragma but can be something else in the future
113  // a test will have to be done
114  // if (extension_is_pragma_p ())
115  pragma p = extension_pragma (ext);
116  if(pragma_omp_p(p)) {
117  if(!pragma_expression_p(p)) {
118  pips_user_warning("We have an omp string pragma, we don't know yet to "
119  "parse it and thus it'll be ignored.\n");
120  } else {
121  // We record it so that we'll remove it from current stmt list later
122  tmp = gen_extension_cons(ext, tmp);
123  // Record in global list
124  *l_pragma = gen_pragma_cons(p, *l_pragma);
125  pips_debug(5, "adding pragma : %s for merging\n", pragma_to_string (p));
126  }
127  } else {
128  pips_debug(5,
129  "Ignore pragma : %s, it's not an openmp one !\n",
130  pragma_to_string (p));
131  }
132  }
133  // remove the extensions that will be merger at outer level
134  gen_list_and_not(&l_exts, tmp);
135  // update the extensions field
136  extensions_extension (exts) = l_exts;
137 }
138 
139 //@brief we need to go through all the extensions and reset
140 //the flag to true
141 static bool inner_filter(loop l, bool *inner_flag) {
142  pips_debug(5, "processing loop : %p.\n", (void*) l);
143  *inner_flag = true;
144  return true;
145 }
146 
147 //@brief keep the inner pragma and remove the others. This is the bottum up part
148 //of the gen_recuse to merge pragma at the inner level
149 static void inner_rewrite(loop l, bool *inner_flag) {
152  list l_exts = extensions_extension (exts);
153  list tmp = NIL;
154 
155  FOREACH(EXTENSION, ext, l_exts) {
156  // today extension is only pragma but can be something else in the future
157  // a test will have to be done
158  // if (extension_is_pragma_p ())
159  if(*inner_flag == true) {
160  // this is the inner pragma we have to keep it so set the flag to false
161  // to remove next extensions and exit
162  pips_debug(5,
163  "keeping pragma : %s from extensions %p.\n",
164  pragma_to_string (extension_pragma (ext)), (void*) exts);
165  *inner_flag = false;
166  return;
167  } else {
168  // we need to remove that extension because it is not an inner one
169  tmp = gen_extension_cons(ext, tmp);
170  pips_debug(5,
171  "removing pragma : %s from extensions %p.\n",
172  pragma_to_string (extension_pragma (ext)), (void*) exts);
173  }
174  //}
175  }
176  gen_list_and_not(&l_exts, tmp);
177  // update the extensions field
178  extensions_extension (exts) = l_exts;
179  return;
180 }
181 
182 // keep track of outer loop with pragma and return false
183 static bool build_outer(loop l, list *l_outer) {
186 
187  FOREACH(EXTENSION, ext, l_exts) {
188  // today extension is only pragma but can be something else in the future
189  // a test will have to be done
190  // if (extension_is_pragma_p ())
191  pragma pr = extension_pragma (ext);
192  pips_debug(5, "processing pragma : %s\n", pragma_to_string (pr));
193  // only the pragma as expressions are managed
194  if(pragma_expression_p (pr) == true) {
195  *l_outer = gen_statement_cons(stmt, *l_outer);
196  pips_debug(5, "outer pragma as expression found\n");
197  return false;
198  }
199  }
200  return true;
201 }
202 
203 /// @brief merge the omp pragma on the most outer parallel loop
204 /// @return void
205 static void merge_on_outer(list l_outer) {
206 
207  // FI: untested code
208  //entity m = module_name_to_entity(db_get_current_module_name());
209  //language l = module_language(m);
211 
212  FOREACH(STATEMENT, stmt, l_outer) {
213  // The list of pragma to be merged
214  list l_pragma = NIL;
215  list outer_extensions =
217  // collect the pragma and detach them from their statement
218  gen_context_recurse(stmt, &l_pragma,
220  list l_expr = pragma_omp_merge_expr(outer_extensions, l_pragma, l);
221  gen_free_list(outer_extensions);
222 
223  // We have to removed locally declared variables from the pragma clause,
224  // else generated code won't compile !
225  list locally_decls = statement_to_declarations(stmt);
226  ifdebug(4) {
227  pips_debug(4, "Filter out local variables from pragma : ");
228  print_entities(locally_decls);
229  fprintf(stderr, "\n");
230  }
231  l_expr = filter_variables_in_pragma_expr(l_expr, locally_decls);
232  gen_free_list(locally_decls);
233 
234  // The pragma can now be added to the statement
236  gen_free_list(l_pragma);
237  }
238  return;
239 }
240 
241 static void build_iteration_list(range r, list *l_iters) {
243  *l_iters = gen_expression_cons(iter, *l_iters);
244 }
245 
246 /// @brief add a if condition to the omp pragma
247 /// @return void
248 /// @param pr, the pragma to process
250 
251  // FI: untested code
252  //entity m = module_name_to_entity(db_get_current_module_name());
253  //language pl = module_language(m);
255 
256  // only the pragma as expressions are managed
257  if(pragma_expression_p (pr) == true) {
258  // we need to get the loop index
261  if(instruction_loop_p(inst)) {
262  // The list of number of iteration (as expression) to be used in the if clause
263  list l_iters = NIL;
264  loop l = instruction_loop (inst);
265  // evaluate the number of iteration according to the property value
266  if(get_bool_property("OMP_IF_CLAUSE_RECURSIVE") == true) {
267  // collect the number of iteration of current loop and inner loops
268  gen_context_recurse(stmt, &l_iters,
270  } else {
271  // get the number of iteration of the current loop only
273  l_iters = gen_expression_cons(iter, l_iters);
274  }
275  // now we have a list of number of iteration we need to multiply them
277  expression cond = expressions_to_operation(l_iters, mul);
278  // compare the nb iteration to the threshold
279  cond = pragma_build_if_condition(cond, pl);
280  // encapsulate the condition into the if clause
281  expression expr_if = pragma_if_as_expr(cond);
282  // bind the clause to the pragma
283  add_expr_to_pragma_expr_list(pr, expr_if);
284  // free list
285  gen_free_list(l_iters);
286  }
287  }
288  return;
289 }
290 
291 //////////////////////////////////////////////////////////////
292 // the phase function name
293 
294 /**
295  merge the pragma on the outer loop
296  **/
297 bool omp_merge_pragma(const char* module_name) {
298  // Use this module name and this environment variable to set
300  "OPMIFY_CODE_DEBUG_LEVEL");
301 
302  /* // generate pragma string or expression using the correct language: */
304  if(value_code_p(mv)) {
305  code c = value_code(mv);
307  } else {
308  /* Should never arise */
310  }
311 
312  // getting the properties to configure the phase
313  const char* merge_policy = get_string_property("OMP_MERGE_POLICY");
314  bool outer = (strcmp(merge_policy, "outer") == 0);
315 
316  // The list of outer loop as a list of statements
317  list l_outer = NIL;
318 
319  // build the list of outer loop with pragma this is also needed by the
320  // inner mode
321  gen_context_recurse(mod_stmt, &l_outer,
323 
324  if(outer == true) {
325  pips_debug(3, "outer mode\n");
326  // merge the pragma on the outer loop
327  merge_on_outer(l_outer);
328  } else { //inner
329  pips_debug(3, "inner mode\n");
330  // The inner flag
331  bool inner_flag = true;
332  FOREACH(statement, stmt, l_outer)
333  {
335  &inner_flag,
336  loop_domain,
337  inner_filter,
338  inner_rewrite);
339  }
340  }
341 
342  // freeing memory
343  gen_free_list(l_outer);
344 
345  //Put back the new statement module
346  PIPS_PHASE_POSTLUDE(mod_stmt);
347 
348  return true;
349 }
350 
352  debug_on("OPMIFY_CODE_DEBUG_LEVEL");
353  statement mod_stmt = statement_undefined;
354  // Get the code and tell PIPS_DBM we do want to modify it
355  mod_stmt = (statement) db_get_memory_resource(DBR_CODE, module_name, true);
356 
357  // Set the current module entity and the current module statement that are
358  // required to have many things working in PIPS
361 
362  // generate pragma string or expression using the correct language:
364  if(value_code_p(mv)) {
365  code c = value_code(mv);
367  } else {
368  /* Should never arise */
370  }
371 
372  // Add the parallel threshold to all the omp for pragmas
374 
375  /* Put the new CODE ressource into PIPS: */
376  DB_PUT_MEMORY_RESOURCE(DBR_CODE, module_name, mod_stmt);
377  // There is no longer a current module:
380 
381  pips_debug(2, "done for %s\n", module_name);
382  debug_off();
383 
384  return true;
385 }
386 
387 /* Remove all pragma attached to a given statement */
390  list keep_exs = NIL;
391  FOREACH(EXTENSION, ex, exs) {
392  if(!extension_pragma_p(ex))
393  keep_exs = CONS(EXTENSION,ex,keep_exs);
394  }
396  gen_free_list(exs);
397 }
398 
399 /** Clear all pragma
400  * This should be done on any input with unhandled pragma, we don't what
401  * semantic we might break...
402  */
403 bool clear_pragma(const char* module_name) {
404  debug_on("CLEAR_PRAGMA_DEBUG_LEVEL");
405  statement mod_stmt = statement_undefined;
406  // Get the code and tell PIPS_DBM we do want to modify it
407  mod_stmt = (statement) db_get_memory_resource(DBR_CODE, module_name, true);
408 
409  // Set the current module entity and the current module statement that are
410  // required to have many things working in PIPS
413 
414  // Add the parallel threshold to all the omp for pragmas
416 
417  /* Put the new CODE ressource into PIPS: */
418  DB_PUT_MEMORY_RESOURCE(DBR_CODE, module_name, mod_stmt);
419 
420  // There is no longer a current module:
423 
424  pips_debug(2, "done for %s\n", module_name);
425  debug_off();
426 
427  return true;
428 }
429 
430 /*********
431  * Outline a sequence of statement between two sentinels pragmas
432  *
433  */
434 #include "accel-util.h" // outliner()
435 #include "callgraph.h" // compute_callees()
436 #include "effects-generic.h" // used...
437 
438 // Litteral programming is good for you :)
439 #define statement_has_this_pragma_string_p(stmt,str) \
440  (get_extension_from_statement_with_pragma(stmt,str)!=NULL)
441 
442 typedef struct {
443  string pragma_begin;
444  string pragma_end;
445  string prefix;
447 } context;
448 
449 /*
450  * compute iteratively SCoPs to outline --> lists_to_outline and then
451  * call the outliner
452  * Also what is called by pragma_outliner()
453  */
455  // Cast of the void pointer
456  context *ctx = (context *) _ctx;
457  // Are we in a SCoP of the code ?
458  bool in_scop = false;
459  // A list of the statements contained in the sequence
460  list stmts = sequence_statements(s);
461  list stmts_to_outline = NIL;
462 
463  FOREACH(statement, stmt, stmts) {
464  // Flag that check if we are at the end of a list of stmts to outline
465  bool has_to_outline_p = false;
466  // If we are not already in a SCoP of the code and if the statement is preceded
467  // by pragma_start
468  // Else if we are already in a SCoP of the code and if the statement is followed
469  //by pragma_end
471  in_scop = true;
473  } else if(in_scop
475  in_scop = false;
476  has_to_outline_p = true;
478  }
479  // If we are in a SCoP : create an one-element statement list (cons) containing stmt
480  if(in_scop) {
481  stmts_to_outline = CONS(STATEMENT, stmt, stmts_to_outline );
482  }
483  // ENDP : true if list is empty, false if is a cons
484  if(has_to_outline_p && !ENDP(stmts_to_outline)) {
485  // Reverse the order of the list
486  stmts_to_outline = gen_nreverse(stmts_to_outline);
487  string func_name = build_new_top_level_module_name(ctx->prefix, false);
488  // Here we call the outliner on the collected statements
489  outliner(func_name, stmts_to_outline);
490  // Free the list of statement so that we can continue to build one
491  gen_free_list(stmts_to_outline);
492  stmts_to_outline = NIL;
493 
494  // Mark that a substitution have been done
495  ctx->outline_done = true;
496  }
497  }
498  if(in_scop) {
499  pips_user_warning("End of a sequence with a sentinel starting SCoP pragma "
500  "(%s) but did not encountered any pragma end (%s)\n",
501  ctx->pragma_begin, ctx->pragma_end);
502  }
503  return true;
504 }
505 
506 /*
507  * This phase outline a sequence of statements contained between two
508  * pragmas
509  */
510 #include "semantics.h"
511 #include "effects-convex.h"
513  // Standard procedure for phases
515 
517  module_name,
518  true));
519  statement module_stat = get_current_module_statement();
520 
521  // Needed for outliner !
523  module_name,
524  true));
526  module_name,
527  true));
528  // Needed for outliner using option OUTLINE_SMART_REFERENCE_COMPUTATION TRUE
530  // Needed for induction variable removal
534 
536 
537  // Recursion context
538  // Getting the parameters of the pragmas in order to be able to parse them later
539  context ctx;
540  ctx.pragma_begin = (string) get_string_property("PRAGMA_OUTLINER_BEGIN");
541  ctx.pragma_end = (string) get_string_property("PRAGMA_OUTLINER_END");
542  ctx.prefix = (string) get_string_property("PRAGMA_OUTLINER_PREFIX");
543  ctx.outline_done = false;
544  // Recurse over sequence
545  gen_context_recurse(module_stat, &ctx,
547  // If a substitution has been done correctly, we put the new resources
548  if(ctx.outline_done) {
549  DB_PUT_MEMORY_RESOURCE(DBR_CALLEES,
550  module_name,
551  compute_callees(module_stat));
552 
553  DB_PUT_MEMORY_RESOURCE(DBR_CODE, module_name, module_stat);
554  }
555  // Standard procedure for reseting after a phase
565  return true;
566 }
list gen_expression_cons(expression p, list l)
Definition: ri.c:866
list gen_pragma_cons(pragma p, list l)
Definition: ri.c:1745
list gen_extension_cons(extension p, list l)
Definition: ri.c:908
list gen_statement_cons(statement p, list l)
Definition: ri.c:2202
statement outliner(const char *, list)
outline the statements in statements_to_outline into a module named outline_module_name the outlined ...
Definition: outlining.c:1327
callees compute_callees(const statement stat)
Recompute the callees of a module statement.
Definition: callgraph.c:355
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
void set_methods_for_convex_effects(void)
methods.c
Definition: methods.c:235
void set_rw_effects(statement_effects)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void generic_effects_reset_all_methods(void)
void reset_cumulated_rw_effects(void)
void reset_rw_effects(void)
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
char * get_string_property(const char *)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
Definition: genC.h:285
#define gen_recurse(start, domain_number, flt, rwt)
Definition: genC.h:283
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
statement get_current_module_statement(void)
Get the current module statement.
Definition: static.c:208
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
Definition: genClib.c:3560
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
Definition: genClib.c:2758
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
Definition: genClib.c:2785
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
Definition: genClib.c:2780
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
#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
void gen_list_and_not(list *a, const list b)
Compute A = A inter non B:
Definition: list.c:963
#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
list gen_last(list l)
Return the last element of a list.
Definition: list.c:578
#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 PIPS_PHASE_POSTLUDE(new_module_statement)
End a transformation phase by putting back into PIPS the (possibly) modified statement.
#define PIPS_PHASE_PRELUDE(module_name, debug_env_var)
Start a phase that use a module CODE.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
list statement_to_declarations(void *)
Get a list of all variables declared recursively within a statement.
Definition: statement.c:3253
void set_prettyprint_language_from_property(enum language_utype native)
set the prettyprint language according to the property PRETTYPRINT_LANGUAGE @description If the prope...
Definition: language.c:103
language get_prettyprint_language()
please avoid using this function directly, use predicate instead (see below)
Definition: language.c:57
static void inner_rewrite(loop l, bool *inner_flag)
static void build_omp_pragma_list(extensions exts, list *l_pragma)
Callback for gen_recurse that build a list of OpenMP pragma to be merged.
bool omp_merge_pragma(const char *module_name)
merge the pragma on the outer loop
static void merge_on_outer(list l_outer)
merge the omp pragma on the most outer parallel loop
bool outline_stmts_between_pragmas_in_sequence(sequence s, void *_ctx)
bool statement_has_omp_parallel_directive_p(statement s)
manage_pragma.c
Definition: manage_pragma.c:52
bool pragma_outliner(char *module_name)
bool clear_pragma(const char *module_name)
Clear all pragma This should be done on any input with unhandled pragma, we don't what semantic we mi...
static void build_iteration_list(range r, list *l_iters)
void clear_pragma_on_statement(statement s)
Remove all pragma attached to a given statement.
static void add_loop_parallel_threshold(pragma pr)
add a if condition to the omp pragma
static bool inner_filter(loop l, bool *inner_flag)
static bool build_outer(loop l, list *l_outer)
bool pragma_omp_p(pragma p)
Check that a pragma is an "omp" one.
Definition: manage_pragma.c:78
#define statement_has_this_pragma_string_p(stmt, str)
bool omp_loop_parallel_threshold_set(const char *module_name)
#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_internal_error
Definition: misc-local.h:149
#define debug_off()
Definition: misc-local.h:160
#define same_string_p(s1, s2)
char * string
STRING.
Definition: newgen_types.h:39
void add_expr_to_pragma_expr_list(pragma pr, expression ex)
Add an expression to the pragma current expression list.
Definition: pragma.c:147
string pragma_to_string(pragma p)
Definition: pragma.c:69
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
Definition: properties.c:783
#define OMP_OMP_FUNCTION_NAME
@ range_to_nbiter
#define MULTIPLY_OPERATOR_NAME
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...
Definition: entity.c:453
bool same_entity_p(entity e1, entity e2)
predicates on entities
Definition: entity.c:1321
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479
void print_entities(list l)
Definition: entity.c:167
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
Definition: entity.c:1311
expression range_to_expression(range r, enum range_to_expression_mode mode)
computes the distance between the lower bound and the upper bound of the range
Definition: eval.c:963
expression expressions_to_operation(const list l_exprs, entity op)
take a list of expression and apply a binary operator between all of them and return it as an express...
Definition: expression.c:3544
bool expression_call_p(expression e)
Definition: expression.c:415
call expression_call(expression e)
Definition: expression.c:445
string build_new_top_level_module_name(const char *prefix, bool prevent_suffix)
Get a new name for a module built from a prefix.
Definition: module.c:55
list pragma_omp_merge_expr(list outer_extensions, list l_pragma, language l)
merge omp pragma.
Definition: pragma.c:326
expression pragma_if_as_expr(expression arg)
Definition: pragma.c:184
list filter_variables_in_pragma_expr(list l_expr, list to_filter)
filter out a pragma (expression list) removing all requested variables @params l_expr is the list of ...
Definition: pragma.c:256
void add_pragma_expr_to_statement(statement st, list l)
Add a pragma as a list of expression to a statement.
Definition: pragma.c:460
expression pragma_build_if_condition(expression cond, language l)
build the expression to be put in the if clause.
Definition: pragma.c:159
#define value_code_p(x)
Definition: ri.h:3065
#define pragma_expression_p(x)
Definition: ri.h:2034
#define extension_pragma_p(x)
Definition: ri.h:1293
#define instruction_loop_p(x)
Definition: ri.h:1518
#define pragma_string(x)
Definition: ri.h:2033
#define call_function(x)
Definition: ri.h:709
#define loop_domain
newgen_language_domain_defined
Definition: ri.h:218
#define pragma_domain
newgen_persistant_statement_to_statement_domain_defined
Definition: ri.h:290
#define instruction_loop(x)
Definition: ri.h:1520
#define pragma_string_p(x)
Definition: ri.h:2031
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define extension_pragma(x)
Definition: ri.h:1295
#define EXTENSION(x)
EXTENSION.
Definition: ri.h:1253
#define pragma_expression(x)
Definition: ri.h:2036
#define sequence_statements(x)
Definition: ri.h:2360
#define statement_extensions(x)
Definition: ri.h:2464
#define value_code(x)
Definition: ri.h:3067
#define statement_instruction(x)
Definition: ri.h:2458
#define loop_range(x)
Definition: ri.h:1642
#define extensions_extension(x)
Definition: ri.h:1330
#define code_language(x)
Definition: ri.h:792
#define sequence_domain
newgen_reference_domain_defined
Definition: ri.h:346
#define range_domain
newgen_ram_domain_defined
Definition: ri.h:330
#define language_tag(x)
Definition: ri.h:1590
#define extensions_domain
newgen_extension_domain_defined
Definition: ri.h:170
@ is_language_fortran
Definition: ri.h:1566
#define statement_undefined
Definition: ri.h:2419
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
#define entity_initial(x)
Definition: ri.h:2796
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,...
Definition: mappings.c:624
void set_transformer_map(statement_mapping)
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)
void reset_transformer_map(void)
#define ifdebug(n)
Definition: sg.c:47
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Definition: delay.c:253
string prefix
string pragma_end
string pragma_begin
bool outline_done
Definition: statement.c:54
void free_value_mappings(void)
Normal call to free the mappings.
Definition: value.c:1212