25 #include "pips_config.h"
64 #define MEM_TO_TMP_SIZE 100
193 fprintf(stderr,
"statement without db blocks \n");
230 pips_user_warning(
"this transformation is being obsoleted by SIMD_ATOMIZER\nIt is no longer maintained and is likely to crash soon\n");
235 user_log(
"\n\n *** ATOMIZER for %s\n", mod_name);
292 user_log(
"\n\n *** ATOMIZER done\n");
334 debug(1,
"atomizer_of_unstructured",
"begin UNSTRUCTURED\n");
341 cons *_cm_list = blocs ;
342 if( _cm_list ==
NIL )
359 debug(1,
"atomizer_of_unstructured",
"end UNSTRUCTURED\n");
386 bool stmt_with_remote_control_block =
false;
389 debug(2,
"atomizer_of_statement",
"begin STATEMENT\n");
394 if(cb == (
Block *) NULL)
400 stmt_with_remote_control_block =
true;
409 if (cb == (
Block *) NULL)
410 user_error(
"atomizer_of_statement",
"Block malloc: no memory left");
436 if(stmt_with_remote_control_block)
444 if (cb != (
Block *) NULL)
451 debug(2,
"atomizer_of_statement",
"end STATEMENT\n");
478 debug(2,
"atomizer_of_block",
"begin BLOCK\n");
481 user_error(
"atomizer_of_block",
"Instruction is not a block");
489 if (cb == (
Block *) NULL)
490 user_error(
"atomizer_of_block",
"Block malloc: no memory left");
519 debug(2,
"atomizer_of_block",
"end BLOCK\n");
549 debug(2,
"atomizer_of_test",
"begin TEST\n");
563 debug(3,
"atomizer_of_test",
"CONDITION: %s\n",
577 debug(2,
"atomizer_of_test",
"begin TEST IF\n");
581 debug(2,
"atomizer_of_test",
"begin TEST ELSE\n");
585 debug(2,
"atomizer_of_test",
"end TEST\n");
612 debug(2,
"atomizer_of_loop",
"begin LOOP: %s\n",
620 for(lce = cumu_effs; lce !=
NIL; lce =
CDR(lce))
644 debug(2,
"atomizer_of_loop",
"end LOOP\n");
769 for(; args !=
NIL; args =
CDR(args))
817 for (newl =
NIL; expl !=
NIL; expl =
CDR(expl))
856 bool IS_NLC_LINEAR =
false;
865 IS_NLC_LINEAR =
true;
873 if ( (mem_var ==
MEM_VAR) || IS_NLC_LINEAR )
899 if( ! IS_NLC_LINEAR )
911 debug(6,
"atomizer_of_expression",
" Expression RANGE\n");
void user_log(const char *format,...)
static reference ref
Current stmt (an integer)
#define MEM_TO_TMP_SIZE
– atomizer.c
void atomizer_of_block(instruction i)
===========================================================================
void atomizer_of_external(call c, Block *cb)
===========================================================================
void atomizer_of_call(call c, Block *cb)
===========================================================================
void atomizer_of_test(test t, Block *cb)
===========================================================================
static void reset_global_variables()
void normalize_wp65_code(statement stat)
static void initialize_global_variables(char *mod_name)
===========================================================================
list l_inst
FI: the following global variables are not declared STATIC because they also are used in codegen....
list atomizer_of_expressions(list expl, Block *cb)
===========================================================================
static bool indirection_test(reference ref, expression expr)
hash_table MemToTmp
These lists memorize all the new created entities of each type.
void atomizer_of_loop(loop l, Block *cb)
===========================================================================
void atomizer_of_statement(statement stmt, Block *cb)
===========================================================================
void atomizer_of_array_indices(expression exp, Block *cb)
===========================================================================
void atomizer_of_unstructured(u)
===========================================================================
#define MEM_VAR
Useful for atomizer_of_expression().
static entity build_new_variable(entity module, basic b)
void atomizer_of_intrinsic(call c, Block *cb)
===========================================================================
static graph mod_dg
Dependence graph of the current module.
static void rm_db_block(statement stat)
static statement rm_block_block_statement(statement stat)
bool atomizer(const string mod_name)
===========================================================================
expression atomizer_of_expression(expression exp, Block *cb, int mem_var)
===========================================================================
expression assign_tmp_to_exp(expression, Block *)
===========================================================================
bool defs_elim_of_statement(statement, graph)
===========================================================================
void put_stmt_in_Block(statement, Block *)
codegen.c
void atom_get_blocs(control, cons **)
void normal_expression_of_statement(statement)
===========================================================================
control find_control_block(control)
===========================================================================
bool nlc_linear_expression_p(expression)
===========================================================================
struct _newgen_struct_statement_ * statement
void set_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
list load_rw_effects_list(statement)
void reset_cumulated_rw_effects(void)
void reset_rw_effects(void)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
void atomize_as_required(statement, bool(*)(reference, expression), bool(*)(call, expression), bool(*)(test, expression), bool(*)(range, expression), bool(*)(whileloop, expression), entity(*)(entity, basic))
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define call_constant_p(C)
#define gen_recurse(start, domain_number, flt, rwt)
struct _newgen_struct_graph_ * graph
statement make_block_with_stmt_if_not_already(statement)
Build a statement block from a statement if not already a statement block.
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
entity set_current_module_entity(entity)
static.c
bool gen_false2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
#define CDR(pcons)
Get the list less its first element.
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
#define list_undefined
Undefined list definition :-)
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
statement make_assign_statement(expression, expression)
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_del(hash_table htp, const void *key)
this function removes from the hash table pointed to by htp the couple whose key is equal to key.
void hash_table_clear(hash_table htp)
Clears all entries of a hash table HTP.
static statement mod_stat
We want to keep track of the current statement inside the recurse.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
#define user_error(fn,...)
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define hash_table_undefined
Value of an undefined hash_table.
void normalize_all_expressions_of(void *obj)
string expression_to_string(expression e)
void print_statement(statement)
Print a statement on stderr.
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define instruction_block_p(i)
#define ENTITY_ASSIGN_P(e)
#define NORMALIZE_EXPRESSION(e)
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define is_instruction_block
soft block->sequence transition
list integer_entities
Make a new variable entity which name is one letter prefix + one incrementing number.
#define instruction_block(i)
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...
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
expression make_entity_expression(entity e, cons *inds)
bool expression_intrinsic_operation_p(expression exp)
bool expression_intrinsic_operation_p(expression exp): Returns true if "exp" is an expression with a ...
basic basic_of_expression(expression)
basic basic_of_expression(expression exp): Makes a basic of the same basic as the expression "exp".
entity make_new_entity(basic, int)
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
entity make_new_module_variable(entity, int)
Make a new module integer variable of name X<d>.
void AddEntityToDeclarations(entity, entity)
END_EOLE.
void discard_module_declaration_text(entity)
Discard the decls_text string of the module code to make the prettyprinter ignoring the textual decla...
#define control_undefined
#define syntax_reference(x)
#define normalized_linear_p(x)
#define reference_variable(x)
#define value_intrinsic_p(x)
#define instruction_loop(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define CONTROL(x)
CONTROL.
#define range_increment(x)
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
@ is_instruction_unstructured
#define instruction_tag(x)
#define reference_indices(x)
#define test_condition(x)
#define statement_instruction(x)
#define instruction_call(x)
#define call_arguments(x)
#define control_statement(x)
#define instruction_test(x)
#define expression_syntax(x)
#define instruction_unstructured(x)
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
During the computation, the program has to deal with blocks of statements.
The structure used to build lists in NewGen.
#define exp
Avoid some warnings from "gcc -Wshadow".