25 #include "pips_config.h"
33 #include "resources.h"
142 bool no_intra_loop_dep =
true;
144 if(i == (
int) loop_level +1 )
145 no_intra_loop_dep =
false;
147 if(!no_intra_loop_dep) {
168 no_intra_loop_dep =
true;
178 no_intra_loop_dep =
false;
189 return !no_intra_loop_dep;
205 "conflict skipped between %s and %s\n",
215 "conflict skipped between %s and %s\n",
236 "conflict not relevant between:\n");
271 pips_debug(3,
"non conficting statement with\n");
300 pips_debug(3,
"following statement does not have good arg type\n");
328 static void sac_sort_expressions_reductions_last(
list *l)
361 if(
ENDP(iter))
break;
375 static int compare_statements_on_distance(
const void * v0,
const void * v1)
385 sac_sort_expressions_reductions_last(&exp0);
386 sac_sort_expressions_reductions_last(&exp1);
424 static const int dinf=1000;
426 list iter0 = exp0,iter1=exp1;
439 else dist0+=dinf*dinf;
452 else dist1+=dinf*dinf;
466 return dist0>dist1? 1 : dist0 == dist1 ? 0 : -1;
475 return n0==n1 ? 0 : n0 > n1 ? 1 : -1;
482 while(!
ENDP(ordered)) {
534 hash_put(counters,a_vertex,(
void*)0);
537 for(
void *k,*v,*iter=NULL; (iter=
hash_table_scan(counters,iter,&k,&v));)
575 new_l =
gen_nconc(new_l, equivalence_list);
601 new_l =
gen_nconc(new_l, equivalence_list);
652 pips_debug(3,
"examining following statments:\n");
670 pips_debug(3,
"following statement cannot be moved\n");
680 pips_debug(3,
"following statements matches!\n");
686 for(
list iso_iter=iso_stats;!
ENDP(iso_iter);)
777 float saveSimdCost = 0;
780 pips_debug(2,
"opcode cost1 %f\n", saveSimdCost);
782 if((saveSimdCost >= 0.0))
825 return strdup(
"SAC generated temporary array");
830 asprintf(&s,
"PIPS:SAC generated %s vector(s)", g);
835 return strdup(
"PIPS:SAC generated variable");
864 .nb_enclosing_loops = 0,
882 pips_assert(
"Statement is consistent after SIMDIZER",
909 #define SWAP_ARGUMENTS(c) do { call_arguments(c)=gen_nreverse(call_arguments(c)) ; return ;} while(0)
910 #define NOSWAP_ARGUMENTS(c) return
949 #undef SWAP_ARGUMENTS
950 #undef NOSWAP_ARGUMENTS
959 bool block_created =
false;
971 }
while(!
ENDP(iter)&&!block_created);
1013 if(!
ENDP(iter2) && !
ENDP(prev2) ) {
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
bool statement_consistent_p(statement p)
void free_expression(expression p)
static graph dependence_graph
void remove_preferences(void *)
delay.c
callees compute_callees(const statement stat)
Recompute the callees of a module statement.
bool clean_up_sequences(statement s)
Recursively clean up the statement sequences by fusing them if possible and by removing useless one.
struct _newgen_struct_statement_ * statement
static list blocks
lisp of loops
#define CONFLICT(x)
CONFLICT.
#define dg_arc_label_conflicts(x)
#define cone_undefined_p(x)
#define conflict_source(x)
list region_intersection(region reg1, region reg2)
Intersection :
list effects_read_effects(list)
list load_proper_rw_effects_list(statement)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
list effects_write_effects(list)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_read_p(eff)
#define effect_scalar_p(eff) entity_scalar_p(effect_entity(eff))
struct _newgen_struct_statement_effects_ * statement_effects
const char * module_name(const char *s)
Return the module part of an entity name.
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define gen_recurse(start, domain_number, flt, rwt)
void gen_full_free_list(list l)
#define successor_vertex(x)
#define successor_arc_label(x)
struct _newgen_struct_graph_ * graph
#define vertex_successors(x)
#define SUCCESSOR(x)
SUCCESSOR.
#define graph_vertices(x)
void set_conflict_testing_properties()
conflicts.c
bool effects_may_conflict_p(effect eff1, effect eff2)
Check if two effect may conflict @description Two effects may conflict if their abstract two location...
statement make_block_statement(list)
Make a block statement from a list of statement.
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.
statement get_current_module_statement(void)
Get the current module statement.
entity set_current_module_entity(entity)
static.c
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
#define ENDP(l)
Test if a list is empty.
list gen_nreverse(list cp)
reverse a list in place
#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)
#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.
#define CDR(pcons)
Get the list less its first element.
list gen_append(list l1, const list l2)
void gen_sort_list(list l, gen_cmp_func_t compare)
Sorts a list of gen_chunks in place, to avoid allocations...
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.
sequence statement_sequence(statement)
Get the sequence of a statement sequence.
list statement_block(statement)
Get the list of block statements of a statement sequence.
bool statement_call_p(statement)
bool return_statement_p(statement)
Test if a statement is a C or Fortran "return".
void pop_generated_variable_commenter(void)
void insert_statement_no_matter_what(statement, statement, bool)
Break the IR consistency or, at the very least, do not insert new declarations at the usual place,...
void push_generated_variable_commenter(string(*)(entity))
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_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
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_update(hash_table htp, const void *key, const void *val)
update key->val in htp, that MUST be pre-existent.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
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.
list hash_get_default_empty_list(const hash_table h, const void *k)
Like hash_get() but returns an empty list instead of HASH_UNDEFINED_VALUE when a key is not found.
void * hash_table_scan(hash_table htp, void *hentryp_arg, void **pkey, void **pval)
void hash_table_clear(hash_table htp)
Clears all entries of a hash table HTP.
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
#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 HASH_MAP(k, v, code, ht)
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
#define hash_table_undefined_p(h)
#define hash_table_undefined
Value of an undefined hash_table.
#define HASH_DEFAULT_SIZE
#define hash_table_empty_p(htp)
bool set_empty_p(const set)
tell whether set s is empty.
set set_assign_list(set, const list)
assigns a list contents to a set all duplicated elements are lost
set set_intersection(set, const set, const set)
list set_to_sorted_list(const set, gen_cmp_func_t)
set set_difference(set, const set, const set)
#define SET_FOREACH(type_name, the_item, the_set)
enumerate set elements in their internal order.
bool set_belong_p(const set, const void *)
set set_make(set_type)
Create an empty set of any type but hash_private.
set set_add_element(set, const set, const void *)
void reset_simd_operator_mappings()
void set_simd_operator_mappings(void *m)
operatorid.c
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
bool sac_expression_reduction_p(expression e)
reductions.c
string reference_to_string(reference r)
list Words_Call(call obj, int precedence, bool leftmost, bool is_a_subroutine)
void print_statements(list)
string basic_to_string(basic)
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 binary_call_rhs(c)
#define statement_block_p(stat)
#define expression_scalar_p(e)
#define binary_call_lhs(c)
#define make_statement_list(stats...)
easy list constructor
bool commutative_call_p(call c)
Test if we are allowed to commute operations.
int compare_entities(const entity *pe1, const entity *pe2)
Comparison function for qsort.
bool same_entity_p(entity e1, entity e2)
predicates on entities
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
bool entity_empty_label_p(entity e)
bool expression_integer_value(expression e, intptr_t *pval)
expression reference_to_expression(reference r)
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
bool extended_expression_constant_p(expression exp)
Returns true if the value of the expression does not depend syntactically on the current store.
#define expression_domain
newgen_execution_domain_defined
struct _newgen_struct_value_ * value
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define statement_ordering(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define call_domain
newgen_callees_domain_defined
#define EXPRESSION(x)
EXPRESSION.
#define instruction_undefined
#define statement_label(x)
#define expression_undefined
#define sequence_statements(x)
#define instruction_sequence(x)
#define instruction_call_p(x)
#define expression_undefined_p(x)
#define statement_instruction(x)
#define call_arguments(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
int vertex_ordering(vertex)
simdstatement make_simd_statements(set opkinds, list statements)
list generate_simd_code(simdstatement ssi, float *simdCost)
bool expression_reference_or_field_p(expression e)
bool simd_vector_entity_p(entity e)
bool sac_aligned_entity_p(entity e)
void init_vector_to_expressions()
codegen.c
void invalidate_expressions_in_statement(statement s)
void reset_vector_to_expressions()
expression distance_between_expression(const expression exp0, const expression exp1)
computes the distance betwwen two expression
void reset_simd_treematch(void)
void set_simd_treematch(matchTree)
treematch.c
void simd_reset_finalArgType(void)
list match_statement(statement)
return a list of matching statements
bool simd_check_argType(void)
void simd_fill_finalArgType(statement)
void simd_fill_curArgType(statement)
#define opcode_vectorSize(x)
#define simdstatement_opcode(x)
#define simdstatement_undefined_p(x)
#define opcodeClass_name(x)
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
match get_statement_match_of_kind(statement s, opcodeClass kind)
simdizer.c
static void do_split_decl_block_statements(statement s)
static void simdize_simple_statements(statement s, simdizer_context *sc)
static void reset_statement_origin()
static set extract_non_conflicting_statements(statement s, list tail)
static hash_table equivalence_table
static bool conflict_is_a_real_conflict_p(conflict c, statement source, statement sink, size_t loop_level)
this code is here because levels information seems inaccurate so it checks all the possible conflict ...
static list simdize_simple_statements_pass2(list seq, float *simdCost)
bool simdizer_init(const char *module_name)
static bool sac_statement_to_expressions_gather(expression e, list *l)
#define NOSWAP_ARGUMENTS(c)
static bool incr_counter(loop l, simdizer_context *sc)
static void do_simdizer_init(call c)
static void decr_counter(loop l, simdizer_context *sc)
static void set_statement_origin(statement s)
static list get_statement_matches(statement s)
static set get_statement_matching_types(statement s)
static void free_statement_equivalence_table()
static void free_statement_matches_map()
static bool simd_simple_sequence_filter(statement s, __attribute__((unused)) simdizer_context *sc)
static int compare_statements_on_ordering(const void *v0, const void *v1)
static list order_isomorphic_statements(set s)
static int compare_statements_on_distance_to_origin(const void *ps0, const void *ps1)
statement sac_current_block
#define SWAP_ARGUMENTS(c)
static void init_statement_equivalence_table(list *l, graph dependence_graph, size_t loop_level)
static set extract_matching_statements(statement s, set stats, set *matches)
static int compare_list_from_length(const void *v0, const void *v1)
static hash_table matches
static bool successor_only_has_rr_conflict_p(vertex v, successor su, size_t loop_level)
static void init_statement_matches_map(list l)
static bool comparable_statements_on_distance_p(statement s0, statement s1)
static list order_isomorphic_statements_list(list ordered)
bool simdizer(char *mod_name)
string sac_commenter(entity e)
static void do_split_block_statements(statement s)
static list sac_statement_to_expressions(statement s)
instruction sac_real_current_instruction
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.
size_t nb_enclosing_loops
string words_to_string(cons *lw)
#define exp
Avoid some warnings from "gcc -Wshadow".