PIPS
gen_multi_recurse_explorer.c
Go to the documentation of this file.
1 /* A simple phase to show up the path explore by gen_multi_recurse */
2 
3 #include "genC.h"
4 #include "linear.h"
5 #include "ri.h"
6 #include "ri-util.h"
7 #include "misc.h"
8 #include "control.h"
9 #include "pipsdbm.h"
10 #include "resources.h"
11 #include "prettyprint.h"
12 
13 static bool statement_filter(statement obj) {
14  pips_debug(0, "\t IN\n");
15  ifdebug(0) {
16  print_statement(obj);
17  }
18  return true;
19 }
20 
21 static void statement_rewrite(statement obj) {
22  pips_debug(0, "\t OUT\n");
23  ifdebug(2) {
24  print_statement(obj);
25  }
26 }
27 
28 static bool call_filter(__attribute__((unused)) call obj) {
29  pips_debug(0, "\t IN\n");
30  return false;
31 }
32 
33 static void call_rewrite(__attribute__((unused)) call obj) {
34  pips_debug(0, "\t OUT\n");
35 }
36 
37 static bool sequence_filter(__attribute__((unused)) sequence obj) {
38  pips_debug(0, "\t IN\n");
39  return true;
40 }
41 
42 static void sequence_rewrite(__attribute__((unused)) sequence obj) {
43  pips_debug(0, "\t OUT\n");
44 }
45 
46 static bool test_filter(__attribute__((unused)) test obj) {
47  pips_debug(0, "\t IN\n");
48  return true;
49 }
50 
51 static void test_rewrite(__attribute__((unused)) test obj) {
52  pips_debug(0, "\t OUT\n");
53 }
54 
55 static bool loop_filter(__attribute__((unused)) loop obj) {
56  pips_debug(0, "\t IN\n");
57  return true;
58 }
59 
60 static void loop_rewrite(__attribute__((unused)) loop obj) {
61  pips_debug(0, "\t OUT\n");
62 }
63 
64 static bool forloop_filter(__attribute__((unused)) forloop obj) {
65  pips_debug(0, "\t IN\n");
66  return true;
67 }
68 
69 static void forloop_rewrite(__attribute__((unused)) forloop obj) {
70  pips_debug(0, "\t OUT\n");
71 }
72 
73 static bool whileloop_filter(__attribute__((unused)) whileloop obj) {
74  pips_debug(0, "\t IN\n");
75  return true;
76 }
77 
78 static void whileloop_rewrite(__attribute__((unused)) whileloop obj) {
79  pips_debug(0, "\t OUT\n");
80 }
81 
82 static bool multitest_filter(__attribute__((unused)) multitest obj) {
83  pips_debug(0, "\t IN\n");
84  return true;
85 }
86 
87 static void multitest_rewrite(__attribute__((unused)) multitest obj) {
88  pips_debug(0, "\t OUT\n");
89 }
90 
91 static bool unstructured_filter(__attribute__((unused)) unstructured obj) {
92  pips_debug(0, "\t IN\n");
93  return true;
94 }
95 
96 static void unstructured_rewrite(__attribute__((unused)) unstructured obj) {
97  pips_debug(0, "\t OUT\n");
98 }
99 
100 //static bool expression_filter(expression obj) {
101 // pips_debug(0, "\n");
102 // return true;
103 //}
104 //
105 //static void expression_rewrite(expression obj) {
106 // pips_debug(0, "\n");
107 //}
108 
111  bool good_result_p = true;
112 
113  debug_on("GMRE_DEBUG_LEVEL");
114  pips_debug(1, "begin\n");
115 
116  //-- configure environment --//
118 
120  db_get_memory_resource(DBR_CODE, module_name, true) );
122 
123  pips_assert("Statement should be OK before...",
125 
126  //set_ordering_to_statement(module_statement);
127 
128  //-- Make the job -- //
139  , NULL
140 // , expression_domain, gen_true, gen_true
141  );
142 
143 
144  pips_assert("Statement should be OK after...",
146 
147  //-- Save modified code to database --//
149 
150  //reset_ordering_to_statement();
151 
152  pips_debug(1, "end\n");
153  debug_off();
154 
155  return (good_result_p);
156 }
157 
158 
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
bool statement_consistent_p(statement p)
Definition: ri.c:2195
static statement module_statement
Definition: alias_check.c:125
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
static void call_rewrite(__attribute__((unused)) call obj)
static bool whileloop_filter(__attribute__((unused)) whileloop obj)
static void statement_rewrite(statement obj)
static void whileloop_rewrite(__attribute__((unused)) whileloop obj)
static bool statement_filter(statement obj)
A simple phase to show up the path explore by gen_multi_recurse.
static void forloop_rewrite(__attribute__((unused)) forloop obj)
bool gen_multi_recurse_explorer(char *module_name)
static bool forloop_filter(__attribute__((unused)) forloop obj)
static bool sequence_filter(__attribute__((unused)) sequence obj)
static bool loop_filter(__attribute__((unused)) loop obj)
static void multitest_rewrite(__attribute__((unused)) multitest obj)
static void test_rewrite(__attribute__((unused)) test obj)
static bool call_filter(__attribute__((unused)) call obj)
static void sequence_rewrite(__attribute__((unused)) sequence obj)
static void unstructured_rewrite(__attribute__((unused)) unstructured obj)
static bool unstructured_filter(__attribute__((unused)) unstructured obj)
static void loop_rewrite(__attribute__((unused)) loop obj)
static bool test_filter(__attribute__((unused)) test obj)
static bool multitest_filter(__attribute__((unused)) multitest obj)
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
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
Definition: genClib.c:3428
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
#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_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define debug_off()
Definition: misc-local.h:160
void print_statement(statement)
Print a statement on stderr.
Definition: statement.c:98
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479
#define forloop_domain
newgen_extensions_domain_defined
Definition: ri.h:178
#define test_domain
newgen_entity_domain_defined
Definition: ri.h:418
#define unstructured_domain
newgen_type_domain_defined
Definition: ri.h:442
#define loop_domain
newgen_language_domain_defined
Definition: ri.h:218
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
#define call_domain
newgen_callees_domain_defined
Definition: ri.h:58
#define multitest_domain
newgen_mode_domain_defined
Definition: ri.h:234
#define whileloop_domain
newgen_variable_domain_defined
Definition: ri.h:466
#define sequence_domain
newgen_reference_domain_defined
Definition: ri.h:346
char * strdup()
#define ifdebug(n)
Definition: sg.c:47