PIPS
scalopragma.c File Reference
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "misc.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "control.h"
#include "callgraph.h"
#include "pipsdbm.h"
#include "resources.h"
#include "accel-util.h"
#include "properties.h"
+ Include dependency graph for scalopragma.c:

Go to the source code of this file.

Functions

static bool pragma_scmp_task_p (pragma p)
 
static bool find_pragma (const statement s)
 
bool scalopragma (char *module_name)
 

Variables

list statement_to_outline
 A simple phase that outline task with pragma for SCMP. More...
 

Function Documentation

◆ find_pragma()

static bool find_pragma ( const statement  s)
static

print_statement(s);

Definition at line 37 of file scalopragma.c.

37  {
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 }
bool extensions_defined_p(extensions p)
Definition: ri.c:960
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
Definition: genClib.c:3560
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#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
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
#define statement_block_p(stat)
#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
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
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Definition: statement.c:54

References CONS, EXTENSION, extension_pragma, extensions_defined_p(), extensions_extension, FOREACH, gen_get_ancestor(), pips_debug, pragma_scmp_task_p(), STATEMENT, statement_block_p, statement_domain, statement_extensions, statement_loop_p(), statement_to_outline, and statement_undefined_p.

Referenced by scalopragma().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pragma_scmp_task_p()

static bool pragma_scmp_task_p ( pragma  p)
static

Definition at line 28 of file scalopragma.c.

28  {
29  string s = pragma_to_string(p);
30  if(strstr(s,"scmp task")!=NULL)
31  return true;
32  else
33  return false;
34 }
string pragma_to_string(pragma p)
Definition: pragma.c:69

References pragma_to_string().

Referenced by find_pragma().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scalopragma()

bool scalopragma ( char *  module_name)

ook for statement with SCMP pragma

elete statement pragma

Parameters
module_nameodule_name

Definition at line 59 of file scalopragma.c.

59  {
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 }
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
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
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
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#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
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
static bool find_pragma(const statement s)
Definition: scalopragma.c:37

References build_new_top_level_module_name(), compute_callees(), CONS, db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, extensions_extension, find_pragma(), FOREACH, gen_free_list(), gen_nreverse(), gen_null(), gen_recurse, get_current_module_statement(), get_string_property(), module_name(), module_statement, NIL, outliner(), PIPS_PHASE_POSTLUDE, PIPS_PHASE_PRELUDE, reset_cumulated_rw_effects(), set_cumulated_rw_effects(), STATEMENT, statement_domain, statement_extensions, and statement_to_outline.

+ Here is the call graph for this function:

Variable Documentation

◆ statement_to_outline

list statement_to_outline

A simple phase that outline task with pragma for SCMP.

scalopragma.c

cleme.nosp@m.nt.m.nosp@m.argue.nosp@m.t@hp.nosp@m.c-pro.nosp@m.ject.nosp@m..com

Definition at line 25 of file scalopragma.c.

Referenced by find_pragma(), outline(), and scalopragma().