25 #include "pips_config.h"
65 #include "constants.h"
81 #include "resources.h"
85 #include "array_dfg.h"
86 #include "reindexing.h"
161 if ( prov_i == in )
return( ver );
269 for(; !
ENDP(l_loops);
POP(l_loops)) {
315 (void) sprintf(
num,
"%d", n);
318 SAT,
num, (
string) NULL));
321 SAI,
num, (
string) NULL));
376 fprintf(stdout,
"\t\t\t[lhs_subs_in_ins] New ref %s instead of %s\n",
484 for(l = lr; !
ENDP(l);
POP(l)) {
510 for(l = ls; !
ENDP(l);
POP(l)) {
513 for(ll = dfl; !
ENDP(ll);
POP(ll)) {
547 fprintf(stdout,
"\t\t\t[count_dataflows_on_ref] %s\n",
570 fprintf(stdout,
"\t\t\t[count_dataflows_on_ref] One more\n");
643 entity and_ent, leq_ent, equ_ent;
649 fprintf(stdout,
"\t\t\t\t\t[predicate_to_expression] Init\n");
675 fprintf(stdout,
"\t\t\t\t\t\tvec_to_exp : %s\n",
678 fprintf(stdout,
"\t\t\t\t\t\tINEG: exp2 = %s\n",
688 fprintf(stdout,
"\t\t\t\t\t\tINEG: exp1 = %s\n",
703 fprintf(stdout,
"\t\t\t\t\t\tEG: exp1 = %s, exp2 = %s\n",
710 fprintf(stdout,
"\t\t\t\t\t[predicate_to_expression] Result: %s\n",
767 for(l = bl; !
ENDP(l);
POP(l)) {lll = ll; ll = l;}
816 else if(how ==
THIRD) {
877 fprintf(fp,
"For %s = %s, %s, %s {\n",
920 if(ps == NULL)
return(
true);
967 fprintf(stdout,
"Noeuds %d :\n", cn);
982 fprintf(stdout,
"\tApres Subs LHS : \n");
1014 fprintf(stdout,
"\t\t\tDevient BLOCK : \n");
1029 fprintf(stdout,
"\t\tReference %s :\n",
1043 fprintf(stdout,
"\t\tZero dataflow :\n");
1048 else if(nb_df == 1) {
1054 fprintf(stdout,
"\t\tUn seul dataflow :\n");
1065 fprintf(stdout,
"\t\t\tFull predicate :\n");
1075 fprintf(stdout,
"\t\t\tNot full predicate :\n");
1085 fprintf(stdout,
"\t\tAu moins deux dataflows :\n");
1094 fprintf(stdout,
"\t\tArc pointe' vers %d :\n", m);
1108 fprintf(stdout,
"\t\t\tApres substitution dans RHS :\n");
1121 fprintf(stdout,
"\t\t\tPremier test :\n");
1130 fprintf(stdout,
"\t\t\tDeuxieme test :\n");
1140 fprintf(stdout,
"\t\t\tDernier test :\n");
1166 debug_on(
"SINGLE_ASSIGN_DEBUG_LEVEL");
1168 user_log(
"\n\n *** COMPUTE SINGLE_ASSIGN for %s\n", mod_name);
1208 user_log(
"\n\n *** SINGLE_ASSIGN done\n");
void user_log(const char *format,...)
successor make_successor(arc_label a1, vertex a2)
vertex make_vertex(vertex_label a1, list a2)
call make_call(entity a1, list a2)
expression make_expression(syntax a1, normalized a2)
storage make_storage(enum storage_utype tag, void *val)
value make_value(enum value_utype tag, void *val)
reference make_reference(entity a1, list a2)
test make_test(expression a1, statement a2, statement a3)
dimension make_dimension(expression a1, expression a2, list a3)
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
variable make_variable(basic a1, list a2, list a3)
instruction make_instruction(enum instruction_utype tag, void *val)
syntax make_syntax(enum syntax_utype tag, void *val)
type make_type(enum type_utype tag, void *val)
graph adg_pure_dfg(graph in_gr)
======================================================================
void fprint_dfg(FILE *fp, graph obj)
===========================================================================
static hash_table STS
The "STS" global variable is the hash table that maps the static_control on the statements.
statement adg_number_to_statement(int in_nb)
======================================================================
struct _newgen_struct_statement_ * statement
string make_entity_fullname(const char *module_name, const char *local_name)
END_EOLE.
#define successor_vertex(x)
#define successor_arc_label(x)
#define vertex_vertex_label(x)
#define vertex_successors(x)
#define SUCCESSOR(x)
SUCCESSOR.
#define graph_vertices(x)
void reset_current_module_entity(void)
Reset the current module entity.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
#define ENDP(l)
Test if a list is empty.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
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.
#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.
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.
bool assignment_statement_p(statement)
Test if a statement is an assignment.
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
static list verlist
of vertex
static statement mod_stat
We want to keep track of the current statement inside the recurse.
#define pips_internal_error
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define MODULE_SEP_STRING
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
hash_table statement_mapping
these macros are obsolete! newgen functions (->) should be used instead
string concatenate(const char *,...)
Return the concatenation of the given strings.
void * gen_find_tabulated(const char *, int)
void pu_vect_fprint(FILE *, Pvecteur)
===========================================================================
list static_control_to_indices(static_control)
package mapping : Alexis Platonoff, july 1993
void reset_current_stco_map(void)
========================================================================
static_control get_stco_from_current_map(statement)
========================================================================
void fprint_pred(FILE *, predicate)
===========================================================================
void set_current_stco_map(statement_mapping)
========================================================================
void fprint_dataflow(FILE *, int, dataflow)
===========================================================================
#define static_control_loops(x)
#define DATAFLOW(x)
DATAFLOW.
#define dataflow_transformation(x)
#define dfg_arc_label_dataflows(x)
#define static_control_yes(x)
#define static_control_undefined
#define dataflow_governing_pred(x)
#define dfg_vertex_label_statement(x)
#define dataflow_reference(x)
#define dataflow_undefined
void fprint_list_of_exp(FILE *fp, list exp_l)
void fprint_list_of_exp(FILE *fp, list exp_l): prints in the file "fp" the list of expression "exp_l"...
string reference_to_string(reference r)
string expression_to_string(expression e)
graph the_dfg
The placement function.
#define ENTITY_ASSIGN_P(e)
#define EQUAL_OPERATOR_NAME
#define make_entity(n, t, s, i)
#define STATEMENT_NUMBER_UNDEFINED
default values
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define is_instruction_block
soft block->sequence transition
#define instruction_block(i)
#define LESS_OR_EQUAL_OPERATOR_NAME
#define ASSIGN_OPERATOR_NAME
#define make_empty_statement
An alias for make_empty_block_statement.
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.
list entities_to_expressions(list l_ent)
build a list of expressions from a list of entities
entity entity_empty_label(void)
expression make_vecteur_expression(Pvecteur pv)
make expression for vector (Pvecteur)
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
bool reference_equal_p(reference r1, reference r2)
basic basic_of_reference(reference)
Retrieves the basic of a reference in a newly allocated basic object.
#define normalized_undefined
#define syntax_reference_p(x)
#define REFERENCE(x)
REFERENCE.
#define syntax_reference(x)
#define instruction_loop(x)
#define statement_ordering(x)
#define instruction_goto(x)
#define range_increment(x)
#define EXPRESSION(x)
EXPRESSION.
#define statement_label(x)
#define expression_undefined
@ is_instruction_unstructured
#define instruction_tag(x)
#define predicate_undefined
#define test_condition(x)
#define statement_instruction(x)
#define statement_comments(x)
#define instruction_call(x)
#define call_arguments(x)
#define instruction_test(x)
#define statement_number(x)
#define expression_syntax(x)
#define predicate_system(x)
#define entity_domain
newgen_syntax_domain_defined
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
struct Ssysteme * Psysteme
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
static int tc
Internal variables
void single_assign(char *mod_name)
=========================================================================
void sa_print_ins(FILE *fp, instruction i)
=========================================================================
vertex my_dfg_in_vertex_list(list l, vertex v)
=================================================================
list get_rhs_of_instruction(instruction ins)
=========================================================================
expression predicate_to_expression(predicate pred)
=========================================================================
void rhs_subs_in_ins(instruction ins, reference r1, reference r2)
=========================================================================
#define FIRST
Name : single_assign.c Package : reindexing Author : Alexis Platonoff Date : febuary 1994 Historic :
void ref_subs_in_exp(expression exp, reference r1, reference r2)
=========================================================================
list references_of_expression(expression exp)
=========================================================================
graph my_dfg_reverse_graph(graph g)
======================================================================
void lhs_subs_in_ins(instruction ins, string SA, int n, list subscripts)
=========================================================================
dfg_vertex_label vertex_label
Local defines.
list dims_of_nest(int n)
=========================================================================
void add_test(statement s, predicate cond, reference lhs, reference rhs, int how)
=========================================================================
int count_dataflows_on_ref(list ls, reference r, dataflow *df, int *m)
=========================================================================
bool full_predicate_p(predicate p)
=========================================================================
list build_successors_with_rhs(list ls, reference r)
=========================================================================
list build_associate_temp(list lr)
=========================================================================
reference build_new_ref(int kind, int n, list subscripts, reference old_r)
=========================================================================
entity create_entity(string name, variable v)
=========================================================================
void sa_do_it(graph the_dfg)
=========================================================================
list dataflows_on_ref(successor suc, reference r)
=========================================================================
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define exp
Avoid some warnings from "gcc -Wshadow".