25 #include "pips_config.h"
71 #include "constants.h"
76 #include "resources.h"
214 bool is_static =
true, static_test =
false;
342 " Returning static_control : \n bool : %s \n params : %s \n loops : %zd \n tests : %zd \n ",
343 ((is_static)?
"TRUE":
"FALSE"),
361 bool is_static =
true;
385 "\n Returning static_control : \n bool : %s \n params : %s \n loops : %zd \n tests : %zd \n ",
386 ((is_static)?
"TRUE":
"FALSE"),
452 while ((pid->
name != NULL) && (!found)) {
453 if (strcmp(pid->
name, s) == 0) {
500 list formal_integers;
503 debug_on(
"STATIC_CONTROLIZE_DEBUG_LEVEL");
506 user_log(
"\n\n *** STATIC CONTROLIZE CODE for %s\n", mod_name);
577 pips_assert(
"controlized statement mod_stat is consistent",
591 user_log(
"\n\n *** STATIC CONTROLIZE CODE done\n");
624 entity index, nlc_ent, max_ent;
625 expression rl, ru, ri, nub, nlc_exp, exp_plus;
626 expression nub2, nub3, index_exp, new_index_exp;
701 hash_put(fst, (
char*) index, (
char*) new_index_exp);
773 for(head =
NIL ; tail !=
NIL; )
837 return( return_list );
860 for(lc = blocs; lc !=
NIL; lc =
CDR(lc)) {
void user_log(const char *format,...)
static_control make_static_control(bool a1, list a2, list a3, list a4)
bool static_control_consistent_p(static_control p)
expression copy_expression(expression p)
EXPRESSION.
bool statement_consistent_p(statement p)
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
synchronization make_synchronization_none(void)
list stmt_list
The "stmt_list" global variable is the list the assign statement of the program (with all fields empt...
struct _newgen_struct_statement_ * statement
string make_entity_fullname(const char *module_name, const char *local_name)
END_EOLE.
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
#define gen_recurse(start, domain_number, flt, rwt)
statement make_block_with_stmt_if_not_already(statement)
Build a statement block from a statement if not already a statement block.
void control_map_get_blocs(control c, list *l)
Build recursively the list of all controls reachable from a control of an unstructured.
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.
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
bool constant_step_loop_p(loop l)
Test if a loop has a constant step loop.
list copy_loops(list ll)
Duplicate a loop list.
list gen_nreverse(list cp)
reverse a list in place
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
#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)
#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.
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.
statement make_assign_statement(expression, expression)
bool statement_contains_user_call_p(statement)
statement make_continue_statement(entity)
void fix_sequence_statement_attributes(statement)
Since blocks are not represented in Fortran, they cannot carry a label.
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_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_warn_on_redefinition(void)
these function set the variable should_i_warn_on_redefinition to the value true or false
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.
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
static statement mod_stat
We want to keep track of the current statement inside the recurse.
void set_prettyprint_language_from_property(enum language_utype native)
set the prettyprint language according to the property PRETTYPRINT_LANGUAGE @description If the prope...
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
entity make_nlc_entity(int *Gcount_nlc)
================================================================
bool undefined_statement_list_p(list l)
=================================================================
expression make_max_exp(entity ent, expression exp1, expression exp2)
================================================================
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,...
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define SET_STATEMENT_MAPPING(map, stat, val)
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
#define MAKE_STATEMENT_MAPPING()
void * gen_find_tabulated(const char *, int)
#define static_control_yes(x)
#define static_control_undefined
list Words_Call(call obj, int precedence, bool leftmost, bool is_a_subroutine)
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define MAX_OPERATOR_NAME
#define MINUS_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define STATEMENT_NUMBER_UNDEFINED
default values
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define is_instruction_block
soft block->sequence transition
#define DIVIDE_OPERATOR_NAME
#define instruction_block(i)
#define MULTIPLY_OPERATOR_NAME
bool io_intrinsic_p(entity e)
rue is a statement s is an io intrinsic
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.
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity entity_empty_label(void)
bool fortran_module_p(entity m)
Test if a module is in Fortran.
expression make_entity_expression(entity e, cons *inds)
int expression_to_int(expression exp)
================================================================
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
extensions empty_extensions(void)
extension.c
#define value_intrinsic_p(x)
#define instruction_loop(x)
#define statement_ordering(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define CONTROL(x)
CONTROL.
#define range_increment(x)
#define EXPRESSION(x)
EXPRESSION.
#define expression_undefined
@ is_instruction_unstructured
@ is_instruction_whileloop
@ is_instruction_expression
#define instruction_tag(x)
#define instruction_forloop(x)
#define test_condition(x)
#define instruction_whileloop(x)
#define whileloop_body(x)
#define statement_instruction(x)
#define instruction_call(x)
#define call_arguments(x)
#define control_statement(x)
#define instruction_test(x)
#define instruction_unstructured(x)
#define entity_domain
newgen_syntax_domain_defined
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
int Gcount_nsp
================================================================
list loop_normalize_of_statement(statement s, hash_table fst, list *ell, list *etl, list *swfl, int *Gcount_nlc)
=================================================================
static list Genclosing_tests
static list Gscalar_written_forward
void loop_normalize_of_unstructured(unstructured u, hash_table fst, list *ell, list *etl, list *swfl, int *Gcount_nlc)
=================================================================
static_control static_controlize_unstructured(unstructured u)
=================================================================
list assigned_var
=================================================================
struct IOIntrinsicDescriptor IOIntrinsicDescriptor
the following data structure describes an io intrinsic function: its name
static_control static_controlize_whileloop(whileloop wl)
=================================================================
static_control static_controlize_forloop(forloop fl)
=================================================================
static_control static_controlize_call(call c)
================================================================
statement_mapping Gstatic_control_map
static list Genclosing_loops
static_control static_controlize_loop(loop l)
=================================================================
static bool io_filter(statement st)
======================================================================
static_control static_controlize_statement(statement s)
static hash_table Gforward_substitute_table
static IOIntrinsicDescriptor IOIntrinsicDescriptorTable[]
void * arc_label
Name : static_controlize.c package : static_controlize Author : Arnauld LESERVOT Date : May 93 Modifi...
list Gstructure_parameters
Global Variables
list loop_normalize_of_loop(loop l, hash_table fst, list *ell, list *etl, list *swfl, int *Gcount_nlc)
=================================================================
bool static_controlize(string mod_name)
=================================================================
void forward_substitute_in_exp(expression *, hash_table)
list make_undefined_list(void)
================================================================
list sc_list_of_exp_dup(list)
================================================================
bool get_reference_assignments(statement, list *)
Allows the static_controlize phase to keep and update a list containing all the variables of the prog...
bool normalizable_loop_p(loop)
bool normalizable_loop_p(loop l) Returns true if "l" has a constant step.
expression sc_conditional(expression, list *)
================================================================
bool sp_feautrier_expression_p(expression)
================================================================
list sc_list_of_loop_dup(list)
================================================================
string print_structurals(list)
================================================================
list sc_list_of_entity_dup(list)
================================================================
void forward_substitute_in_call(call *, hash_table)
void verify_structural_parameters(list, list *)
================================================================
bool splc_linear_access_to_arrays_p(list, list *)
================================================================
void forward_substitute_in_anyloop(void *, hash_table)
bool splc_feautrier_expression_p(expression, list *)
================================================================
int stco_renumber_code(statement, int)
================================================================
list sc_entity_to_formal_integer_parameters(entity)
================================================================
the following data structure describes an io intrinsic function: its name
The structure used to build lists in NewGen.
string words_to_string(cons *lw)
A gen_chunk is used to store every object.
#define exp
Avoid some warnings from "gcc -Wshadow".