PIPS
scalopragma.c
Go to the documentation of this file.
1 /* A simple phase that outline task with pragma for SCMP
2 
3  clement.marguet@hpc-project.com
4 */
5 #ifdef HAVE_CONFIG_H
6  #include "pips_config.h"
7 #endif
8 
9 
10 #include "genC.h"
11 #include "linear.h"
12 #include "ri.h"
13 #include "ri-util.h"
14 #include "prettyprint.h"
15 #include "misc.h"
16 #include "effects-generic.h"
17 #include "effects-simple.h"
18 #include "control.h"
19 #include "callgraph.h"
20 #include "pipsdbm.h"
21 #include "resources.h"
22 #include "accel-util.h"
23 #include "properties.h"
24 
26 
27 
28 static bool pragma_scmp_task_p(pragma p){
29  string s = pragma_to_string(p);
30  if(strstr(s,"scmp task")!=NULL)
31  return true;
32  else
33  return false;
34 }
35 
36 
37 static bool find_pragma(const statement s){
38  /* print_statement(s); */
39  pips_debug(1,"______\n");
42  FOREACH(EXTENSION, ext, l){
43  pragma pra = extension_pragma(ext);
44  if(pragma_scmp_task_p(pra)){
45  pips_debug(1,"SCMP_task\n");
47  if(statement_loop_p(s))
49 
52  return true;
53  }
54  }
55  }
56  return true;
57 }
58 
59 bool scalopragma (char* module_name) {
60 
61  // Use this module name and this environment variable to set
63  "SCALOPRAGMA_DEBUG_LEVEL");
64 
66 
68 
69  /*look for statement with SCMP pragma*/
71 
73 
74 
76 
77  /*delete statement pragma*/
79 
81  }
82 
83 
84 
85 
86 
88 
89  // We may have outline some code, so recompute the callees:
92 
94  // Put back the new statement module
96 
97  return true;
98 }
bool extensions_defined_p(extensions p)
Definition: ri.c:960
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
static statement module_statement
Definition: alias_check.c:125
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_cumulated_rw_effects(statement_effects)
void reset_cumulated_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 *)
#define gen_recurse(start, domain_number, flt, rwt)
Definition: genC.h:283
statement get_current_module_statement(void)
Get the current module statement.
Definition: static.c:208
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
Definition: genClib.c:3560
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
Definition: genClib.c:2752
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
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
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 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
bool statement_loop_p(statement)
Definition: statement.c:349
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
string pragma_to_string(pragma p)
Definition: pragma.c:69
#define statement_block_p(stat)
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
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
#define extension_pragma(x)
Definition: ri.h:1295
#define EXTENSION(x)
EXTENSION.
Definition: ri.h:1253
#define statement_extensions(x)
Definition: ri.h:2464
#define extensions_extension(x)
Definition: ri.h:1330
#define statement_undefined_p(x)
Definition: ri.h:2420
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
bool scalopragma(char *module_name)
Definition: scalopragma.c:59
static bool pragma_scmp_task_p(pragma p)
Definition: scalopragma.c:28
list statement_to_outline
A simple phase that outline task with pragma for SCMP.
Definition: scalopragma.c:25
static bool find_pragma(const statement s)
Definition: scalopragma.c:37
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Definition: statement.c:54