PIPS
|
#include <stdio.h>
#include "linear.h"
#include "genC.h"
#include "misc.h"
#include "ri-util.h"
#include "text-util.h"
Go to the source code of this file.
Macros | |
#define | STATIC_CONTROLIZE_MODULE_NAME "STATCON" |
#define | NLC_PREFIX "NLC" |
#define | NSP_PREFIX "NSP" |
#define | NUB_PREFIX "NUB" |
#define | ADD_ELEMENT_TO_LIST(_list, _type, _element) (_list = gen_nconc( _list, CONS( _type, _element, NIL))) |
Functions | |
list | base_to_list (Pbase b) |
list base_to_list(Pbase v): translates a Pbase into a list of entities, in the same order. More... | |
Pbase | list_to_base (list l) |
Pbase list_to_base(list l): returns the Pbase that contains the variables of list "l", of entities, in the same order. More... | |
expression | make_max_exp (entity ent, expression exp1, expression exp2) |
================================================================ More... | |
entity | make_nlc_entity (int *Gcount_nlc) |
================================================================ More... | |
entity | make_nsp_entity () |
entity make_nsp_entity() Makes a new NSP (for New Structural Parameter) . More... | |
entity | make_nub_entity () |
================================================================ More... | |
entity | current_module (entity mod) |
================================================================ More... | |
bool | undefined_statement_list_p (list l) |
================================================================= More... | |
entity | expression_int_scalar (expression exp) |
================================================================ More... | |
entity | scalar_assign_call (call c) |
entity scalar_assign_call((call) c) Detects if the call is an assignement and if the value assigned is a scalar. More... | |
void | scalar_written_in_call (call the_call, list *ell, list *etl, list *swfl) |
scalar_written_in_call((call) the_call) Detects and puts a scalar written in an assignement call, in the global list Gscalar_written_forward if Genclosing_loops or Genclosing_tests are not empty. More... | |
Variables | |
int | Gcount_nsp |
================================================================ More... | |
int | Gcount_nub |
#define ADD_ELEMENT_TO_LIST | ( | _list, | |
_type, | |||
_element | |||
) | (_list = gen_nconc( _list, CONS( _type, _element, NIL))) |
Definition at line 263 of file misc_paf_utils.c.
#define NLC_PREFIX "NLC" |
Definition at line 40 of file misc_paf_utils.c.
#define NSP_PREFIX "NSP" |
Definition at line 41 of file misc_paf_utils.c.
#define NUB_PREFIX "NUB" |
Definition at line 42 of file misc_paf_utils.c.
#define STATIC_CONTROLIZE_MODULE_NAME "STATCON" |
Definition at line 39 of file misc_paf_utils.c.
list base_to_list(Pbase v): translates a Pbase into a list of entities, in the same order.
Most includes are centralized here.
Definition at line 47 of file misc_paf_utils.c.
References CONS, ENTITY, gen_nconc(), NIL, Svecteur::succ, and Svecteur::var.
Referenced by apply_farkas(), array_must_fully_written_by_regions_p(), build_first_comb(), build_third_comb(), clean_distributed_io_system(), clean_list_of_unk(), clean_shared_io_system(), copy_write_statement_with_cumulated_regions(), include_time_in_base(), include_trans_on_LC_in_ref(), include_trans_on_LC_in_sc(), include_trans_on_LC_in_sc2(), is_mu_stat_in_sc(), make_causal_external(), make_causal_internal(), make_dual(), make_list_of_unk(), make_primal(), matrix_to_system(), my_matrices_to_constraints_with_sym_cst(), pip_solve_min_with_big(), plc_make_distance(), put_variables_in_ordered_lists(), region_to_com_nest(), region_to_loop_nest(), remapping_variables(), replace_indices_region(), replace_indices_region_com(), valuer(), and vvs_on_polynome().
================================================================
entity current_module(entity mod): returns the current module entity, that is the entity of the module in which we are working currently. If the entity "mod" is undefined, it returns the static entity already known; Else, the static entity is updated to the entity "mod".
mod | od |
Definition at line 250 of file misc_paf_utils.c.
References current_mod, debug(), entity_module_p(), entity_undefined, and pips_assert.
entity expression_int_scalar | ( | expression | exp | ) |
================================================================
entity expression_int_scalar((expression) exp) Returns the scalar entity if this expression is a scalar.
exp | xp |
Definition at line 299 of file misc_paf_utils.c.
References debug(), entity_integer_scalar_p(), entity_local_name(), entity_undefined, exp, expression_syntax, is_syntax_reference, reference_variable, syntax_reference, and syntax_tag.
Referenced by get_sp_of_call_p(), scalar_assign_call(), and terapix_optimize_accumulator().
Pbase list_to_base(list l): returns the Pbase that contains the variables of list "l", of entities, in the same order.
Definition at line 60 of file misc_paf_utils.c.
References base_reversal(), CAR, CDR, ENTITY, NIL, VALUE_ONE, and vect_add_elem().
Referenced by adg_dataflowgraph(), analyze_quast(), base_complete(), broadcast_conditions(), broadcast_of_dataflow(), clean_list_of_unk(), completer_base(), completer_n_base(), do_array_expansion(), do_solve_hardware_constraints_on_nb_proc(), extract_lattice(), include_time_in_base(), make_dual(), make_list_of_unk(), make_primal(), mapping_on_broadcast(), partial_broadcast_coefficients(), prepare_reindexing(), rectangularization_region(), search_scc_bdt(), stmt_bdt_directions(), system_inversion_restrict(), and valuer().
expression make_max_exp | ( | entity | ent, |
expression | exp1, | ||
expression | exp2 | ||
) |
================================================================
expression make_max_exp(entity ent, expression exp1, expression exp2) computes MAX( exp1, exp2 ) if exp1 and exp2 are constant expressions. If it is not the case, it returns MAX( exp1, exp2 )
pips_debug(7, "doing MAX( %s, %s ) \n",
expression_to_string(exp1),
expression_to_string(exp2) );
ent | nt |
exp1 | xp1 |
exp2 | xp2 |
Definition at line 78 of file misc_paf_utils.c.
References expression_constant_p(), expression_to_int(), int_to_expression(), and MakeBinaryCall().
Referenced by loop_normalize_of_loop().
================================================================
entity make_nlc_entity(int *Gcount_nlc):
Returns a new entity. Its local name is "NLC#", where '#' represents the value of "Gcount_nlc". This variable counts the number of NLCs variables.
These entities have a special full name. The first part of it is the concatenation of the define constant STATIC_CONTROLIZE_MODULE_NAME and the local name of the current module.
The type ("basic") of these variables is INTEGER.
These variables are local to the current module, so they have a "storage_ram" with DYNAMIC "area".
NLC means Normalized Loop Counter.
Gcount_nlc | count_nlc |
Definition at line 117 of file misc_paf_utils.c.
References asprintf, concatenate(), current_offset_of_area(), debug(), dynamic_area, DYNAMIC_AREA_LOCAL_NAME, entity_local_name(), entity_storage, FindOrCreateEntity(), Gcount_nlc, get_current_module_entity(), is_basic_int, is_storage_ram, is_type_variable, is_value_unknown, make_basic(), make_entity, make_ram(), make_storage(), make_type(), make_value(), make_variable(), mod_ent, module_local_name(), MODULE_SEP_STRING, NIL, NLC_PREFIX, num, ram_undefined, STATIC_CONTROLIZE_MODULE_NAME, storage_ram, strdup(), UU, and UUINT.
Referenced by loop_normalize_of_loop().
entity make_nsp_entity | ( | void | ) |
entity make_nsp_entity() Makes a new NSP (for New Structural Parameter) .
Definition at line 165 of file misc_paf_utils.c.
References asprintf, concatenate(), current_offset_of_area(), debug(), dynamic_area, DYNAMIC_AREA_LOCAL_NAME, entity_local_name(), entity_storage, FindOrCreateEntity(), Gcount_nsp, get_current_module_entity(), is_basic_int, is_storage_ram, is_type_variable, is_value_unknown, make_basic(), make_entity, make_ram(), make_storage(), make_type(), make_value(), make_variable(), mod_ent, module_local_name(), MODULE_SEP_STRING, NIL, NSP_PREFIX, num, ram_undefined, STATIC_CONTROLIZE_MODULE_NAME, storage_ram, strdup(), UU, and UUINT.
Referenced by get_sp_of_call_p().
entity make_nub_entity | ( | void | ) |
================================================================
entity make_nub_entity() Makes a new NUB (for New Upper Bound) .
Definition at line 206 of file misc_paf_utils.c.
References asprintf, concatenate(), current_offset_of_area(), debug(), dynamic_area, DYNAMIC_AREA_LOCAL_NAME, entity_local_name(), entity_storage, FindOrCreateEntity(), Gcount_nub, get_current_module_entity(), is_basic_int, is_storage_ram, is_type_variable, is_value_unknown, make_basic(), make_entity, make_ram(), make_storage(), make_type(), make_value(), make_variable(), mod_ent, module_local_name(), MODULE_SEP_STRING, NIL, NUB_PREFIX, num, ram_undefined, STATIC_CONTROLIZE_MODULE_NAME, storage_ram, strdup(), UU, and UUINT.
entity scalar_assign_call((call) c) Detects if the call is an assignement and if the value assigned is a scalar.
If it is so, it returns this scalar.
Definition at line 328 of file misc_paf_utils.c.
References binary_call_lhs, call_function, debug(), ENTITY_ASSIGN_P, entity_name, entity_undefined, and expression_int_scalar().
Referenced by scalar_written_in_call(), and sp_feautrier_scalar_assign_call().
scalar_written_in_call((call) the_call) Detects and puts a scalar written in an assignement call, in the global list Gscalar_written_forward if Genclosing_loops or Genclosing_tests are not empty.
the_call | he_call |
ell | ll |
etl | tl |
swfl | wfl |
Definition at line 352 of file misc_paf_utils.c.
References ADD_ELEMENT_TO_LIST, debug(), ENTITY, entity_integer_scalar_p(), entity_undefined, NIL, and scalar_assign_call().
Referenced by loop_normalize_of_statement().
=================================================================
bool undefined_statement_list_p( (list) l ) AL 04/93 Returns true if l is made of 2 undefined or continue statement.
Newgen does not support list of undefined objects
Definition at line 272 of file misc_paf_utils.c.
References CAR, CDR, continue_statement_p(), debug(), gen_length(), NIL, STATEMENT, and statement_undefined.
Referenced by loop_normalize_of_unstructured().
int Gcount_nsp |
================================================================
Definition at line 158 of file misc_paf_utils.c.
Referenced by make_nsp_entity(), and static_controlize().
int Gcount_nub |
Definition at line 160 of file misc_paf_utils.c.
Referenced by make_nub_entity(), and static_controlize().