25 #include "pips_config.h"
56 debug(8,
"adg_fill_with_quast",
"begin\n");
58 fprintf(stderr,
"\n Input quast :\n");
60 fprintf(stderr,
"\n To fill with :\n");
73 fprintf(stderr,
"\n Output quast :\n");
76 debug(8,
"adg_fill_with_quast",
"end\n");
88 char *name = NULL, *name2 = NULL, *
num = NULL;
91 debug(9,
"adg_get_integer_entity",
"begin \n");
118 debug(9,
"adg_get_integer_entity",
"end \n");
137 debug( 9,
"adg_compact_quast",
"begin\n");
155 quast cfq = NULL, cft = NULL;
172 new_true, new_false) ),
178 new_true, new_false) ),
182 debug( 9,
"adg_compact_quast",
"end\n");
261 debug(9,
"adg_quast_leaves_equal_p",
"doing\n");
295 list ll1 = NULL, ll2 = NULL;
297 debug(9,
"adg_quast_leaf_solution_equal_p",
"doing\n");
337 debug(9,
"adg_sc_dup",
"begin\n");
338 if (!SC_UNDEFINED_P(in_ps)) {
353 if(in_ps->dimension==0) {
358 cp->dimension = in_ps->dimension;
362 debug(9,
"adg_sc_dup",
"end\n");
389 if ((in_ps != SC_UNDEFINED) && (in_ps != SC_RN)) {
390 if ((in_ps->
nb_eq == 0) && (in_ps->
nb_ineq == 0) ) *in_pps = SC_RN;
407 Pcontrainte eq1 = NULL, eq2 = NULL, ineq1 = NULL, ineq2 = NULL;
409 debug(9,
"adg_suppress_2nd_in_1st_ps",
"begin\n");
410 if ( in_ps1 == SC_RN )
RETURN(9,
"adg_suppress_2nd_in_1st_ps", ret_ps);
411 if ( in_ps2 == SC_RN )
RETURN(9,
"adg_suppress_2nd_in_1st_ps", in_ps1);
412 for (eq1 = in_ps1->egalites; eq1 != NULL; eq1 = eq1->
succ) {
414 for (eq2 = in_ps2->egalites; eq2 != NULL; eq2 = eq2->succ)
419 for (ineq1 = in_ps1->inegalites; ineq1 != NULL; ineq1 = ineq1->succ) {
421 for (ineq2 = in_ps2->inegalites; ineq2 != NULL; ineq2 = ineq2->succ)
422 {
if (
vect_equal(ineq1->vecteur, ineq2->vecteur)) {
ok=
false;
break;} }
427 debug(9,
"adg_suppress_2nd_in_1st_ps",
"end\n");
443 debug(9,
"adg_number_of_same_loops",
"begin\n");
444 for(; !
ENDP(in_l1);
POP(in_l1)) {
451 debug(9,
"adg_number_of_same_loops",
"number of same loop = %d\n",
count);
480 debug(9,
"adg_enrichir",
"begin \n");
491 int nb, dep,
count = 0;
520 debug(9,
"adg_enrichir",
"end \n");
550 debug(9,
"dfg_vertex_label_dup",
"begin \n");
557 debug(9,
"dfg_vertex_label_dup",
"end \n");
570 {
return (in_ps != SC_RN)?((in_ps->nb_eq == 0) && (in_ps->nb_ineq == 1)):
false; }
585 int dep = 0, dep2 = 0;
586 int nb = 0, nb2 = 0, max_depth = 0;
591 Psysteme delt_sc = NULL, delt_sc1 = NULL, delt_sc2 = NULL;
592 Ppath new_pa1 = NULL, new_pa2 = NULL, new_pa = NULL;
593 Pvecteur pvec = NULL, pv1 = NULL, pv2 = NULL, diff = NULL;
594 bool cut_space=
false, after2=
false, after1=
false, tt=
false;
596 debug(9,
"adg_max_of_leaves",
"begin\n");
618 RETURN(9,
"adg_max_of_leaves", *tsou);
625 RETURN(9,
"adg_max_of_leaves", *tsou);
635 if ((dep == max_depth) || (in_i == max_depth)) {
640 RETURN(9,
"adg_max_of_leaves", *tsou);
645 RETURN(9,
"adg_max_of_leaves", *tsou);
688 else if (after1 && after2) {
689 quast ts = NULL, ts2 = NULL;
718 debug(9,
"adg_max_of_leaves",
"end \n");
735 debug(9,
"adg_path_max_source",
"begin \n");
743 { *tsou = *tsou2;
RETURN(9,
"adg_path_max_source",*tsou); }
793 int dep, dep2, nb, nb2, max_depth;
812 if (dep > dep2)
RETURN(9,
"adg_path_max_source", *tsou);
815 RETURN(9,
"adg_path_max_source", *tsou2);
819 if (dep2 > dep )
RETURN(9,
"adg_path_max_source", *tsou);
822 RETURN(9,
"adg_path_max_source", *tsou2);
831 if (dep == max_depth) {
834 if (tt)
RETURN(9,
"adg_path_max_source", *tsou);
836 RETURN(9,
"adg_path_max_source", *tsou2);
839 if (!tt)
RETURN(9,
"adg_path_max_source", *tsou);
841 RETURN(9,
"adg_path_max_source", *tsou2);
853 debug(9,
"adg_path_max_source",
"end \n");
871 debug(9,
"adg_list_to_vect",
"begin \n");
875 for(; !
ENDP(in_list);
POP(in_list))
884 debug(9,
"adg_list_to_vect",
"end \n");
902 debug(9,
"adg_build_Psysteme",
"begin \n");
904 pips_internal_error(
"Error : there is no correspondance between input Psysteme and input entity list");
913 debug(9,
"adg_build_Psysteme",
"end \n");
936 bool ret_bool =
false;
940 debug(8,
"adg_path_possible_source",
"begin \n");
943 ret_psou->
pat = in_pa;
944 ret_psou->
qua = in_tsou;
975 bool tt = ( sou_nb <= qu_order );
979 if( qu_d != in_dep ) {
981 if(qu_d <= in_dep) ret_bool =
true; }
984 else ret_bool =
true;
988 if( qu_d != in_dep ) {
990 if(qu_d <= in_dep) ret_bool =
false;
991 else ret_bool =
true;
995 else ret_bool =
true;
1002 debug(8,
"adg_path_possible_source",
"end \n");
1033 debug(9,
"adg_decreasing_stat_order_sort",
"begin\n");
1034 for(; !
ENDP(in_list);
POP(in_list)) {
1049 if ((l1 ==
NIL) && (l2 ==
NIL )) {
1055 else if ((l1 ==
NIL) && (l2 !=
NIL)) {
1062 if ((order >= order2) && (l2 ==
NIL)) {
1067 else if ((order >= order2) && (l2 !=
NIL)) {
1080 debug(9,
"adg_decreasing_stat_order_sort",
"returned list length : %d \n",
1098 debug(9,
"adg_merge_entities_list",
"begin \n");
1107 debug(9,
"adg_merge_entities_list",
"end \n");
1132 debug(9,
"adg_rename_entities",
"begin \n");
1136 char *name = NULL, *name2 = NULL, *
num = NULL;
1171 fprintf(stderr,
"Old %s -> New %s\n",
1176 debug(9,
"adg_rename_entities",
"end \n");
quast_value make_quast_value(enum quast_value_utype tag, void *val)
quast make_quast(quast_value a1, list a2)
quast_value copy_quast_value(quast_value p)
QUAST_VALUE.
conditional make_conditional(predicate a1, quast a2, quast a3)
quast_leaf make_quast_leaf(list a1, leaf_label a2)
quast copy_quast(quast p)
QUAST.
dfg_vertex_label make_dfg_vertex_label(intptr_t a1, predicate a2, sccflags a3)
basic make_basic(enum basic_utype tag, void *val)
predicate make_predicate(Psysteme a1)
storage make_storage(enum storage_utype tag, void *val)
value make_value(enum value_utype tag, void *val)
variable make_variable(basic a1, list a2, list a3)
type make_type(enum type_utype tag, void *val)
int adg_number_to_ordering(int in_nb)
======================================================================
statement adg_vertex_to_statement(vertex in_ver)
======================================================================
void imprime_special_quast(FILE *fp, quast qu)
===========================================================================
list adg_merge_entities_lists(list l1, list l2)
======================================================================
bool adg_quast_equal_p(quast in_q1, quast in_q2)
======================================================================
statement adg_number_to_statement(int in_nb)
======================================================================
quast adg_path_max_source(quast *tsou, quast *tsou2, Ppath in_pa, list psl, boolean take_last)
======================================================================
quast adg_compact_quast(quast in_q)
======================================================================
Pvecteur adg_list_to_vect(list in_list, bool with_tcst)
======================================================================
void adg_fill_with_quast(quast *in_pq, quast in_q)
======================================================================
int adg_number_of_same_loops(list in_l1, list in_l2)
======================================================================
dfg_vertex_label dfg_vertex_label_dup(dfg_vertex_label in_dvl)
======================================================================
bool adg_simple_ineg_p(Psysteme in_ps)
======================================================================
int Gcount_re
Global variables.
bool adg_quast_value_equal_p(quast_value in_qv1, quast_value in_qv2)
======================================================================
void adg_sc_update_base(Psysteme *in_pps)
======================================================================
bool adg_quast_leaf_label_equal_p(quast in_q1, quast in_q2)
======================================================================
list adg_decreasing_stat_order_sort(list in_list)
======================================================================
bool adg_quast_leaf_equal_p(quast_leaf in_ql1, quast_leaf in_ql2)
======================================================================
bool adg_is_textualy_after_p(statement in_s1, statement in_s2)
======================================================================
list adg_increasing_stat_order_sort(list in_list)
======================================================================
Psysteme adg_build_Psysteme(predicate in_pred, list in_list)
======================================================================
Psysteme adg_sc_dup(Psysteme in_ps)
======================================================================
Pposs_source adg_path_possible_source(quast *in_tsou, vertex in_ver, int in_dep, Ppath in_pa, bool take_last)
======================================================================
statement_mapping Gstco_map
list adg_get_loop_indices(list ll)
======================================================================
void adg_enrichir(quast in_qu, leaf_label in_ll)
======================================================================
quast adg_max_of_leaves(quast *tsou, quast tsou2, int in_i, Ppath in_pa, bool take_last)
======================================================================
list adg_rename_entities(list le, hash_table fst)
======================================================================
Psysteme adg_suppress_2nd_in_1st_ps(Psysteme in_ps1, Psysteme in_ps2)
======================================================================
entity adg_get_integer_entity(int in_i)
======================================================================
predicate predicate_dup(predicate in_pred)
======================================================================
bool adg_quast_leaf_solution_equal_p(quast in_q1, quast in_q2)
======================================================================
#define EXPRESSION_PVECTEUR(e)
struct Sposs_source * Pposs_source
Pbase base_reversal(Pbase b_in)
Pbase base_reversal(Pbase b_in): produces a basis b_out, having the same basis vectors as b_in,...
#define contrainte_vecteur(c)
passage au champ vecteur d'une contrainte "a la Newgen"
#define CONTRAINTE_UNDEFINED
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Pcontrainte contrainte_new(void)
package contrainte - allocations et desallocations
#define sccflags_undefined
#define chunk_undefined
obsolete
entity get_current_module_entity(void)
Get the entity of the current module.
#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_concatenate(const list l1x, const list l2x)
concatenate two lists.
size_t gen_length(const list l)
#define CAR(pcons)
Get the value of the first element of a list.
void * gen_find_eq(const void *item, const list seq)
gen_chunk gen_nth(int n, const list l)
to be used as ENTITY(gen_nth(3, l))...
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.
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
bool vect_equal(Pvecteur v1, Pvecteur v2)
bool vect_equal(Pvecteur v1, Pvecteur v2): test a egalite de deux vecteurs
#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 MODULE_SEP_STRING
#define GET_STATEMENT_MAPPING(map, stat)
string concatenate(const char *,...)
Return the concatenation of the given strings.
statement ordering_to_statement(int o)
Get the statement associated to a given ordering.
int stco_common_loops_of_statements(statement_mapping, statement, statement)
AP, sep 25th 1995 : I have added a function from static_controlise/utils.c.
#define static_control_loops(x)
#define conditional_true_quast(x)
#define quast_value_undefined
struct _newgen_struct_static_control_ * static_control
#define leaf_label_statement(x)
#define dfg_vertex_label_undefined
#define conditional_undefined
@ is_quast_value_conditional
#define conditional_false_quast(x)
#define quast_newparms(x)
#define quast_leaf_solution(x)
#define dfg_vertex_label_statement(x)
#define quast_leaf_undefined
#define leaf_label_undefined
#define quast_value_conditional_p(x)
#define quast_value_quast_leaf_p(x)
#define leaf_label_depth(x)
#define quast_value_quast_leaf(x)
#define quast_leaf_leaf_label(x)
#define quast_quast_value(x)
#define dfg_vertex_label_exec_domain(x)
#define conditional_predicate(x)
#define quast_value_conditional(x)
Ppath pa_empty()
Ppath pa_empty() AL 18/11/93 Returns empty path : pa_empty = sc_empty(NULL) ^ (NIL)
bool pa_empty_p(Ppath in_pa)
pa_empty_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (1*TCST = 0) ^ (NIL)
Ppath pa_intersect_system(Ppath in_pa, Psysteme in_ps)
Ppath pa_intersect_system( (Ppath) in_pa, (Psysteme) in_ps ) Computes the intersection between in_pa ...
Ppath pa_intersect_complement(Ppath in_pa, Pcomplement in_pc)
Ppath pa_intersect_complement( (Ppath) in_pa, (Pcomplement) in_pc ) Computes the intersection between...
void sort_psysteme(Psysteme ps, Pvecteur pv)
==================================================================
Pvecteur vect_reversal(Pvecteur vect_in)
Pvecteur vect_reversal(Pvecteur vect_in); produces the reversal vector of the vect_in.
#define make_entity(n, t, s, 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 FindOrCreateEntity(const char *package, const char *local_name)
Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a functi...
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
#define statement_ordering(x)
#define EXPRESSION(x)
EXPRESSION.
#define predicate_undefined
#define statement_number(x)
#define predicate_system(x)
struct Ssysteme * Psysteme
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equ...
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
void sc_add_egalite(Psysteme p, Pcontrainte e)
void sc_add_egalite(Psysteme p, Pcontrainte e): macro ajoutant une egalite e a un systeme p; la base ...
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
void sc_add_inegalite(Psysteme p, Pcontrainte i)
void sc_add_inegalite(Psysteme p, Pcontrainte i): macro ajoutant une inegalite i a un systeme p; la b...
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
#define RETURN(x)
flex uses isatty
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
static list nesting
assumes:
struct Scontrainte * succ
Structure for return of a possible source.
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
struct cons * cdr
The pointer to the next element.
#define pa_faisabilite(pa)
#define exp
Avoid some warnings from "gcc -Wshadow".
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_UNDEFINED
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2)
Pvecteur vect_substract(Pvecteur v1, Pvecteur v2): allocation d'un vecteur v dont la valeur est la di...
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...