PIPS
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "genC.h"
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "sc.h"
#include "polyedre.h"
#include "union.h"
#include "matrice.h"
#include "matrix.h"
#include "sparse_sc.h"
#include "ri.h"
#include "constants.h"
#include "control.h"
#include "ri-util.h"
#include "misc.h"
#include "complexity_ri.h"
#include "database.h"
#include "graph.h"
#include "dg.h"
#include "paf_ri.h"
#include "parser_private.h"
#include "property.h"
#include "reduction.h"
#include "text.h"
#include "text-util.h"
#include "tiling.h"
#include "pipsdbm.h"
#include "resources.h"
#include "static_controlize.h"
#include "paf-util.h"
#include "pips.h"
#include "array_dfg.h"
#include "prgm_mapping.h"
#include "conversion.h"
#include "scheduling.h"
#include "reindexing.h"
Go to the source code of this file.
Macros | |
#define | STRING_BDT "t" |
Name : reindexing.c Package : reindexing Author : Alexis Platonoff & Antoine Cloue Date : april 1994 Historic : More... | |
#define | STRING_PLC "p" |
#define | STRING_TAU "q" |
#define | STRING_FLAG "flag" |
#define | MAKE_STATEMENT(ins) (make_statement(entity_empty_label(),STATEMENT_NUMBER_UNDEFINED,STATEMENT_ORDERING_UNDEFINED,string_undefined,ins)) |
#define | INTEGER_DEC 0 |
We define a set of constant in order to a more generic function for the insert of the declarations of the new created variables. More... | |
#define | REAL_DEC 1 |
#define | COMPLEX_DEC 2 |
#define | LOGICAL_DEC 3 |
#define | DOUBLE_DEC 4 |
#define | CHARACTER_DEC 5 |
#define | INTEGER_DECL " INTEGER" |
#define | REAL_DECL " REAL" |
#define | COMPLEX_DECL " COMPLEX" |
#define | LOGICAL_DECL " LOGICAL" |
#define | DOUBLE_DECL " DOUBLE" |
#define | CHARACTER_DECL " CHARACTER" |
#define | COLON ":" |
#define | NEWLINE "\n *" |
#define | ENDLINE "\n" |
#define | LINE_LENGHT 68 |
#define | MARGIN_LENGHT 7 |
#define | IS_MIN 0 |
#define | IS_MAX 1 |
#define | DOUBLE_PRECISION_SIZE 8 |
Typedefs | |
typedef dfg_vertex_label | vertex_label |
Local defines. More... | |
typedef dfg_arc_label | arc_label |
Functions | |
entity | get_time_ent (int st, char *typ, int count) |
================================================================== More... | |
void | build_contraction_matrices (int s, Psysteme ps, Pmatrix mH, int *c, Pmatrix *mQ, Pmatrix *mQ_inv, Pmatrix *mC, list *ln, list *lom, Pbase indx, Pbase cnst) |
======================================================================== More... | |
Psyslist | build_list_of_min (Psyslist lsys, list lnew, Psysteme ps) |
======================================================================= More... | |
list | dataflows_on_reference (list cls, reference crhs, predicate pred, list *lm) |
======================================================================= More... | |
instruction | build_local_time_test (entity t, list l) |
====================================================================== More... | |
expression | build_global_time_test_with_exp (entity tg, expression exp) |
====================================================================== More... | |
instruction | build_flag_assign (entity f, bool val) |
====================================================================== More... | |
instruction | build_flag_test (entity f, entity t) |
====================================================================== More... | |
instruction | make_init_time (entity en, expression ex) |
====================================================================== More... | |
instruction | make_increment_instruction (entity t, int i) |
===================================================================== More... | |
int | get_number_of_ins (entity e) |
====================================================================== More... | |
bool | reindexing (char *mod_name) |
====================================================================== More... | |
Variables | |
static int | tc |
Internal variables More... | |
hash_table | h_node |
hash_table | delay_table |
Name : delay.c Package : reindexing Author : Alexis Platonoff Date : March 1995 Historic : More... | |
hash_table | ht_ab |
list | lparams |
Array bounds. More... | |
#define CHARACTER_DEC 5 |
Definition at line 125 of file reindexing.c.
#define CHARACTER_DECL " CHARACTER" |
Definition at line 132 of file reindexing.c.
#define COLON ":" |
Definition at line 133 of file reindexing.c.
#define COMPLEX_DEC 2 |
Definition at line 122 of file reindexing.c.
#define COMPLEX_DECL " COMPLEX" |
Definition at line 129 of file reindexing.c.
#define DOUBLE_DEC 4 |
Definition at line 124 of file reindexing.c.
#define DOUBLE_DECL " DOUBLE" |
Definition at line 131 of file reindexing.c.
#define DOUBLE_PRECISION_SIZE 8 |
Definition at line 143 of file reindexing.c.
#define ENDLINE "\n" |
Definition at line 135 of file reindexing.c.
#define INTEGER_DEC 0 |
We define a set of constant in order to a more generic function for the insert of the declarations of the new created variables.
Definition at line 120 of file reindexing.c.
#define INTEGER_DECL " INTEGER" |
Definition at line 127 of file reindexing.c.
#define IS_MAX 1 |
Definition at line 140 of file reindexing.c.
#define IS_MIN 0 |
Definition at line 139 of file reindexing.c.
#define LINE_LENGHT 68 |
Definition at line 136 of file reindexing.c.
#define LOGICAL_DEC 3 |
Definition at line 123 of file reindexing.c.
#define LOGICAL_DECL " LOGICAL" |
Definition at line 130 of file reindexing.c.
#define MAKE_STATEMENT | ( | ins | ) | (make_statement(entity_empty_label(),STATEMENT_NUMBER_UNDEFINED,STATEMENT_ORDERING_UNDEFINED,string_undefined,ins)) |
Definition at line 102 of file reindexing.c.
#define MARGIN_LENGHT 7 |
Definition at line 137 of file reindexing.c.
#define NEWLINE "\n *" |
Definition at line 134 of file reindexing.c.
#define REAL_DEC 1 |
Definition at line 121 of file reindexing.c.
#define REAL_DECL " REAL" |
Definition at line 128 of file reindexing.c.
#define STRING_BDT "t" |
Name : reindexing.c Package : reindexing Author : Alexis Platonoff & Antoine Cloue Date : april 1994 Historic :
Documents: SOON Comments : This file contains the functions for the transformation of a program to a single assignment form. The main function is reindexing(). Ansi includes
Newgen includes
C3 includes
Pips includes
Macro functions
Definition at line 97 of file reindexing.c.
#define STRING_FLAG "flag" |
Definition at line 100 of file reindexing.c.
#define STRING_PLC "p" |
Definition at line 98 of file reindexing.c.
#define STRING_TAU "q" |
Definition at line 99 of file reindexing.c.
typedef dfg_arc_label arc_label |
Definition at line 115 of file reindexing.c.
typedef dfg_vertex_label vertex_label |
Local defines.
Definition at line 114 of file reindexing.c.
void build_contraction_matrices | ( | int | s, |
Psysteme | ps, | ||
Pmatrix | mH, | ||
int * | c, | ||
Pmatrix * | mQ, | ||
Pmatrix * | mQ_inv, | ||
Pmatrix * | mC, | ||
list * | ln, | ||
list * | lom, | ||
Pbase | indx, | ||
Pbase | cnst | ||
) |
========================================================================
void build_contraction_matrices(mH, mQ, mQ_inv, mC, l)
From the matrix of Hermite mH, build the matrix mQ containing the periods of the different schedule dimension.
AC 94/03/31
build the matrix mC
Definition at line 197 of file reindexing.c.
References ADD_ELEMENT_TO_LIST, Ssysteme::egalites, ENTITY, fprintf(), get_debug_level(), get_time_ent(), INT, MATRIX_DENOMINATOR, MATRIX_ELEM, matrix_general_inversion(), matrix_identity(), MATRIX_NB_LINES, matrix_nulle(), matrix_to_system(), my_constraints_with_sym_cst_to_matrices(), Ssysteme::nb_eq, NIL, ppcm(), sc_new(), STRING_TAU, Scontrainte::succ, value_abs, value_div, VALUE_ONE, value_product, VALUE_TO_INT, vect_substract(), Scontrainte::vecteur, and x.
Referenced by prepare_reindexing().
instruction build_flag_assign | ( | entity | f, |
bool | val | ||
) |
======================================================================
instruction build_flag_assign(f, val) :
build the instruction: flag = val.
AC 94/06/14
Definition at line 531 of file reindexing.c.
References ADD_ELEMENT_TO_LIST, ASSIGN_OPERATOR_NAME, CONS, entity_intrinsic(), EXPRESSION, f(), int_to_expression(), is_instruction_call, lexp, make_call(), make_entity_expression(), make_instruction(), and NIL.
Referenced by re_do_it().
instruction build_flag_test | ( | entity | f, |
entity | t | ||
) |
======================================================================
instruction build_flag_test(f, t)
Builds the instruction: IF flag == 1 THEN t = t + 1 ENDIF
AC 94/06/14
Definition at line 561 of file reindexing.c.
References ADD_ELEMENT_TO_LIST, CONS, entity_intrinsic(), EQUAL_OPERATOR_NAME, exp, EXPRESSION, f(), int_to_expression(), is_instruction_test, is_syntax_call, lexp, make_call(), make_empty_statement, make_entity_expression(), make_expression(), make_increment_instruction(), make_instruction(), MAKE_STATEMENT, make_syntax(), make_test(), NIL, and normalized_undefined.
Referenced by re_do_it().
expression build_global_time_test_with_exp | ( | entity | tg, |
expression | exp | ||
) |
======================================================================
expression build_global_time_test_with_exp(tg, exp)
Builds the expression: tg == exp
AC 94/06/15
Definition at line 509 of file reindexing.c.
References ADD_ELEMENT_TO_LIST, CONS, entity_intrinsic(), EQUAL_OPERATOR_NAME, exp, EXPRESSION, is_syntax_call, lexp, make_call(), make_entity_expression(), make_expression(), make_syntax(), NIL, and normalized_undefined.
Referenced by build_first_comb(), and build_third_comb().
=======================================================================
From the list of psystem "lsys", take each inequality (that is an expression of a possible lower bound), and create as many systems as necessary to raise the undetermination on the domain. This is done until the counter is equal to 0 meaning that all "t" variables have been treated.
AC 94/05/05
get the system corresponding to the current variable
there is already an unique minimum
add inequalities on the max
put the value of the min in the equality
search on the next t variable
for each possible minimum build new system
include new value of the min in the system
put the inequality on the current minimum
add inequalities on the max
put the minimum value that is the l in "t = omega*to + l"
in the equality part of the system. Problem if val != 1
get the next dimension
Definition at line 276 of file reindexing.c.
References add_sc_to_sclist(), add_sclist_to_sclist(), CAR, cons::cdr, CONS, contrainte_make(), Ssysteme::egalites, ENTITY, entity_local_name(), fprint_entity_list(), fprint_psysteme(), fprintf(), get_debug_level(), Ssysteme::inegalites, my_clean_ps(), Ssysteme::nb_ineq, NIL, sc_add_egalite_at_end(), sc_add_inegalite(), sc_append(), sc_dup(), sc_normalize(), sl_fprint(), Scontrainte::succ, value_abs, vect_add(), vect_coeff(), vect_del_var(), vect_dup(), vect_multiply(), and Scontrainte::vecteur.
Referenced by prepare_reindexing().
instruction build_local_time_test | ( | entity | t, |
list | l | ||
) |
======================================================================
instruction build_local_time_test(t, l)
Builds the insruction corresponding to: IF t_local > ub THEN t_local = -1 ENDIF
t = entity of the local time; l = list of the ub (expression);
AC 94/06/14
build the expression t-local = -1
make the test expression
Definition at line 471 of file reindexing.c.
References ADD_ELEMENT_TO_LIST, ASSIGN_OPERATOR_NAME, CAR, CONS, entity_intrinsic(), exp, EXPRESSION, GREATER_THAN_OPERATOR_NAME, int_to_expression(), is_instruction_call, is_instruction_test, is_syntax_call, lexp, make_call(), make_empty_statement, make_entity_expression(), make_expression(), make_instruction(), MAKE_STATEMENT, make_syntax(), make_test(), NIL, and normalized_undefined.
Referenced by build_third_comb().
=======================================================================
list dataflows_on_reference(cls, crhs, pred, lm)
Selects in the list of successors cls the one that correspond to the domain pred on which we are working and for the current rhs. The list lm will contain the corresponding list of statement of the choosen dataflow.
AC 94/04/06
Definition at line 398 of file reindexing.c.
References ADD_ELEMENT_TO_LIST, CAR, DATAFLOW, dataflow_governing_pred, dataflow_reference, dfg_arc_label_dataflows, entity_local_name(), fprint_psysteme(), fprintf(), get_debug_level(), INT, NIL, NO_OFL_CTRL, POP, predicate_to_system(), reference_equal_p(), reference_variable, sc_append(), sc_dup(), sc_normalize(), sc_rational_feasibility_ofl_ctrl(), SUCCESSOR, successor_arc_label, successor_vertex, and vertex_int_stmt().
Referenced by build_third_comb(), and build_third_subcomb().
======================================================================
int get_number_of_ins(e): gives back the number of the node.
AC 94/07/28
Definition at line 638 of file reindexing.c.
References BASE_NODE_NUMBER, entity_local_name(), fprintf(), free(), get_debug_level(), and malloc().
Referenced by reference_filter().
==================================================================
entity get_time_ent(typ, count)
Returns the entity that represents the global time variable "t_count" for the program. If it does not exist yet, we create it. AC 94/05/30
AP 95/04/20: entities must have in their full name the current module name instead of RE_MODULE_NAME.
full_name = strdup(concatenate(RE_MODULE_NAME, MODULE_SEP_STRING, name, NULL));
We create it, if it does not exist yet
Definition at line 156 of file reindexing.c.
References BASE_NODE_NUMBER, concatenate(), count, create_new_entity(), db_get_current_module_name(), entity_domain, entity_undefined, full_name, gen_find_tabulated(), MODULE_SEP_STRING, STAT_SYM, strdup(), STRING_BDT, and STRING_TAU.
Referenced by build_contraction_matrices(), build_first_comb(), build_third_comb(), and re_do_it().
instruction make_increment_instruction | ( | entity | t, |
int | i | ||
) |
=====================================================================
instruction make_increment_instruction(t, i): returns the instruction: t = t + i
AC 94/06/09
Definition at line 610 of file reindexing.c.
References ADD_ELEMENT_TO_LIST, ASSIGN_OPERATOR_NAME, CONS, entity_intrinsic(), EXPRESSION, int_to_expression(), is_instruction_call, is_syntax_call, lexp, make_call(), make_entity_expression(), make_expression(), make_instruction(), make_syntax(), NIL, normalized_undefined, and PLUS_OPERATOR_NAME.
Referenced by build_flag_test(), build_third_comb(), and re_do_it().
instruction make_init_time | ( | entity | en, |
expression | ex | ||
) |
======================================================================
instruction make_init_time(en, ex) : build the instruction: en = ex
AC 94/06/15
Definition at line 588 of file reindexing.c.
References ADD_ELEMENT_TO_LIST, ASSIGN_OPERATOR_NAME, CONS, entity_intrinsic(), EXPRESSION, is_instruction_call, lexp, make_call(), make_entity_expression(), make_instruction(), and NIL.
Referenced by build_first_comb(), and build_third_comb().
bool reindexing | ( | char* | mod_name | ) |
======================================================================
void reindexing((char*) mod_name):
Initialize debugging functions
We get the required data: module entity, code, static_control,
dataflow graph.
mod_stat = copy_statement((statement) db_get_memory_resource(DBR_CODE, mod_name, true));
The DFG, the BDT and the PLC
First we count the number of nodes to initialize the hash tables
The temporary variables counter
Remove the old code:
And replace it by the new one:
print the values of the delay
mod_name | odule |
Definition at line 664 of file reindexing.c.
References CONS, db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, delay_table, ENDP, fprint_bdt(), fprint_delay(), fprint_dfg(), fprint_plc(), free_instruction(), get_current_module_entity(), get_current_module_statement(), get_debug_level(), get_stco_from_current_map(), graph_vertices, h_node, hash_int, hash_table_free(), hash_table_make(), ht_ab, local_name_to_top_level_entity(), lparams, make_instruction_block(), mod_stat, nb_nodes, NIL, pips_internal_error, POP, re_do_it(), reset_current_module_entity(), reset_current_module_statement(), reset_current_stco_map(), set_current_module_entity(), set_current_module_statement(), set_current_stco_map(), STATEMENT, statement_instruction, static_control_params, static_control_undefined, static_control_yes, strdup(), STS, tc, the_bdt, the_dfg, and user_log().
hash_table delay_table |
Name : delay.c Package : reindexing Author : Alexis Platonoff Date : March 1995 Historic :
Documents: SOON Comments : This file contains the functions dealing with the dealy. Ansi includes
Newgen includes
C3 includes
Pips includes
External variables
Definition at line 109 of file reindexing.c.
Referenced by build_first_comb(), calculate_delay(), fprint_delay(), make_array_bounds(), re_do_it(), reference_filter(), and reindexing().
hash_table h_node |
Definition at line 108 of file reindexing.c.
Referenced by make_array_bounds(), make_reindex(), prepare_reindexing(), re_do_it(), and reindexing().
hash_table ht_ab |
Definition at line 110 of file reindexing.c.
Referenced by make_array_bounds(), prepare_array_bounds(), and reindexing().
list lparams |
Array bounds.
Definition at line 111 of file reindexing.c.
Referenced by freia_add_image_arguments(), freia_create_helper_function(), freia_spoc_pipeline(), freia_substitute_by_helper_call(), freia_trpx_compile_one_dag(), generic_c_words_simplified_entity(), opencl_compile_mergeable_dag(), overloaded_parameters_p(), prepare_reindexing(), print_parallelizedCMF_code(), print_parallelizedCRAFT_code(), re_do_it(), reindexing(), sc_kernel_specific_agent(), and sigmac_params_decl().
|
static |
Internal variables
Global variables
Definition at line 107 of file reindexing.c.
Referenced by array_access_to_array_ranges(), constraints_sort_info(), make_tile_constraints(), recursive_filter_formal_context_according_to_actual_context(), reference_to_points_to_translations(), reindexing(), set_dimensions_of_local_variable_family(), set_dimensions_of_local_variables(), template_cell_local_mapping(), update_common_sizes(), UpdateAbstractEntity(), UpdateDerivedEntity(), and UpdateEntity().