33 #include "pips_config.h"
164 fprintf(stderr,
"statement %td in loops ",
345 pips_debug (9,
"private entites to the loop:\n");
457 if(s == prev)
return 0;
519 }
else if(lb !=
NIL && (lb->
cdr) ==
NIL) {
558 else if ( lb !=
NIL && (lb->
cdr) ==
NIL )
560 else if ( lb !=
NIL ) {
653 for(
int i = 0; i <
depth; i++) {
724 debug(8,
"loop_increment_value",
"increment is not constant");
808 fprintf(
out,
"%s: %d seq loops, %d par loops\n", msg, seq, par);
820 fprintf(stderr,
"%s %s parallelization statistics",
module, msg);
913 bool return_val =
false;
920 if (i_inc > 0 && i_up >= i_low) {
924 else if (i_inc < 0 && i_up <= i_low) {
945 bool return_val =
false;
952 if (i_inc > 0 && i_up < i_low) {
956 else if (i_inc < 0 && i_up > i_low) {
static hash_table seen
static function to store whether a module has been seen during the recursive generation of the daVinc...
clone_context make_clone_context(entity a1, entity a2, list a3, statement a4)
void free_clone_context(clone_context p)
bool instruction_consistent_p(instruction p)
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
bool statement_consistent_p(statement p)
bool range_consistent_p(range p)
instruction make_instruction(enum instruction_utype tag, void *val)
range make_range(expression a1, expression a2, expression a3)
statement clone_statement(statement s, clone_context cc)
clone_statement.c
#define region
simulation of the type region
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_recurse(start, domain_number, flt, rwt)
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
#define CONTROL_MAP(ctl, code, c, list)
Macro to walk through all the controls reachable from a given control node of an unstructured.
statement get_current_module_statement(void)
Get the current module statement.
entity get_current_module_entity(void)
Get the entity of the current module.
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
bool assignment_block_p(instruction i)
Checks if an instruction block is a list of assignments, possibly followed by a continue.
set distributable_loop(statement l)
this functions checks if Kennedy's algorithm can be applied on the loop passed as argument.
void print_number_of_loop_statistics(FILE *out, string msg, statement s)
Compute the number of parallel and sequential loops found in a statement and output them on a stream ...
set region_of_loop(statement l)
this function returns the set of all statements belonging to the given loop even if the loop contains...
bool range_contains_at_least_one_point_p(range r)
static void loop_update_statistics(loop l)
bool loop_sequential_p(loop l)
Test if a loop is sequential.
bool loop_parallel_p(loop l)
Test if a loop is parallel.
bool loop_executed_never_p(loop l)
Check if loop bound are constant and then if upper < lower.
bool parallel_loop_statement_p(statement s)
Test if a statement is a parallel loop.
static void loop_sort_locals(loop l)
bool constant_step_loop_p(loop l)
Test if a loop has a constant step loop.
bool normal_loop_p(loop l)
Test if a loop does have a 1-increment step.
entity perfectly_nested_loop_index_at_depth(statement s, int depth)
Get the index of the loop at a given depth inside a loop-nest.
static bool distributable_statement_p(statement stat, set region)
static void rloops_mapping_of_unstructured(statement_mapping m, list loops, unstructured u)
bool loop_executed_at_least_once_p(loop l)
Check if loop bound are constant and then if upper >= lower.
static void rloops_mapping_of_statement()
statement make_new_loop_statement(entity i, expression low, expression up, expression inc, statement b, execution e)
This is an ad'hoc function designed for do_loop_unroll_with_epilogue().
int loop_increment_value(loop l)
statement perfectly_nested_loop_to_body(statement loop_nest)
Extract the body of a perfectly nested loop body.
static int nseq
To store the number of sequential and parallel loops.
bool index_private_p(loop lo)
returns true if loop lo's index is private for this loop
void clean_enclosing_loops(void)
int depth_of_perfect_loop_nest(statement s)
Compute the depth of a perfect loop-nest.
statement perfectly_nested_loop_to_body_at_depth(statement s, int depth)
Extract the loop-body of a perfect loop-nest at a given depth.
list copy_loops(list ll)
Duplicate a loop list.
void region_of_statement(statement stat, set region)
Should be rewritten with a gen_recurse to deal with the recent RI...
list loop_private_variables_as_entites(loop obj, bool local, bool index)
Get the variables local or private to a loop.
void sort_all_loop_locals(statement s)
bool range_contains_nothing_p(range r)
list statement_to_loop_statement_list(statement s)
If statement s is a perfectly loop nest, return the corresponding loop list.
void print_parallelization_statistics(const char *module, const char *msg, statement s)
Print out the number of sequential versus parallel loops.
void number_of_sequential_and_parallel_loops(statement stat, int *pseq, int *ppar)
Compute the number of parallel and sequential loops found in a statement and update given variables.
bool index_of_a_loop_p(Variable v, list loops)
Check if variable v is an index for an enclosing loop.
statement get_first_inner_perfectly_nested_loop(statement stat)
Return the inner loop in a perfect loop-nest.
statement_mapping loops_mapping_of_statement(statement stat)
bool perfectly_nested_loop_p(statement stat)
Test if a statement is a perfect loop-nest.
int depth_of_parallel_perfect_loop_nest(statement s)
Compute the depth of a parallel perfect loop-nest.
#define ENDP(l)
Test if a list is empty.
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
size_t gen_length(const list l)
void gen_list_and_not(list *a, const list b)
Compute A = A inter non B:
#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 FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
void * gen_find_eq(const void *item, const list seq)
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
list gen_full_copy_list(list l)
Copy a list structure with element copy.
list statement_block(statement)
Get the list of block statements of a statement sequence.
loop statement_loop(statement)
Get the loop of a statement.
bool statement_loop_p(statement)
bool continue_statement_p(statement)
Test if a statement is a CONTINUE, that is the FORTRAN nop, the ";" in C or the "pass" in Python....
bool assignment_statement_p(statement)
Test if a statement is an assignment.
bool declaration_statement_p(statement)
Had to be optimized according to Beatrice Creusillet.
hash_table hash_table_make(hash_key_type key_type, size_t size)
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
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 SET_STATEMENT_MAPPING(map, stat, val)
#define DEFINE_CURRENT_MAPPING(name, type)
#define MAKE_STATEMENT_MAPPING()
#define STATEMENT_MAPPING_MAP(s, v, code, h)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
bool EvalNormalized(normalized n, int *pv)
#define instruction_block_p(i)
#define NORMALIZE_EXPRESSION(e)
#define statement_block_p(stat)
#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
#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...
bool same_entity_p(entity e1, entity e2)
predicates on entities
entity entity_empty_label(void)
void sort_list_of_entities(list l)
sorted in place.
void print_entities(list l)
bool extended_integer_constant_expression_p_to_int(expression e, int *result)
void free_enclosing_loops_map(void)
statement_mapping get_enclosing_loops_map(void)
#define value_undefined_p(x)
#define loop_execution(x)
#define syntax_reference(x)
#define instruction_loop_p(x)
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define instruction_loop(x)
#define value_unknown_p(x)
#define range_increment(x)
@ is_instruction_unstructured
@ is_instruction_whileloop
@ is_instruction_expression
#define instruction_tag(x)
#define execution_sequential_p(x)
#define instruction_forloop(x)
#define instruction_call_p(x)
#define instruction_whileloop(x)
#define whileloop_body(x)
#define statement_declarations(x)
#define statement_instruction(x)
#define control_statement(x)
#define instruction_test(x)
#define statement_number(x)
#define expression_syntax(x)
#define execution_parallel_p(x)
#define instruction_unstructured(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
struct cons * cdr
The pointer to the next element.
static int depth
la sequence de nids
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....