PIPS
|
#include "matrice.h"
Go to the source code of this file.
Data Structures | |
struct | intrinsic_cost_rec |
Intrinsics costs defines. More... | |
Macros | |
#define | COMPLEXITY_PACKAGE_NAME "COMPLEXITY" |
Warning! Do not modify this file that is automatically generated! More... | |
#define | COMPLEXITY_UNDEFINED complexity_undefined |
#define | COMPLEXITY_UNDEFINED_P(c) ((c)==complexity_undefined) |
#define | COMPLEXITY_NOT_FOUND ((complexity) HASH_UNDEFINED_VALUE) |
#define | MAX_CONTROLS_IN_UNSTRUCTURED 100 |
#define | UNKNOWN_VARIABLE_NAME "UNKNOWN_VARIABLE" |
pseudo-variable for unknown variables More... | |
#define | UNKNOWN_RANGE_NAME "UNKNOWN_RANGE" |
pseudo-variable for default iteration number of a loop More... | |
#define | TCST_NAME "_TCST_" |
#define | UNKNOWN_VARIABLE_VALUE_PREFIX "U_" |
Prefix added to a variable name when its value is unknown but has to be used in a complexity formulae. More... | |
#define | COST_DATA "operation index memory trigo transcend overhead" |
defined complexity data file names here. More... | |
#define | DO_PRINT_STATS true |
defines for "complexity_fprint" calls More... | |
#define | DONT_PRINT_STATS false |
#define | PRINT_LOCAL_NAMES true |
#define | PRINT_GLOBAL_NAMES false |
#define | HASH_LOOP_INDEX ((char *) 4) /**Used as `value' field in the hash-table */ |
#define | HASH_USER_VARIABLE ((char *) 8) /**"hash_complexity_parameters"... useful? */ |
#define | HASH_FORMAL_PARAM ((char *) 12) |
#define | HASH_COMMON_VARIABLE ((char *) 16) /**used for variable in common. LZ 04/12/91 */ |
#define | ZERO_BYTE 0 |
#define | INT_NBYTES 4 /**number of bytes used by a standard int */ |
#define | FLOAT_NBYTES 4 /**number of bytes used by a single-precision */ |
#define | DOUBLE_NBYTES 8 /**number of bytes used by a double-precision */ |
#define | COMPLEX_NBYTES 2*FLOAT_NBYTES /**complex, single-precision */ |
#define | DCOMPLEX_NBYTES 2*DOUBLE_NBYTES /**complex, double-precision */ |
#define | MAKE_INT_BASIC make_basic(is_basic_int, (void *) INT_NBYTES) |
#define | MAKE_ADDRESS_BASIC make_basic(is_basic_int, (void *) DEFAULT_POINTER_TYPE_SIZE) |
#define | MAKE_FLOAT_BASIC make_basic(is_basic_float, (void *) FLOAT_NBYTES) |
#define | MAKE_DOUBLE_BASIC make_basic(is_basic_float, (void *) DOUBLE_NBYTES) |
#define | MAKE_COMPLEX_BASIC make_basic(is_basic_complex, (void *) COMPLEX_NBYTES) |
#define | MAKE_DCOMPLEX_BASIC make_basic(is_basic_complex, (void *) DCOMPLEX_NBYTES) |
#define | MAKE_STRING_BASIC make_basic(is_basic_string, make_value(is_value_unknown, UU)) |
#define | hash_contains_p(htp, key) (hash_get(htp, key) != HASH_UNDEFINED_VALUE) |
#define | hash_contains_formal_param_p(htp, key) (hash_get(htp, key) == HASH_FORMAL_PARAM) |
#define | hash_contains_user_var_p(htp, key) (hash_get(htp, key) == HASH_USER_VARIABLE) |
#define | hash_contains_common_var_p(htp, key) (hash_get(htp, key) == HASH_COMMON_VARIABLE) |
#define | hash_contains_loop_index_p(htp, key) (hash_get(htp, key) == HASH_LOOP_INDEX) |
#define | KEEP_SYMBOLS true |
defines for "expression_to_polynome" parameters More... | |
#define | DONT_KEEP_SYMBOLS false |
#define | MAXIMUM_VALUE 1 |
#define | MINIMUM_VALUE -1 |
#define | EXACT_VALUE 0 |
#define | TAKE_MAX(m) ((m) == MAXIMUM_VALUE) |
#define | TAKE_MIN(m) ((m) == MINIMUM_VALUE) |
#define | KEEP_EXACT(m) ((m) == EXACT_VALUE) |
#define | LOOP_INIT_OVERHEAD "LOOP-INIT-OVERHEAD" |
#define | LOOP_BRANCH_OVERHEAD "LOOP-BRANCH-OVERHEAD" |
#define | CONDITION_OVERHEAD "CONDITION-OVERHEAD" |
#define | CALL_ZERO_OVERHEAD "CALL-ZERO-OVERHEAD" |
#define | CALL_ONE_OVERHEAD "CALL-ONE-OVERHEAD" |
#define | CALL_TWO_OVERHEAD "CALL-TWO-OVERHEAD" |
#define | CALL_THREE_OVERHEAD "CALL-THREE-OVERHEAD" |
#define | CALL_FOUR_OVERHEAD "CALL-FOUR-OVERHEAD" |
#define | CALL_FIVE_OVERHEAD "CALL-FIVE-OVERHEAD" |
#define | CALL_SIX_OVERHEAD "CALL-SIX-OVERHEAD" |
#define | CALL_SEVEN_OVERHEAD "CALL-SEVEN-OVERHEAD" |
#define | TYPE_CAST_COST "TypeCast" |
TYPE_CAST_COST added to handle cast case ; Molka Becher More... | |
#define | MEMORY_READ_NAME "MEMORY-READ" |
the above two lines are added for 6th cost file, overhead. More... | |
#define | ONE_INDEX_NAME "ONE-INDEX" /**to count indexation costs in multi-dim arrays */ |
#define | TWO_INDEX_NAME "TWO-INDEX" /**to count indexation costs in multi-dim arrays */ |
#define | THREE_INDEX_NAME "THREE-INDEX" |
#define | FOUR_INDEX_NAME "FOUR-INDEX" |
#define | FIVE_INDEX_NAME "FIVE-INDEX" |
#define | SIX_INDEX_NAME "SIX-INDEX" |
#define | SEVEN_INDEX_NAME "SEVEN-INDEX" |
#define | STRING_INTRINSICS_COST 1 |
#define | LOGICAL_INTRINSICS_COST 1 |
#define | DONT_COUNT_THAT 0, 0, 0, 0, 0 |
#define | EMPTY_COST 0,0,0,0,0 |
#define | DISCRIMINE_TYPES 1, 10, 100,1000,10000 |
#define | REAL_INTRINSIC 100, 100, 100, 100, 100 |
#define | DOUBLE_INTRINSIC 200, 200, 200, 200, 200 |
#define | COMPLEX_INTRINSIC 400, 400, 400, 400, 400 |
#define | MEMORY_READ_COST DONT_COUNT_THAT |
#define | MEMORY_WRITE_COST DONT_COUNT_THAT |
#define | PLUS_MINUS_COST 1, 10, 20, 20, 40 |
#define | MULTIPLY_COST PLUS_MINUS_COST |
#define | DIVIDE_COST PLUS_MINUS_COST |
#define | POWER_COST 100, 100, 200, 200, 400 |
#define | TRANSC_COST REAL_INTRINSIC |
#define | DTRANSC_COST DOUBLE_INTRINSIC |
#define | CTRANSC_COST COMPLEX_INTRINSIC |
#define | TRIGO_COST REAL_INTRINSIC |
#define | DTRIGO_COST DOUBLE_INTRINSIC |
#define | CTRIGO_COST COMPLEX_INTRINSIC |
#define | TRIGOH_COST REAL_INTRINSIC |
#define | DTRIGOH_COST DOUBLE_INTRINSIC |
#define | CTRIGOH_COST COMPLEX_INTRINSIC |
#define | TWO_INDEX_COST DONT_COUNT_THAT |
#define | THREE_INDEX_COST DONT_COUNT_THAT |
#define | FOUR_INDEX_COST DONT_COUNT_THAT |
#define | FIVE_INDEX_COST DONT_COUNT_THAT |
#define | SIX_INDEX_COST DONT_COUNT_THAT |
#define | SEVEN_INDEX_COST DONT_COUNT_THAT |
Typedefs | |
typedef struct intrinsic_cost_rec | intrinsic_cost_record |
Intrinsics costs defines. More... | |
Variables | |
hash_table | hash_callee_to_complexity |
cproto-generated files More... | |
hash_table | hash_complexity_parameters |
intrinsic_cost_record | intrinsic_cost_table [] |
The table intrinsic_cost_table[] gathers cost information of each intrinsic's cost; those costs are dynamically loaded from user files. More... | |
#define CALL_FIVE_OVERHEAD "CALL-FIVE-OVERHEAD" |
Definition at line 137 of file complexity.h.
#define CALL_FOUR_OVERHEAD "CALL-FOUR-OVERHEAD" |
Definition at line 136 of file complexity.h.
#define CALL_ONE_OVERHEAD "CALL-ONE-OVERHEAD" |
Definition at line 133 of file complexity.h.
#define CALL_SEVEN_OVERHEAD "CALL-SEVEN-OVERHEAD" |
Definition at line 139 of file complexity.h.
#define CALL_SIX_OVERHEAD "CALL-SIX-OVERHEAD" |
Definition at line 138 of file complexity.h.
#define CALL_THREE_OVERHEAD "CALL-THREE-OVERHEAD" |
Definition at line 135 of file complexity.h.
#define CALL_TWO_OVERHEAD "CALL-TWO-OVERHEAD" |
Definition at line 134 of file complexity.h.
#define CALL_ZERO_OVERHEAD "CALL-ZERO-OVERHEAD" |
Definition at line 132 of file complexity.h.
#define COMPLEX_INTRINSIC 400, 400, 400, 400, 400 |
Definition at line 163 of file complexity.h.
#define COMPLEX_NBYTES 2*FLOAT_NBYTES /**complex, single-precision */ |
Definition at line 88 of file complexity.h.
#define COMPLEXITY_NOT_FOUND ((complexity) HASH_UNDEFINED_VALUE) |
Definition at line 53 of file complexity.h.
#define COMPLEXITY_PACKAGE_NAME "COMPLEXITY" |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/complexity/complexity-local.h instead, to add your own modifications. header file built by cproto complexity-local.h
Definition at line 47 of file complexity.h.
#define COMPLEXITY_UNDEFINED complexity_undefined |
Definition at line 48 of file complexity.h.
#define COMPLEXITY_UNDEFINED_P | ( | c | ) | ((c)==complexity_undefined) |
Definition at line 52 of file complexity.h.
#define CONDITION_OVERHEAD "CONDITION-OVERHEAD" |
Definition at line 130 of file complexity.h.
#define COST_DATA "operation index memory trigo transcend overhead" |
#define CTRANSC_COST COMPLEX_INTRINSIC |
Definition at line 178 of file complexity.h.
#define CTRIGO_COST COMPLEX_INTRINSIC |
Definition at line 181 of file complexity.h.
#define CTRIGOH_COST COMPLEX_INTRINSIC |
Definition at line 184 of file complexity.h.
#define DCOMPLEX_NBYTES 2*DOUBLE_NBYTES /**complex, double-precision */ |
Definition at line 89 of file complexity.h.
#define DISCRIMINE_TYPES 1, 10, 100,1000,10000 |
Definition at line 160 of file complexity.h.
#define DIVIDE_COST PLUS_MINUS_COST |
Definition at line 173 of file complexity.h.
#define DO_PRINT_STATS true |
defines for "complexity_fprint" calls
Definition at line 74 of file complexity.h.
#define DONT_COUNT_THAT 0, 0, 0, 0, 0 |
Definition at line 158 of file complexity.h.
#define DONT_KEEP_SYMBOLS false |
Definition at line 107 of file complexity.h.
#define DONT_PRINT_STATS false |
Definition at line 75 of file complexity.h.
#define DOUBLE_INTRINSIC 200, 200, 200, 200, 200 |
Definition at line 162 of file complexity.h.
#define DOUBLE_NBYTES 8 /**number of bytes used by a double-precision */ |
Definition at line 87 of file complexity.h.
#define DTRANSC_COST DOUBLE_INTRINSIC |
Definition at line 177 of file complexity.h.
#define DTRIGO_COST DOUBLE_INTRINSIC |
Definition at line 180 of file complexity.h.
#define DTRIGOH_COST DOUBLE_INTRINSIC |
Definition at line 183 of file complexity.h.
#define EMPTY_COST 0,0,0,0,0 |
Definition at line 159 of file complexity.h.
#define EXACT_VALUE 0 |
Definition at line 110 of file complexity.h.
#define FIVE_INDEX_COST DONT_COUNT_THAT |
Definition at line 189 of file complexity.h.
#define FIVE_INDEX_NAME "FIVE-INDEX" |
Definition at line 152 of file complexity.h.
#define FLOAT_NBYTES 4 /**number of bytes used by a single-precision */ |
Definition at line 86 of file complexity.h.
#define FOUR_INDEX_COST DONT_COUNT_THAT |
Definition at line 188 of file complexity.h.
#define FOUR_INDEX_NAME "FOUR-INDEX" |
Definition at line 151 of file complexity.h.
#define HASH_COMMON_VARIABLE ((char *) 16) /**used for variable in common. LZ 04/12/91 */ |
Definition at line 82 of file complexity.h.
#define hash_contains_common_var_p | ( | htp, | |
key | |||
) | (hash_get(htp, key) == HASH_COMMON_VARIABLE) |
Definition at line 101 of file complexity.h.
#define hash_contains_formal_param_p | ( | htp, | |
key | |||
) | (hash_get(htp, key) == HASH_FORMAL_PARAM) |
Definition at line 99 of file complexity.h.
#define hash_contains_loop_index_p | ( | htp, | |
key | |||
) | (hash_get(htp, key) == HASH_LOOP_INDEX) |
Definition at line 102 of file complexity.h.
#define hash_contains_p | ( | htp, | |
key | |||
) | (hash_get(htp, key) != HASH_UNDEFINED_VALUE) |
Definition at line 98 of file complexity.h.
#define hash_contains_user_var_p | ( | htp, | |
key | |||
) | (hash_get(htp, key) == HASH_USER_VARIABLE) |
Definition at line 100 of file complexity.h.
#define HASH_FORMAL_PARAM ((char *) 12) |
Definition at line 81 of file complexity.h.
Definition at line 79 of file complexity.h.
#define HASH_USER_VARIABLE ((char *) 8) /**"hash_complexity_parameters"... useful? */ |
Definition at line 80 of file complexity.h.
#define INT_NBYTES 4 /**number of bytes used by a standard int */ |
Definition at line 85 of file complexity.h.
#define KEEP_EXACT | ( | m | ) | ((m) == EXACT_VALUE) |
Definition at line 113 of file complexity.h.
#define KEEP_SYMBOLS true |
defines for "expression_to_polynome" parameters
Definition at line 106 of file complexity.h.
#define LOGICAL_INTRINSICS_COST 1 |
Definition at line 156 of file complexity.h.
#define LOOP_BRANCH_OVERHEAD "LOOP-BRANCH-OVERHEAD" |
Definition at line 129 of file complexity.h.
#define LOOP_INIT_OVERHEAD "LOOP-INIT-OVERHEAD" |
Definition at line 128 of file complexity.h.
#define MAKE_ADDRESS_BASIC make_basic(is_basic_int, (void *) DEFAULT_POINTER_TYPE_SIZE) |
Definition at line 91 of file complexity.h.
#define MAKE_COMPLEX_BASIC make_basic(is_basic_complex, (void *) COMPLEX_NBYTES) |
Definition at line 94 of file complexity.h.
#define MAKE_DCOMPLEX_BASIC make_basic(is_basic_complex, (void *) DCOMPLEX_NBYTES) |
Definition at line 95 of file complexity.h.
#define MAKE_DOUBLE_BASIC make_basic(is_basic_float, (void *) DOUBLE_NBYTES) |
Definition at line 93 of file complexity.h.
#define MAKE_FLOAT_BASIC make_basic(is_basic_float, (void *) FLOAT_NBYTES) |
Definition at line 92 of file complexity.h.
#define MAKE_INT_BASIC make_basic(is_basic_int, (void *) INT_NBYTES) |
Definition at line 90 of file complexity.h.
#define MAKE_STRING_BASIC make_basic(is_basic_string, make_value(is_value_unknown, UU)) |
Definition at line 96 of file complexity.h.
#define MAX_CONTROLS_IN_UNSTRUCTURED 100 |
Definition at line 55 of file complexity.h.
#define MAXIMUM_VALUE 1 |
Definition at line 108 of file complexity.h.
#define MEMORY_READ_COST DONT_COUNT_THAT |
Definition at line 165 of file complexity.h.
#define MEMORY_READ_NAME "MEMORY-READ" |
the above two lines are added for 6th cost file, overhead.
LZ 280993 overhead is divided into two. init and branch 081093
Definition at line 147 of file complexity.h.
#define MEMORY_WRITE_COST DONT_COUNT_THAT |
Definition at line 166 of file complexity.h.
#define MINIMUM_VALUE -1 |
Definition at line 109 of file complexity.h.
#define MULTIPLY_COST PLUS_MINUS_COST |
Definition at line 172 of file complexity.h.
#define ONE_INDEX_NAME "ONE-INDEX" /**to count indexation costs in multi-dim arrays */ |
Definition at line 148 of file complexity.h.
#define PLUS_MINUS_COST 1, 10, 20, 20, 40 |
Definition at line 167 of file complexity.h.
#define POWER_COST 100, 100, 200, 200, 400 |
Definition at line 174 of file complexity.h.
#define PRINT_GLOBAL_NAMES false |
Definition at line 77 of file complexity.h.
#define PRINT_LOCAL_NAMES true |
Definition at line 76 of file complexity.h.
#define REAL_INTRINSIC 100, 100, 100, 100, 100 |
Definition at line 161 of file complexity.h.
#define SEVEN_INDEX_COST DONT_COUNT_THAT |
Definition at line 191 of file complexity.h.
#define SEVEN_INDEX_NAME "SEVEN-INDEX" |
Definition at line 154 of file complexity.h.
#define SIX_INDEX_COST DONT_COUNT_THAT |
Definition at line 190 of file complexity.h.
#define SIX_INDEX_NAME "SIX-INDEX" |
Definition at line 153 of file complexity.h.
#define STRING_INTRINSICS_COST 1 |
Definition at line 155 of file complexity.h.
#define TAKE_MAX | ( | m | ) | ((m) == MAXIMUM_VALUE) |
Definition at line 111 of file complexity.h.
#define TAKE_MIN | ( | m | ) | ((m) == MINIMUM_VALUE) |
Definition at line 112 of file complexity.h.
#define TCST_NAME "_TCST_" |
Definition at line 63 of file complexity.h.
#define THREE_INDEX_COST DONT_COUNT_THAT |
Definition at line 187 of file complexity.h.
#define THREE_INDEX_NAME "THREE-INDEX" |
Definition at line 150 of file complexity.h.
#define TRANSC_COST REAL_INTRINSIC |
Definition at line 176 of file complexity.h.
#define TRIGO_COST REAL_INTRINSIC |
Definition at line 179 of file complexity.h.
#define TRIGOH_COST REAL_INTRINSIC |
Definition at line 182 of file complexity.h.
#define TWO_INDEX_COST DONT_COUNT_THAT |
Definition at line 186 of file complexity.h.
#define TWO_INDEX_NAME "TWO-INDEX" /**to count indexation costs in multi-dim arrays */ |
Definition at line 149 of file complexity.h.
#define TYPE_CAST_COST "TypeCast" |
TYPE_CAST_COST added to handle cast case ; Molka Becher
Definition at line 142 of file complexity.h.
#define UNKNOWN_RANGE_NAME "UNKNOWN_RANGE" |
pseudo-variable for default iteration number of a loop
Definition at line 61 of file complexity.h.
#define UNKNOWN_VARIABLE_NAME "UNKNOWN_VARIABLE" |
pseudo-variable for unknown variables
Definition at line 58 of file complexity.h.
#define UNKNOWN_VARIABLE_VALUE_PREFIX "U_" |
Prefix added to a variable name when its value is unknown but has to be used in a complexity formulae.
Definition at line 68 of file complexity.h.
#define ZERO_BYTE 0 |
Definition at line 84 of file complexity.h.
typedef struct intrinsic_cost_rec intrinsic_cost_record |
Intrinsics costs defines.
void add_common_variables_to_hash_table | ( | entity | module, |
hash_table | hash_complexity_params | ||
) |
module | odule |
hash_complexity_params | ash_complexity_params |
Definition at line 946 of file comp_util.c.
References action_read_p, approximation_exact_p, CAR, db_get_memory_resource(), debug(), EFFECT, effect_action, effect_any_reference, effect_approximation, effects_to_list(), ENDP, entity_module_p(), entity_storage, HASH_COMMON_VARIABLE, hash_put(), ifdebug, list_undefined, module, module_local_name(), module_name(), pips_assert, POP, print_effects, reference_variable, and storage_formal_p.
Referenced by any_complexities().
void add_formal_parameters_to_hash_table | ( | entity | mod, |
hash_table | hash_complexity_params | ||
) |
mod | od |
hash_complexity_params | ash_complexity_params |
Definition at line 768 of file comp_util.c.
References CAR, code_declarations, ENTITY, entity_initial, entity_module_p(), entity_name, entity_storage, fprintf(), get_bool_property(), HASH_FORMAL_PARAM, hash_put(), MAPL, module_local_name(), pips_assert, storage_formal_p, strdup(), and value_code.
Referenced by any_complexities().
bool any_complexities | ( | const | string | ) |
we may need to print preconditions for debugging purposes
string | odule_name |
Definition at line 99 of file comp_scan.c.
References add_common_variables_to_hash_table(), add_formal_parameters_to_hash_table(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, fetch_callees_complexities(), fetch_complexity_parameters(), fprint_cost_table(), fprintf(), free_callees_complexities(), free_value_mappings(), get_bool_property(), get_complexity_map(), get_current_module_entity(), get_current_module_statement(), hash_callee_to_complexity, hash_complexity_parameters, init_cost_table(), load_cumulated_rw_effects_list(), load_statement_precondition(), MAKE_STATEMENT_MAPPING, module_name(), module_name_to_entity(), module_to_value_mappings(), NIL, remove_common_variables_from_hash_table(), remove_formal_parameters_from_hash_table(), reset_complexity_map(), reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_precondition_map(), reset_proper_rw_effects(), set_complexity_map(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_precondition_map(), set_proper_rw_effects(), statement_to_complexity(), strdup(), trace_off(), trace_on(), and transformer_undefined.
Referenced by fp_complexities(), and uniform_complexities().
complexity arguments_to_complexity | ( | list | exprlist, |
basic * | pbasic, | ||
transformer | precond, | ||
list | effects_list | ||
) |
2nd element of call
arguments_to_complexity Return the sum of the complexities of the list of expressions passed. Return also in *pbasic the basic of the "biggest" argument (int/float/double/...)
exprlist | xprlist |
pbasic | basic |
precond | recond |
effects_list | ffects_list |
Definition at line 804 of file comp_scan.c.
References CAR, complexity_add(), complexity_check_and_warn(), complexity_fprint(), EXPRESSION, expression_to_complexity(), fprintf(), free_basic(), get_bool_property(), is_inferior_basic(), MAKE_INT_BASIC, make_zero_complexity(), MAPL, simple_basic_dup(), trace_off(), and trace_on().
Referenced by call_to_complexity().
matrice average_probability_matrix | ( | unstructured | , |
int | , | ||
control | [] | ||
) |
complexity block_to_complexity | ( | list | block, |
transformer | precond, | ||
list | effects_list | ||
) |
1st element of instruction
Modification:
block | lock |
precond | recond |
effects_list | ffects_list |
Definition at line 344 of file comp_scan.c.
References CAR, complexity_add(), complexity_check_and_warn(), complexity_consistent_p(), complexity_fprint(), complexity_polynome(), complexity_var_subst(), default_is_inferior_pvarval(), effects_write_variable_p(), evaluate_var_to_complexity(), FOREACH, fprintf(), gen_length(), gen_nthcdr(), get_bool_property(), load_cumulated_rw_effects_list(), load_statement_precondition(), make_zero_complexity(), polynome_used_var(), STATEMENT, statement_to_complexity(), Svecteur::succ, trace_off(), trace_on(), Svecteur::var, vect_dup(), VECTEUR_NUL, and VECTEUR_NUL_P.
Referenced by instruction_to_complexity().
complexity call_to_complexity | ( | call | call_instr, |
basic * | pbasic, | ||
transformer | precond, | ||
list | effects_list | ||
) |
3rd element of syntax
The only case that hash_callee_to_complexity is used
transform formal params into real ones
if not format case
call_instr | all_instr |
pbasic | basic |
precond | recond |
effects_list | ffects_list |
Definition at line 736 of file comp_scan.c.
References arguments_to_complexity(), call_arguments, call_function, complexity_check_and_warn(), complexity_float_add(), complexity_fprint(), COMPLEXITY_NOT_FOUND, entity_basic(), entity_initial, entity_name, entity_type, f(), fprintf(), get_bool_property(), hash_callee_to_complexity, hash_get(), intrinsic_cost(), is_value_code, is_value_constant, is_value_intrinsic, is_value_symbolic, is_value_unknown, make_zero_complexity(), module_local_name(), pips_assert, pips_internal_error, replace_formal_parameters_by_real_ones(), trace_off(), trace_on(), type_functional_p, type_statement_p, type_void_p, user_error, and value_tag.
Referenced by instruction_to_complexity(), and syntax_to_complexity().
complexity call_to_polynome | ( | call | call_instr, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
3rd element of syntax
For the moment, we don't want to evaluate the complexity of the
function defined by the users
call_instr | all_instr |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 369 of file comp_expr_to_pnome.c.
References call_arguments, call_function, complexity_float_add(), complexity_fprint(), constant_entity_to_float(), divide_op_handler(), DIVIDE_OPERATOR_NAME, entity_initial, entity_type, f(), field_op_handler(), FIELD_OPERATOR_NAME, fprintf(), get_bool_property(), is_value_code, is_value_constant, is_value_intrinsic, make_zero_complexity(), minus_op_handler(), MINUS_OPERATOR_NAME, module_local_name(), multiply_op_handler(), MULTIPLY_OPERATOR_NAME, pips_internal_error, pips_user_warning, plus_op_handler(), PLUS_OPERATOR_NAME, power_op_handler(), POWER_OPERATOR_NAME, same_string_p, trace_off(), trace_on(), type_functional_p, type_tag, unary_minus_op_handler(), UNARY_MINUS_OPERATOR_NAME, value_code_p, value_constant_p, value_intrinsic_p, and value_tag.
Referenced by syntax_to_polynome().
complexity cast_to_polynome | ( | cast | cast_instr, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
4th element of syntax : Molka Becher
cast_instr | ast_instr |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 429 of file comp_expr_to_pnome.c.
References cast_expression, complexity_fprint(), exp, expression_to_complexity_polynome(), fprintf(), get_bool_property(), trace_off(), and trace_on().
Referenced by syntax_to_polynome().
void complexity_add | ( | complexity * | pcomp1, |
complexity | comp2 | ||
) |
void complexity_add(complexity *pcomp1, comp2) performs *pcomp1 = *pcomp1 + comp2; !usage: complexity_add(&comp1, comp2); comp2 keeps unchanged
pcomp1 | comp1 |
comp2 | omp2 |
Definition at line 372 of file comp_math.c.
References complexity_dup(), complexity_eval, complexity_eval_, complexity_stats_add(), COMPLEXITY_UNDEFINED_P, complexity_zero_p(), newgen_Ppolynome, pips_internal_error, and polynome_addition().
Referenced by arguments_to_complexity(), block_to_complexity(), field_op_handler(), indices_to_complexity(), new_block_to_complexity(), plus_op_handler(), pvecteur_to_polynome(), range_to_complexity(), reference_to_complexity(), simplify_sc_to_complexity(), subscript_to_complexity(), syntax_to_complexity(), test_to_complexity(), unstructured_to_complexity(), and whileloop_to_complexity().
bool complexity_check | ( | complexity | comp | ) |
comp | omp |
Definition at line 96 of file comp_util.c.
References complexity_polynome(), COMPLEXITY_UNDEFINED_P, complexity_zero_p(), pips_internal_error, and polynome_check().
Referenced by complexity_check_and_warn(), and good_complexity_assert().
void complexity_check_and_warn | ( | const char * | , |
complexity | |||
) |
bool complexity_constant_p | ( | complexity | comp | ) |
true if comp is constant.
Abort if undefined
comp | omp |
Definition at line 256 of file comp_math.c.
References complexity_eval, COMPLEXITY_UNDEFINED_P, complexity_zero_p(), pips_internal_error, and polynome_constant_p().
Referenced by divide_op_handler(), loop_to_complexity(), and power_op_handler().
int complexity_degree | ( | complexity | c | ) |
Definition at line 1167 of file comp_util.c.
References complexity_eval, and polynome_max_degree().
Referenced by loop_to_complexity().
void complexity_div | ( | complexity * | pcomp1, |
complexity | comp2 | ||
) |
void complexity_div(complexity *pcomp1, comp2) performs *pcomp1 = *pcomp1 / comp2; !usage: complexity_div(&comp1, comp2);
polynome_rm(&(complexity_eval(*pcomp1)));
pcomp1 | comp1 |
comp2 | omp2 |
Definition at line 445 of file comp_math.c.
References complexity_eval, complexity_eval_, complexity_stats_add(), COMPLEXITY_UNDEFINED_P, complexity_zero_p(), newgen_Ppolynome, pips_internal_error, and polynome_div().
Referenced by loop_to_complexity().
void complexity_dump | ( | complexity | comp | ) |
comp | omp |
Definition at line 228 of file comp_util.c.
References complexity_fprint().
complexity complexity_dup | ( | complexity | comp | ) |
duplicates complexity comp
comp | omp |
Definition at line 131 of file comp_util.c.
References complexity_ifcount, complexity_polynome(), complexity_rangecount, COMPLEXITY_UNDEFINED_P, complexity_varcount, complexity_zero_p(), ifcount_computed, ifcount_halfhalf, ifcount_profiled, make_complexity(), make_ifcount(), make_rangecount(), make_varcount(), make_zero_complexity(), pips_internal_error, polynome_dup(), rangecount_bounded, rangecount_guessed, rangecount_profiled, rangecount_unknown, varcount_bounded, varcount_guessed, varcount_symbolic, and varcount_unknown.
Referenced by complexity_add(), complexity_stats_add(), complexity_sub(), final_statement_to_complexity_evaluation(), replace_formal_parameters_by_real_ones(), test_to_complexity(), and translate_complexity_from_local_to_current_name().
void complexity_float_add | ( | complexity * | , |
double | |||
) |
void complexity_fprint | ( | FILE * | fd, |
complexity | comp, | ||
bool | print_stats_p, | ||
bool | print_local_names_p | ||
) |
fd | d |
comp | omp |
print_stats_p | rint_stats_p |
print_local_names_p | rint_local_names_p |
Definition at line 217 of file comp_util.c.
References complexity_sprint(), fprintf(), and free().
Referenced by arguments_to_complexity(), block_to_complexity(), call_to_complexity(), call_to_polynome(), cast_to_polynome(), complexity_dump(), complexity_var_subst(), controls_to_hash_table(), expression_to_complexity_polynome(), fetch_callees_complexities(), final_statement_to_complexity_evaluation(), fprint_statement_complexity(), loop_to_complexity(), prc(), range_to_complexity(), reference_to_complexity(), statement_to_complexity(), test_to_complexity(), unstructured_to_complexity(), and whileloop_to_complexity().
bool complexity_is_monomial_p | ( | complexity | c | ) |
Definition at line 1159 of file comp_util.c.
References complexity_eval, and is_single_monome.
Referenced by loop_to_complexity().
bool complexity_map_undefined_p | ( | void | ) |
void complexity_mult | ( | complexity * | pcomp1, |
complexity | comp2 | ||
) |
void complexity_mult(complexity *pcomp1, comp2) performs *pcomp1 = *pcomp1 * comp2; !usage: complexity_mult(&comp1, comp2);
(Ppolynome) complexity_eval(*pcomp1) = (Ppolynome) ppmult;
pcomp1 | comp1 |
comp2 | omp2 |
Definition at line 418 of file comp_math.c.
References complexity_eval, complexity_eval_, complexity_rm(), complexity_stats_add(), COMPLEXITY_UNDEFINED_P, complexity_zero_p(), make_zero_complexity(), newgen_Ppolynome, pips_internal_error, polynome_free(), and polynome_mult().
Referenced by complexity_sigma(), divide_op_handler(), multiply_op_handler(), and whileloop_to_complexity().
Ppolynome complexity_polynome | ( | complexity | comp | ) |
Because complexity is composed of two elements, we use this function to get the first element : polynome Usage : complexity_polynome(complexity comp) you will get a pointer to the polynome May 3, 91 lz.
comp | omp |
Definition at line 506 of file comp_math.c.
References complexity_eval, COMPLEXITY_UNDEFINED_P, complexity_zero_p(), pips_internal_error, and POLYNOME_NUL.
Referenced by block_to_complexity(), complexity_check(), complexity_dup(), complexity_sigma(), complexity_sprint(), complexity_var_subst(), do_computation_intensity(), final_statement_to_complexity_evaluation(), if_conv_init_statement(), loop_to_complexity(), power_op_handler(), task_time(), and translate_complexity_from_local_to_current_name().
void complexity_polynome_add | ( | complexity * | pcomp, |
Ppolynome | pp | ||
) |
pcomp | comp |
pp | p |
Definition at line 463 of file comp_math.c.
References complexity_eval, complexity_eval_, COMPLEXITY_UNDEFINED_P, newgen_Ppolynome, pips_internal_error, polynome_addition(), and POLYNOME_UNDEFINED_P.
Referenced by loop_to_complexity(), and pvecteur_to_polynome().
void complexity_rm | ( | complexity * | pcomp | ) |
remove complexity comp
pcomp | comp |
Definition at line 164 of file comp_util.c.
References COMPLEXITY_UNDEFINED_P, complexity_zero_p(), free_complexity(), make_zero_complexity(), and pips_internal_error.
Referenced by complexity_mult(), complexity_scalar_mult(), divide_op_handler(), field_op_handler(), indices_to_complexity(), loop_to_complexity(), minus_op_handler(), multiply_op_handler(), plus_op_handler(), power_op_handler(), range_to_complexity(), reference_to_complexity(), replace_formal_parameters_by_real_ones(), simplify_sc_to_complexity(), subscript_to_complexity(), syntax_to_complexity(), test_to_complexity(), and unary_minus_op_handler().
void complexity_scalar_mult | ( | complexity * | , |
double | |||
) |
complexity complexity_sigma | ( | complexity | comp, |
Variable | index, | ||
complexity | clower, | ||
complexity | cupper | ||
) |
"mathematical" operations on complexities
complexity complexity_sigma(comp, index, clower, cupper) complexity_var_subst(comp, var, compsubst) complexity polynome_to_new_complexity(pp) complexity complexity_dup(comp) void complexity_rm(pcomp) complexity make_single_var_complexity(float, var) bool complexity_constant_p(comp) float complexity_TCST(comp) void complexity_scalar_mult(pcomp, f) void complexity_float_add(pcomp, f) void complexity_stats_add(pcomp1, comp2) void complexity_add(pcomp1, comp2) void complexity_sub(pcomp1, comp2) void complexity_mult(pcomp1, comp2) void complexity_polynome_add(pcomp, pp) Ppolynome complexity_polynome(comp) complexity replace_formal_parameters_by_real_ones(comp, mod, args, precond) Modif: – entity_local_name is replaced by module_local_name. LZ 230993 complexity complexity_sigma(complexity comp, Variable index, complexity clower, cupper) return the integration of complexity comp when the index is running between clower and cupper. Based on the polynomial library routine polynome_sigma.
FI: Too late to build a meaningful unknown range name!
tats
comp | omp |
index | ndex |
clower | lower |
cupper | upper |
Definition at line 84 of file comp_math.c.
References AddEntityToCurrentModule(), complexity_mult(), complexity_polynome(), complexity_stats_add(), COMPLEXITY_UNDEFINED_P, complexity_zero_p(), fprintf(), get_current_module_entity(), is_basic_int, make_new_scalar_variable_with_prefix(), make_polynome(), make_zero_complexity(), MakeBasic(), module_local_name(), pips_internal_error, polynome_contains_var(), POLYNOME_NUL, polynome_rm(), polynome_sigma(), polynome_to_new_complexity(), prp(), UNKNOWN_RANGE_NAME, and VALUE_ONE.
Referenced by loop_to_complexity().
char* complexity_sprint | ( | complexity | comp, |
bool | print_stats_p, | ||
bool | print_local_names_p | ||
) |
comp | omp |
print_stats_p | rint_stats_p |
print_local_names_p | rint_local_names_p |
Definition at line 175 of file comp_util.c.
References asprintf, complexity_ifcount, complexity_polynome(), complexity_rangecount, COMPLEXITY_UNDEFINED_P, complexity_varcount, free(), ifcount_computed, ifcount_halfhalf, ifcount_profiled, is_inferior_pvarval(), pips_internal_error, polynome_sprint(), rangecount_bounded, rangecount_guessed, rangecount_profiled, rangecount_unknown, varcount_bounded, varcount_guessed, varcount_symbolic, varcount_unknown, variable_local_name(), and variable_name().
Referenced by complexity_fprint(), task_complexity(), task_time_polynome(), text_complexity(), and text_summary_complexity().
void complexity_stats_add | ( | complexity * | pcomp1, |
complexity | comp2 | ||
) |
Add comp2's statistics to *pcomp1's comp2 keeps unchanged.
pcomp1 | comp1 |
comp2 | omp2 |
Definition at line 323 of file comp_math.c.
References complexity_consistent_p(), complexity_dup(), complexity_eval, complexity_eval_, complexity_ifcount, complexity_rangecount, COMPLEXITY_UNDEFINED_P, complexity_varcount, complexity_zero_p(), ifcount_computed, ifcount_halfhalf, ifcount_profiled, ifdebug, newgen_Ppolynome, pips_internal_error, polynome_free(), rangecount_bounded, rangecount_guessed, rangecount_profiled, rangecount_unknown, varcount_bounded, varcount_guessed, varcount_symbolic, and varcount_unknown.
Referenced by complexity_add(), complexity_div(), complexity_mult(), complexity_sigma(), complexity_sub(), complexity_var_subst(), and loop_to_complexity().
void complexity_sub | ( | complexity * | pcomp1, |
complexity | comp2 | ||
) |
void complexity_sub(complexity *pcomp1, comp2) performs *pcomp1 = *pcomp1 - comp2; !usage: complexity_sub(&comp1, comp2); comp2 keeps unchanged
pcomp1 | comp1 |
comp2 | omp2 |
Definition at line 394 of file comp_math.c.
References complexity_dup(), complexity_eval, complexity_eval_, complexity_stats_add(), COMPLEXITY_UNDEFINED_P, complexity_zero_p(), newgen_Ppolynome, pips_internal_error, polynome_addition(), and polynome_opposed().
Referenced by minus_op_handler(), and unary_minus_op_handler().
float complexity_TCST | ( | complexity | comp | ) |
return the constant term of comp.
Abort if undefined
comp | omp |
Definition at line 288 of file comp_math.c.
References complexity_eval, COMPLEXITY_UNDEFINED_P, complexity_zero_p(), pips_internal_error, and polynome_TCST().
Referenced by divide_op_handler(), loop_to_complexity(), and power_op_handler().
bool complexity_unknown_p | ( | complexity | comp | ) |
true if comp is unknown.
Abort if undefined
FI: Management of unknown complexities, when polynomes are in fact used to represent the value of a variables or an expression, has to be revisited
comp | omp |
Definition at line 269 of file comp_math.c.
References COMPLEXITY_UNDEFINED_P, and pips_internal_error.
Referenced by expression_to_complexity_polynome(), and loop_to_complexity().
complexity complexity_var_subst | ( | complexity | comp, |
Variable | var, | ||
complexity | compsubst | ||
) |
complexity complexity_var_subst(comp, var, compsubst) replaces every occurrence of variable var in complexity comp by the polynomial of complexity compsubst.
The statistics of compsubst are added to those of comp.
substitutes
comp | omp |
var | ar |
compsubst | ompsubst |
Definition at line 155 of file comp_math.c.
References complexity_consistent_p(), complexity_fprint(), complexity_polynome(), complexity_stats_add(), COMPLEXITY_UNDEFINED_P, complexity_zero_p(), fprintf(), get_bool_property(), make_zero_complexity(), pips_internal_error, polynome_to_new_complexity(), polynome_var_subst(), and variable_name().
Referenced by block_to_complexity(), new_block_to_complexity(), replace_formal_parameters_by_real_ones(), and translate_complexity_from_local_to_current_name().
bool complexity_zero_p | ( | complexity | comp | ) |
zero complexity check.
Abort if undefined
comp | omp |
Definition at line 244 of file comp_math.c.
References complexity_eval, COMPLEXITY_UNDEFINED_P, pips_internal_error, and POLYNOME_NUL_P.
Referenced by complexity_add(), complexity_check(), complexity_check_and_warn(), complexity_constant_p(), complexity_div(), complexity_dup(), complexity_float_add(), complexity_mult(), complexity_polynome(), complexity_rm(), complexity_scalar_mult(), complexity_sigma(), complexity_stats_add(), complexity_sub(), complexity_TCST(), complexity_var_subst(), evaluate_var_to_complexity(), pvecteur_to_polynome(), task_complexity(), task_time_polynome(), and test_to_complexity().
float constant_entity_to_float | ( | entity | e | ) |
Return if possible the value of e in a float.
it is supposed to be an int or a float.
Definition at line 664 of file comp_util.c.
References basic_float_p, basic_int_p, basic_tag, entity_basic(), f(), module_local_name(), and user_warning.
Referenced by call_to_polynome().
void controls_to_hash_table | ( | control | , |
int * | , | ||
control | [], | ||
hash_table | , | ||
transformer | , | ||
list | |||
) |
void delete_statement_complexity | ( | statement | ) |
complexity divide_op_handler | ( | list | args, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
args | rgs |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 560 of file comp_expr_to_pnome.c.
References CAR, CDR, complexity_constant_p(), complexity_mult(), complexity_rm(), complexity_TCST(), DONT_KEEP_SYMBOLS, EXPRESSION, expression_to_complexity_polynome(), make_constant_complexity(), and user_error.
Referenced by call_to_polynome().
Definition at line 757 of file comp_util.c.
complexity evaluate_var_to_complexity | ( | entity | , |
transformer | , | ||
list | , | ||
int | |||
) |
complexity expression_to_complexity | ( | expression | expr, |
basic * | pbasic, | ||
transformer | precond, | ||
list | effects_list | ||
) |
2nd element of call –arguments
2nd element of reference –indices
expr | xpr |
pbasic | basic |
precond | recond |
effects_list | ffects_list |
Definition at line 838 of file comp_scan.c.
References complexity_check_and_warn(), expression_syntax, make_zero_complexity(), pips_internal_error, syntax_to_complexity(), syntax_undefined, trace_off(), and trace_on().
Referenced by arguments_to_complexity(), indices_to_complexity(), instruction_to_complexity(), range_to_complexity(), subscript_to_complexity(), syntax_to_complexity(), test_to_complexity(), and whileloop_to_complexity().
complexity expression_to_complexity_polynome | ( | expression | expr, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
Entry point routine of this file:
complexity expression_to_complexity_polynome(expression expr, transformer precond, list effects_list, bool keep_symbols, int maximize) return the polynomial associated to the expression expr, or POLYNOME_UNDEFINED if it's not a polynome. or POLYNOME_NULL if it's a 0 complexity. If keep_symbols is false, we force evaluation of variables. If they can't be evaluated, they enter the polynomial, but they are replaced by the pseudo-variable UNKNOWN_VARIABLE, except when they appear in a loop range: in that case, the whole range is replaced by UNKNOWN_RANGE. The int maximize lets us use the mins and maxs of preconditions system, to compute a WORST-CASE complexity for the upper bound , maximize is 1 for the lower bound and increment, maximize is -1 (when the precondition doesn't give an exact value)
effects_list is added on 10 Nov 92 to pass the effects which can be used to determine the "must-be-written" effects to delay the variable evaluation. LZ 10 Nov 92
FI:
The following line is merely for debugging
expr | xpr |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 118 of file comp_expr_to_pnome.c.
References complexity_fprint(), complexity_undefined, complexity_unknown_p(), expression_syntax, expression_undefined, fprintf(), get_bool_property(), make_zero_complexity(), NORMALIZE_EXPRESSION, normalized_linear_p, normalized_to_polynome(), pips_internal_error, syntax_to_polynome(), syntax_undefined, trace_off(), and trace_on().
Referenced by cast_to_polynome(), divide_op_handler(), field_op_handler(), loop_to_complexity(), minus_op_handler(), multiply_op_handler(), plus_op_handler(), power_op_handler(), replace_formal_parameters_by_real_ones(), unary_minus_op_handler(), unary_plus_op_handler(), and whileloop_to_complexity().
hash_table fetch_callees_complexities | ( | char * | module_name | ) |
translate the local name to current module name. LZ 5 Feb.93
i.e. SUB:M -> MAIN:M
FI: this seems to be wrong in general because the formal parameter and actual argument are assumed to have the same name; see DemoStd/q and variables IM/IMM; 3 March 1994
module_name | odule_name |
Definition at line 821 of file comp_util.c.
References callee, callees_callees, CAR, complexity_fprint(), db_get_memory_resource(), debug(), DO_PRINT_STATS, entity_initial, entity_type, fprintf(), get_bool_property(), hash_pointer, hash_put(), hash_table_make(), MAPL, module_name(), module_name_to_entity(), NIL, pips_assert, PRINT_LOCAL_NAMES, STRING, translate_complexity_from_local_to_current_name(), type_functional_p, type_void_p, and value_code_p.
Referenced by any_complexities().
hash_table fetch_complexity_parameters | ( | char * | module_name | ) |
module_name | odule_name |
Definition at line 901 of file comp_util.c.
References concatenate(), entity_domain, entity_name, entity_undefined, fprintf(), gen_find_tabulated(), get_bool_property(), get_string_property(), hash_pointer, hash_put(), hash_table_make(), HASH_USER_VARIABLE, hash_warn_on_redefinition(), malloc(), module_name(), MODULE_SEP_STRING, and strdup().
Referenced by any_complexities().
complexity field_op_handler | ( | list | args, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
args | rgs |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 512 of file comp_expr_to_pnome.c.
References CAR, CDR, complexity_add(), complexity_rm(), EXPRESSION, and expression_to_complexity_polynome().
Referenced by call_to_polynome().
complexity final_statement_to_complexity_evaluation | ( | complexity | comp, |
transformer | precond, | ||
list | effects_list | ||
) |
comp | omp |
precond | recond |
effects_list | ffects_list |
Definition at line 1052 of file comp_util.c.
References complexity_dup(), complexity_fprint(), complexity_polynome(), default_is_inferior_pvarval(), evaluate_var_to_complexity(), fprintf(), is_must_be_written_var(), polynome_used_var(), Svecteur::succ, Svecteur::var, variable_local_name(), vect_dup(), and VECTEUR_NUL_P.
set up identity matrix
indx | ndx |
pd | d |
Definition at line 198 of file comp_matrice.c.
References A, lu_back_substitution(), lu_decomposition(), malloc(), and Y.
Referenced by unstructured_to_complexity().
bool fp_complexities | ( | const | string | ) |
string | odule_name |
Definition at line 89 of file comp_scan.c.
References any_complexities(), and module_name().
void fprint_cost_table | ( | FILE * | fd | ) |
fd | d |
Definition at line 481 of file comp_util.c.
References intrinsic_cost_rec::complex_cost, intrinsic_cost_rec::dcomplex_cost, intrinsic_cost_rec::double_cost, intrinsic_cost_rec::float_cost, fprintf(), intrinsic_cost_rec::int_cost, intrinsic_cost_table, and intrinsic_cost_rec::name.
Referenced by any_complexities().
void fprint_statement_complexity | ( | entity | module, |
statement | stat, | ||
hash_table | hash_statement_to_complexity | ||
) |
module | odule |
stat | tat |
hash_statement_to_complexity | ash_statement_to_complexity |
Definition at line 253 of file comp_util.c.
References complexity_fprint(), COMPLEXITY_UNDEFINED_P, DO_PRINT_STATS, fprintf(), hash_get(), module, pips_internal_error, PRINT_LOCAL_NAMES, print_text(), and Text_Statement().
hash_table free_callees_complexities | ( | hash_table | h | ) |
Modified copies of the summary complexities are stored
Definition at line 812 of file comp_util.c.
References hash_table_clear(), hash_table_free(), and hash_table_undefined.
Referenced by any_complexities().
void free_complexity_map | ( | void | ) |
statement_mapping get_complexity_map | ( | void | ) |
void good_complexity_assert | ( | string | , |
complexity | |||
) |
complexity goto_to_complexity | ( | statement | , |
transformer | , | ||
list | |||
) |
complexity indices_to_complexity | ( | list | exprlist, |
basic * | pbasic, | ||
transformer | precond, | ||
list | effects_list | ||
) |
2nd element of reference
exactly the same with arguments_to_complexity I add this function in order to make the structure clearer Apr. 15,91
exprlist | xprlist |
pbasic | basic |
precond | recond |
effects_list | ffects_list |
Definition at line 1057 of file comp_scan.c.
References CAR, complexity_add(), complexity_check_and_warn(), complexity_rm(), EXPRESSION, expression_to_complexity(), free_basic(), is_inferior_basic(), MAKE_INT_BASIC, make_zero_complexity(), MAPL, simple_basic_dup(), trace_off(), and trace_on().
Referenced by reference_to_complexity(), and subscript_to_complexity().
void init_cost_table | ( | void | ) |
Completes the intrinsic cost table with the costs read from the files specified in the "COMPLEXITY_COST_TABLE" string property See properties.rc and ~pips/Pips/pipsrc.csh for more information.
L. ZHOU 13/03/91
COST_DATA are names of five data files
Definition at line 519 of file comp_util.c.
References concatenate(), COST_DATA, debug(), fopen_config(), free(), get_string_property(), load_cost_file(), strdup(), and strndup().
Referenced by any_complexities(), generic_print_xml_application(), and print_xml_code().
complexity instruction_to_complexity | ( | instruction | instr, |
transformer | precond, | ||
list | effects_list | ||
) |
The only element available of the statement.
dummy parameter
dummy parameter
instr | nstr |
precond | recond |
effects_list | ffects_list |
Definition at line 275 of file comp_scan.c.
References block_to_complexity(), call_to_complexity(), complexity_check_and_warn(), expression_to_complexity(), goto_to_complexity(), instruction_block, instruction_call, instruction_expression, instruction_goto, instruction_loop, instruction_tag, instruction_test, instruction_unstructured, instruction_whileloop, is_instruction_block, is_instruction_call, is_instruction_expression, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, loop_to_complexity(), MAKE_INT_BASIC, make_zero_complexity(), pips_internal_error, test_to_complexity(), trace_off(), trace_on(), unstructured_to_complexity(), and whileloop_to_complexity().
Referenced by statement_to_complexity().
pvarval1 | varval1 |
pvarval2 | varval2 |
Definition at line 149 of file polynome_ri.c.
References entity_name, term_cst, variable_local_name(), and vecteur_var.
Referenced by complexity_sprint(), prp(), and translate_complexity_from_local_to_current_name().
var1 | ar1 |
var2 | ar2 |
Definition at line 118 of file polynome_ri.c.
References TCST, and variable_local_name().
Referenced by is_inferior_monome(), polynome_fprint(), polynome_sort(), polynome_sprint(), and polynome_used_var().
varval1 | arval1 |
varval2 | arval2 |
Definition at line 134 of file polynome_ri.c.
References term_cst, variable_local_name(), and vecteur_var.
bool is_linear_unstructured | ( | unstructured | unstr | ) |
return true if unstr is simply a linear string of controls
unstr | nstr |
Definition at line 738 of file comp_util.c.
References CAR, CDR, CONTROL, control_successors, current, exit, NIL, pips_internal_error, unstructured_control, and unstructured_exit.
fprintf(stderr, "is_must_be_written_var for entity %s\n", module_local_name(e) );
effects_list | ffects_list |
var_name | ar_name |
Definition at line 1014 of file comp_util.c.
References action_write_p, approximation_exact_p, CAR, EFFECT, effect_action, effect_any_reference, effect_approximation, effect_undefined, MAPL, module_local_name(), pips_internal_error, and reference_variable.
Referenced by final_statement_to_complexity_evaluation().
return a pointer to the (i)th element of the list if i = 1, the pointer doesn't change at all.
thelist | helist |
ith | th |
Definition at line 579 of file comp_math.c.
References CDR, NIL, and pips_assert.
void load_cost_file | ( | FILE * | , |
double | |||
) |
complexity load_statement_complexity | ( | statement | ) |
Referenced by do_computation_intensity(), if_conv_init_statement(), summary_complexity(), task_complexity(), task_time(), task_time_polynome(), and text_complexity().
Variable local_name_to_variable | ( | char * | name | ) |
name | ame |
Definition at line 194 of file polynome_ri.c.
References chunk_undefined, entity_domain, entity_undefined, gen_find_tabulated(), make_entity_fullname(), TCST, TCST_NAME, and user_warning.
complexity loop_to_complexity | ( | loop | loop_instr, |
transformer | precond, | ||
list | effects_list | ||
) |
3rd element of instruction
FI: Lei chose to allocate the UL and UU entities in the current module... Maybe, we are ready fo some dynamic profiling...
string mod_name = entity_module_name(ll);
if the statement were still reachable, we could try to use the statement nunber...
In order to get rid of at-sign, add 1 , LZ 010492
tell callees that they mustn't try to evaluate the loop index
cioh cboh are derived from overhead file "overhead" LZ, 280993
zero iteration for sure
at least one iteration
maybe some iteration
an intermediate test based on preconditions would give better result with affine loop bounds
loop_instr | oop_instr |
precond | recond |
effects_list | ffects_list |
Definition at line 460 of file comp_scan.c.
References AddEntityToCurrentModule(), asprintf, complexity_check_and_warn(), complexity_constant_p(), complexity_degree(), complexity_div(), complexity_fprint(), complexity_is_monomial_p(), complexity_polynome(), complexity_polynome_add(), complexity_rangecount, complexity_rm(), complexity_scalar_mult(), complexity_sigma(), complexity_stats_add(), complexity_TCST(), complexity_unknown_p(), empty_global_label_p(), entity_local_name(), entity_name, execution_parallel_p, expression_to_complexity_polynome(), fprintf(), free(), free_complexity(), get_bool_property(), get_current_module_entity(), hash_complexity_parameters, hash_del(), HASH_LOOP_INDEX, hash_put(), intrinsic_cost(), is_basic_int, KEEP_SYMBOLS, loop_body, LOOP_BRANCH_OVERHEAD, loop_execution, loop_index, LOOP_INIT_OVERHEAD, loop_label, loop_range, make_constant_complexity(), MAKE_INT_BASIC, make_new_scalar_variable_with_prefix(), make_single_var_complexity(), make_zero_complexity(), MakeBasic(), MAXIMUM_VALUE, MINIMUM_VALUE, module_local_name(), range_increment, range_lower, range_to_complexity(), range_upper, rangecount_guessed, statement_to_complexity(), strdup(), trace_off(), trace_on(), user_error, and user_warning.
Referenced by instruction_to_complexity().
back substitution
indx | ndx |
Definition at line 155 of file comp_matrice.c.
Referenced by float_matrice_inversion().
Added by AP, March 15th 93
If using gcc to compile, vv can be declared as vv[n] LZ 29/10/92 float vv[n];
loop over rows to get the implicit scaling information
loopover columns of Crout's method
a | Modif by AP, March 15th 93 float a[n][n]; int indx[n]; |
indx | ndx |
pd | d |
Definition at line 65 of file comp_matrice.c.
References A, fprintf(), MAX_CONTROLS_IN_UNSTRUCTURED, sum(), and user_error.
Referenced by float_matrice_inversion().
void make_complexity_map | ( | void | ) |
complexity make_complexity_unknown | ( | const char * | name | ) |
builds a new unknown complexity attached to a virtual package
name | ame |
Definition at line 81 of file comp_expr_to_pnome.c.
References COMPLEXITY_PACKAGE_NAME, DEFAULT_INTEGER_TYPE_SIZE, entity_undefined_p, make_basic_int(), make_empty_program(), make_language_fortran(), make_new_scalar_variable_with_prefix(), make_single_var_complexity(), and package.
Referenced by simplify_sc_to_complexity(), and whileloop_to_complexity().
complexity make_constant_complexity | ( | double | ) |
complexity make_single_var_complexity | ( | double | , |
Variable | |||
) |
complexity make_zero_complexity | ( | void | ) |
make a zero complexity "0.0000 * TCST" with null statistics
Definition at line 238 of file comp_math.c.
References make_constant_complexity().
Referenced by arguments_to_complexity(), block_to_complexity(), call_to_complexity(), call_to_polynome(), complexity_dup(), complexity_mult(), complexity_rm(), complexity_scalar_mult(), complexity_sigma(), complexity_var_subst(), evaluate_var_to_complexity(), expression_to_complexity(), expression_to_complexity_polynome(), goto_to_complexity(), indices_to_complexity(), instruction_to_complexity(), loop_to_complexity(), new_block_to_complexity(), normalized_to_polynome(), power_op_handler(), pvecteur_to_polynome(), range_to_polynome(), reference_to_complexity(), reference_to_polynome(), simplify_sc_to_complexity(), statement_to_complexity(), summary_complexity(), syntax_to_complexity(), syntax_to_polynome(), translate_complexity_from_local_to_current_name(), unary_minus_op_handler(), and unstructured_to_complexity().
complexity minus_op_handler | ( | list | args, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
args | rgs |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 472 of file comp_expr_to_pnome.c.
References CAR, CDR, complexity_rm(), complexity_sub(), EXPRESSION, and expression_to_complexity_polynome().
Referenced by call_to_polynome().
complexity multiply_op_handler | ( | list | args, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
args | rgs |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 492 of file comp_expr_to_pnome.c.
References CAR, CDR, complexity_mult(), complexity_rm(), EXPRESSION, and expression_to_complexity_polynome().
Referenced by call_to_polynome().
Variable name_to_variable | ( | char * | name | ) |
name | ame |
Definition at line 172 of file polynome_ri.c.
References chunk_undefined, entity_domain, entity_undefined, gen_find_tabulated(), TCST, TCST_NAME, and user_warning.
Referenced by polynome_sscanf(), and translate_complexity_from_local_to_current_name().
char* noms_var | ( | entity | e | ) |
Definition at line 60 of file comp_expr_to_pnome.c.
References entity_has_values_p(), external_value_name(), module_local_name(), and TCST.
Referenced by evaluate_var_to_complexity(), plint(), plint_pas(), sc_resol_smith(), simplify_sc_to_complexity(), smith_int(), and sol_finale().
complexity normalized_to_polynome | ( | normalized | no, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
2nd element of expression
no | o |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 211 of file comp_expr_to_pnome.c.
References make_zero_complexity(), normalized_linear, normalized_linear_p, pips_internal_error, pvecteur_to_polynome(), trace_off(), and trace_on().
Referenced by expression_to_complexity_polynome().
complexity plus_op_handler | ( | list | args, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
args | rgs |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 452 of file comp_expr_to_pnome.c.
References CAR, CDR, complexity_add(), complexity_rm(), EXPRESSION, and expression_to_complexity_polynome().
Referenced by call_to_polynome().
complexity polynome_to_new_complexity | ( | Ppolynome | pp | ) |
Create a complexity equal to Ppolynome pp with null statistics.
pp IS duplicated.
pp | p |
Definition at line 200 of file comp_math.c.
References complexity_consistent_p(), ifdebug, make_complexity(), make_ifcount(), make_rangecount(), make_varcount(), pips_assert, polynome_dup(), and POLYNOME_UNDEFINED_P.
Referenced by complexity_float_add(), complexity_sigma(), complexity_var_subst(), make_single_var_complexity(), pvecteur_to_polynome(), and reference_to_polynome().
complexity power_op_handler | ( | list | args, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
polynome_rm(&(complexity_eval(c1)));
(Ppolynome) complexity_eval(c1) = pp;
args | rgs |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 589 of file comp_expr_to_pnome.c.
References CAR, CDR, complexity_constant_p(), complexity_eval, complexity_eval_, complexity_polynome(), complexity_rm(), complexity_TCST(), DONT_KEEP_SYMBOLS, EXPRESSION, expression_to_complexity_polynome(), make_zero_complexity(), newgen_Ppolynome, polynome_power_n(), and polynome_rm().
Referenced by call_to_polynome().
void prc | ( | complexity | comp | ) |
comp | omp |
Definition at line 233 of file comp_util.c.
References complexity_fprint().
Referenced by pvecteur_to_polynome().
bool print_call_graph_with_complexities | ( | const | string | ) |
string | odule_name |
Definition at line 254 of file comp_prettyprint.c.
References get_text_complexities(), module_name(), and print_decorated_call_graph().
bool print_code_as_a_graph_complexities | ( | const | string | ) |
string | od_name |
Definition at line 234 of file comp_prettyprint.c.
References print_code_complexities(), and set_bool_property().
bool print_code_complexities | ( | const | string | ) |
string | odule_name |
Definition at line 228 of file comp_prettyprint.c.
References is_user_view, module_name(), and print_code_or_source_comp().
Referenced by print_code_as_a_graph_complexities().
bool print_icfg_with_complexities | ( | const | string | ) |
string | odule_name |
bool print_icfg_with_control_complexities | ( | const | string | ) |
string | odule_name |
bool print_icfg_with_loops_complexities | ( | const | string | ) |
string | odule_name |
bool print_source_complexities | ( | const | string | ) |
string | odule_name |
Definition at line 245 of file comp_prettyprint.c.
References is_user_view, module_name(), and print_code_or_source_comp().
void prp | ( | Ppolynome | pp | ) |
pp | p |
Definition at line 239 of file comp_util.c.
References fprintf(), is_inferior_pvarval(), polynome_fprint(), and variable_name().
Referenced by complexity_sigma().
void prv | ( | Pvecteur | pv | ) |
pv | v |
Definition at line 246 of file comp_util.c.
References BASE_NULLE, fprintf(), variable_name(), and vect_fprint_as_monome().
Referenced by sc_projection_optim_along_vecteur_ofl().
complexity pvecteur_to_polynome | ( | Pvecteur | pvect, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
The only element available of normalized.
bool must_be_written = false;
if (we_must_evaluate && must_be_written) {
should be multiplied by "val" here
We keep this symbol (including TCST) in the polynome
pvect | vect |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 234 of file comp_expr_to_pnome.c.
References complexity_add(), complexity_polynome_add(), complexity_scalar_mult(), complexity_varcount, complexity_zero_p(), evaluate_var_to_complexity(), exp, fprintf(), get_bool_property(), hash_complexity_parameters, hash_contains_p, make_polynome(), make_zero_complexity(), module_local_name(), polynome_to_new_complexity(), prc(), Svecteur::succ, TCST, trace_off(), trace_on(), VALUE_ONE, VALUE_TO_FLOAT, varcount_symbolic, variable_name(), vect_coeff(), vect_first_var(), vect_fprint(), and VECTEUR_NUL_P.
Referenced by normalized_to_polynome().
complexity range_to_complexity | ( | range | rng, |
transformer | precond, | ||
list | effects_list | ||
) |
2nd element of syntax
rng | ng |
precond | recond |
effects_list | ffects_list |
Definition at line 1089 of file comp_scan.c.
References complexity_add(), complexity_check_and_warn(), complexity_fprint(), complexity_rm(), expression_to_complexity(), expression_undefined_p, fprintf(), get_bool_property(), pips_internal_error, range_increment, range_lower, range_upper, trace_off(), and trace_on().
Referenced by loop_to_complexity(), and syntax_to_complexity().
complexity range_to_polynome | ( | range | , |
transformer | , | ||
list | , | ||
bool | , | ||
int | |||
) |
complexity reference_to_complexity | ( | reference | ref, |
basic * | pbasic, | ||
transformer | precond, | ||
list | effects_list | ||
) |
1st element of syntax
reference_to_complexity: return the complexity of the computing of the indices plus the complexity of one memory read Also return basic type of variable in *pbasic.
indices basic
ci=compindexation, ca=compaccess
ci=compindexation counts multi-dimension arrays indexation costs
ref | ef |
pbasic | basic |
precond | recond |
effects_list | ffects_list |
Definition at line 952 of file comp_scan.c.
References basic_complex_p, basic_derived_p, basic_float_p, basic_int_p, basic_logical_p, basic_pointer_p, basic_string_p, basic_tag, complexity_add(), complexity_check_and_warn(), complexity_fprint(), complexity_rm(), entity_basic_concrete_type(), entity_name, entity_register_p(), FIVE_INDEX_NAME, FOUR_INDEX_NAME, fprintf(), gen_length(), get_bool_property(), indices_to_complexity(), intrinsic_cost(), MAKE_ADDRESS_BASIC, make_constant_complexity(), MAKE_INT_BASIC, MAKE_STRING_BASIC, make_zero_complexity(), MEMORY_READ_NAME, module_local_name(), ONE_INDEX_NAME, ref, reference_indices, reference_variable, SEVEN_INDEX_NAME, simple_basic_dup(), SIX_INDEX_NAME, THREE_INDEX_NAME, trace_off(), trace_on(), TWO_INDEX_NAME, type_variable, user_warning, and variable_basic.
Referenced by syntax_to_complexity().
complexity reference_to_polynome | ( | reference | ref, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
First element of the "syntax" domain.
bool must_be_written;
if it's an array: let us fail
We keep this symbol in the polynome
ref | ef |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 307 of file comp_expr_to_pnome.c.
References complexity_varcount, evaluate_var_to_complexity(), get_bool_property(), hash_complexity_parameters, hash_contains_p, make_polynome(), make_zero_complexity(), module_local_name(), NIL, polynome_rm(), polynome_to_new_complexity(), ref, reference_indices, reference_variable, trace_off(), trace_on(), VALUE_ONE, and varcount_symbolic.
Referenced by syntax_to_polynome().
void remove_common_variables_from_hash_table | ( | entity | module, |
hash_table | hash_complexity_params | ||
) |
module | odule |
hash_complexity_params | ash_complexity_params |
Definition at line 985 of file comp_util.c.
References action_read_p, approximation_exact_p, CAR, db_get_memory_resource(), EFFECT, effect_action, effect_any_reference, effect_approximation, effects_to_list(), entity_module_p(), fprintf(), get_bool_property(), hash_del(), MAPL, module, module_local_name(), module_name(), pips_assert, and reference_variable.
Referenced by any_complexities().
void remove_formal_parameters_from_hash_table | ( | entity | mod, |
hash_table | hash_complexity_params | ||
) |
mod | od |
hash_complexity_params | ash_complexity_params |
Definition at line 791 of file comp_util.c.
References CAR, code_declarations, ENTITY, entity_initial, entity_module_p(), entity_name, entity_storage, fprintf(), get_bool_property(), hash_del(), MAPL, module_local_name(), pips_assert, storage_formal_p, and value_code.
Referenced by any_complexities().
complexity replace_formal_parameters_by_real_ones | ( | complexity | comp, |
entity | mod, | ||
list | args, | ||
transformer | precond, | ||
list | effects_list | ||
) |
transform formal params into real ones (args) in complexity comp
print out the entity name for debugging purpose
if formal parameter...
minus one because offsets start at 1 not 0
comp | omp |
mod | od |
args | rgs |
precond | recond |
effects_list | ffects_list |
Definition at line 519 of file comp_math.c.
References CAR, code_declarations, complexity_dup(), complexity_rm(), complexity_var_subst(), ENTITY, entity_initial, entity_module_p(), entity_name, entity_storage, EXACT_VALUE, EXPRESSION, expression_to_complexity_polynome(), FOREACH, formal_offset, fprintf(), gen_nthcdr(), get_bool_property(), KEEP_SYMBOLS, pips_assert, storage_formal, storage_formal_p, value_code, and variable_name().
Referenced by call_to_complexity().
void reset_complexity_map | ( | void | ) |
Referenced by any_complexities(), bdsc_code_instrumentation(), computation_intensity(), dsc_code_parallelization(), generic_print_xml_application(), hbdsc_parallelization(), if_conversion_init(), print_code_or_source_comp(), print_xml_code(), and summary_complexity().
void set_complexity_map | ( | statement_mapping | ) |
Referenced by any_complexities(), bdsc_code_instrumentation(), computation_intensity(), dsc_code_parallelization(), hbdsc_parallelization(), if_conversion_init(), print_code_or_source_comp(), print_xml_code(), and summary_complexity().
complexity simplify_sc_to_complexity | ( | Psysteme | ps, |
Variable | var | ||
) |
This function is recently added by L.Zhou June 5, 91 simplify_sc_to_complexity(Psysteme ps, Variable var) It looks for the egality formula containing (Variable)var in the system (Psysteme)ps.
If ps->egalites is NULL, zero complexity is returned. The rest of the variable in that formula should be the known variable for example: formal parameter(s), inductible variable, etc. EX: M1 - M2 = 1 where M1 is formal parameter where M2 is an inductible variable This function returns M2 = M1 - 1 packed in the polynomial of the complexity the statistics of this complexity should be all zero.
ps | s |
var | ar |
Definition at line 798 of file comp_expr_to_pnome.c.
References complexity_add(), complexity_rm(), complexity_scalar_mult(), complexity_varcount, CONTRAINTE_UNDEFINED_P, get_bool_property(), hash_complexity_parameters, hash_contains_p, make_complexity_unknown(), make_constant_complexity(), make_single_var_complexity(), make_zero_complexity(), module_local_name(), noms_var(), sc_fprint(), Svecteur::succ, TCST, UNKNOWN_VARIABLE_NAME, Svecteur::val, VALUE_ONE, VALUE_TO_FLOAT, value_uminus, Svecteur::var, varcount_unknown, and VECTEUR_NUL_P.
Referenced by evaluate_var_to_complexity().
complexity statement_to_complexity | ( | statement | , |
transformer | , | ||
list | |||
) |
void store_statement_complexity | ( | statement | , |
complexity | |||
) |
complexity subscript_to_complexity | ( | subscript | sub, |
basic * | pbasic, | ||
transformer | precond, | ||
list | effects_list | ||
) |
G:let us assume . cost 1
sub | ub |
pbasic | basic |
precond | recond |
effects_list | ffects_list |
Definition at line 860 of file comp_scan.c.
References complexity_add(), complexity_float_add(), complexity_rm(), expression_to_complexity(), indices_to_complexity(), subscript_array, and subscript_indices.
Referenced by syntax_to_complexity().
bool summary_complexity | ( | const | string | ) |
summary_comp_dup = complexity_dup(summary_comp);
string | odule_name |
Definition at line 179 of file comp_scan.c.
References complexity_consistent_p(), COMPLEXITY_NOT_FOUND, copy_complexity(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, fprintf(), get_bool_property(), get_current_module_statement(), load_statement_complexity(), make_zero_complexity(), module_name(), pips_assert, pips_internal_error, reset_complexity_map(), reset_current_module_statement(), set_complexity_map(), set_current_module_statement(), strdup(), trace_off(), and trace_on().
complexity syntax_to_complexity | ( | syntax | s, |
basic * | pbasic, | ||
transformer | precond, | ||
list | effects_list | ||
) |
the only available element of expression
A cost for casting could be added, although casting is mostly used for typing issue. However, (float) 2 has a cost.
TypeCast operation added by Molka Becher to complexity_cost_tables for handling the cost of cast when it is necessary, 24 March 2011
Compiler generated constant: equivalent to a constant load --> 0
pbasic | basic |
precond | recond |
effects_list | ffects_list |
Definition at line 881 of file comp_scan.c.
References call_to_complexity(), cast_expression, complexity_add(), complexity_check_and_warn(), complexity_rm(), expression_to_complexity(), intrinsic_cost(), is_syntax_application, is_syntax_call, is_syntax_cast, is_syntax_range, is_syntax_reference, is_syntax_sizeofexpression, is_syntax_subscript, is_syntax_va_arg, make_constant_complexity(), MAKE_INT_BASIC, make_zero_complexity(), pips_internal_error, range_to_complexity(), reference_to_complexity(), sizeofexpression_expression, sizeofexpression_expression_p, subscript_to_complexity(), syntax_call, syntax_cast, syntax_range, syntax_reference, syntax_sizeofexpression, syntax_subscript, syntax_tag, trace_off(), trace_on(), and TYPE_CAST_COST.
Referenced by expression_to_complexity().
complexity syntax_to_polynome | ( | syntax | synt, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
1st element of expression
This expression cannot be used within a polynomial, just like an array reference
synt | ynt |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 166 of file comp_expr_to_pnome.c.
References call_to_polynome(), cast_to_polynome(), is_syntax_application, is_syntax_call, is_syntax_cast, is_syntax_range, is_syntax_reference, is_syntax_sizeofexpression, is_syntax_subscript, is_syntax_va_arg, make_zero_complexity(), pips_internal_error, range_to_polynome(), reference_to_polynome(), syntax_call, syntax_cast, syntax_range, syntax_reference, syntax_tag, trace_off(), and trace_on().
Referenced by expression_to_complexity_polynome().
complexity test_to_complexity | ( | test | test_instr, |
transformer | precond, | ||
list | effects_list | ||
) |
2nd element of instruction
test_instr | est_instr |
precond | recond |
effects_list | ffects_list |
Definition at line 414 of file comp_scan.c.
References complexity_add(), complexity_check_and_warn(), complexity_dup(), complexity_fprint(), complexity_ifcount, complexity_rm(), complexity_scalar_mult(), complexity_zero_p(), expression_to_complexity(), fprintf(), get_bool_property(), ifcount_halfhalf, statement_to_complexity(), test_condition, test_false, test_true, trace_off(), and trace_on().
Referenced by instruction_to_complexity().
void trace_off | ( | void | ) |
"trace off"
Definition at line 714 of file comp_util.c.
References call_level, fprintf(), free(), get_bool_property(), INDENT_BACK, INDENT_BLANKS, INDENT_INTERVAL, INDENT_VLINE, malloc(), and strdup().
Referenced by any_complexities(), arguments_to_complexity(), block_to_complexity(), call_to_complexity(), call_to_polynome(), cast_to_polynome(), evaluate_var_to_complexity(), expression_to_complexity(), expression_to_complexity_polynome(), indices_to_complexity(), instruction_to_complexity(), loop_to_complexity(), new_block_to_complexity(), normalized_to_polynome(), pvecteur_to_polynome(), range_to_complexity(), range_to_polynome(), reference_to_complexity(), reference_to_polynome(), statement_to_complexity(), summary_complexity(), syntax_to_complexity(), syntax_to_polynome(), test_to_complexity(), and unstructured_to_complexity().
void trace_on | ( | char * | fmt, |
... | |||
) |
fmt | mt |
Definition at line 684 of file comp_util.c.
References call_level, fprintf(), free(), get_bool_property(), INDENT_BACK, INDENT_BLANKS, INDENT_INTERVAL, INDENT_VLINE, malloc(), and strdup().
Referenced by any_complexities(), arguments_to_complexity(), block_to_complexity(), call_to_complexity(), call_to_polynome(), cast_to_polynome(), evaluate_var_to_complexity(), expression_to_complexity(), expression_to_complexity_polynome(), indices_to_complexity(), instruction_to_complexity(), loop_to_complexity(), new_block_to_complexity(), normalized_to_polynome(), pvecteur_to_polynome(), range_to_complexity(), range_to_polynome(), reference_to_complexity(), reference_to_polynome(), statement_to_complexity(), summary_complexity(), syntax_to_complexity(), syntax_to_polynome(), test_to_complexity(), and unstructured_to_complexity().
complexity translate_complexity_from_local_to_current_name | ( | complexity | callee_comp, |
string | oldname, | ||
string | newname | ||
) |
translate_complexity_from_local_to_current_name(callee_comp,oldname,newname) B:M -> A:M if A calls B 5 Feb.
93 LZ
This is not general enough to handle: B:M -> A:N or B:M to A:N+1 FI, 3 March 1994
constant complexity
The basis associated to a polynomial includes the constant term!
constant complexity
callee_comp | allee_comp |
oldname | ldname |
newname | ewname |
Definition at line 1100 of file comp_util.c.
References base_dimension, BASE_NULLE_P, BASE_UNDEFINED, chunk_undefined, complexity_dup(), complexity_polynome(), complexity_var_subst(), concatenate(), int, is_inferior_pvarval(), make_single_var_complexity(), make_zero_complexity(), malloc(), name_to_variable(), polynome_used_var(), strdup(), Svecteur::succ, term_cst, Svecteur::var, variable_name(), and VECTEUR_NUL.
Referenced by fetch_callees_complexities().
complexity unary_minus_op_handler | ( | list | args, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
args | rgs |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 527 of file comp_expr_to_pnome.c.
References CAR, complexity_rm(), complexity_sub(), EXPRESSION, expression_to_complexity_polynome(), and make_zero_complexity().
Referenced by call_to_polynome().
complexity unary_plus_op_handler | ( | list | args, |
transformer | precond, | ||
list | effects_list, | ||
bool | keep_symbols, | ||
int | maximize | ||
) |
args | rgs |
precond | recond |
effects_list | ffects_list |
keep_symbols | eep_symbols |
maximize | aximize |
Definition at line 545 of file comp_expr_to_pnome.c.
References CAR, EXPRESSION, and expression_to_complexity_polynome().
declares the static variable complexity_map and defines its access functions
bool complexities(module_name) Entry point called by the pips makefile
"hash_callee_to_complexity" contains a list of summary_complexity of callees, Non-recursive: callees complexities are supposed to be computed when arriving here.
"hash_complexity_parameters" contains the list of variables that we don't want to evaluate; so they will appear in the polynomial. All other variables (except for the loop indices) are evaluated as the scan proceeds, thanks to semantic analysis. Those which can't be evaluated are replaced by the pseudo-variable UNKNOWN_VARIABLE, which will be given an arbitrary value at the end of the evaluation.
module_name | odule_name |
Definition at line 79 of file comp_scan.c.
References any_complexities(), and module_name().
complexity unstructured_to_complexity | ( | unstructured | unstr, |
transformer | precond, | ||
list | effects_list | ||
) |
complexity unstructured_to_complexity(unstructured unstr; transformer precond; list effects_list;
Return the complexity of the unstructured graph unstr whose nodes are controls.
First runs through the graph to compute nodes' complexities, the total number of nodes, and give a number to each node. This is done in "controls_to_hash_table()".
Then runs again through it to fill the probability matrix [Pij] ( Pij = probability to go to node j when you're in node i) This is done in "build_probability_matrix()"
Then computes A = I-P, then inv_A = 1/A with the matrix package.
MAX_CONTROLS_IN_UNSTRUCTURED = 100
A is identity matrix I
B = A - P = I - P
matrice_general_inversion(B, A, n_controls);
A = 1/(B)
This region will call C routines. LZ 20/10/92
the "global" complexity is: comp = a11 * C1 + a12 * C2 + ... + a1n * Cn where Ci = complexity of control #i
Modif by AP, March 15th 93: old version had non constant int in dim decl float fa[n_controls][n_controls]; int indx[n_controls]; int d;
unstr | nstr |
precond | recond |
effects_list | ffects_list |
Definition at line 75 of file comp_unstr.c.
References A, ACCESS, average_probability_matrix(), B, complexity_add(), complexity_check_and_warn(), complexity_fprint(), complexity_scalar_mult(), controls_to_hash_table(), DENOMINATOR, f(), f2(), FA, float_matrice_inversion(), fprintf(), get_debug_level(), hash_get(), hash_pointer, hash_table_free(), hash_table_make(), make_zero_complexity(), malloc(), matrice_fprint(), matrice_free, matrice_identite(), matrice_new, matrice_substract(), MAX_CONTROLS_IN_UNSTRUCTURED, pips_internal_error, trace_off(), trace_on(), unstructured_control, and VALUE_TO_FLOAT.
Referenced by instruction_to_complexity().
void update_statement_complexity | ( | statement | , |
complexity | |||
) |
char* variable_local_name | ( | Variable | var | ) |
var | ar |
Definition at line 95 of file polynome_ri.c.
References chunk_undefined, entity_minimal_name(), pips_internal_error, strdup(), TCST, and TCST_NAME.
Referenced by complexity_sprint(), final_statement_to_complexity_evaluation(), is_inferior_pvarval(), is_inferior_var(), and is_inferior_varval().
char* variable_name | ( | Variable | var | ) |
This file gathers some functions interfacing polynomial library and the RI.
The "Variable" type used by polynomials is casted to "entity", the "Value" type, to int.
char *variable_name(Variable var) return the complete name of the entity var
char *variable_local_name(Variable var) return the abbreviated, local name of var
bool is_inferior_var(Variable var1, var2) return true if the complete name of var1 is lexicographically before var2's one.
Variable name_to_variable(char *name) inverse function of variable_name. name must be the complete name of the variable. Modif: – entity_local_name is replaced by module_local_name. LZ 230993
FI: no longer useful
var | ar |
Definition at line 73 of file polynome_ri.c.
complexity whileloop_to_complexity | ( | whileloop | while_instr, |
transformer | precond, | ||
list | effects_list | ||
) |
5th element of instruction
while_instr | hile_instr |
precond | recond |
effects_list | ffects_list |
Definition at line 692 of file comp_scan.c.
References call_arguments, call_function, CAR, CDR, complexity_add(), complexity_check_and_warn(), complexity_fprint(), complexity_mult(), ENTITY_LESS_THAN_P, exp, EXPRESSION, expression_syntax, expression_to_complexity(), expression_to_complexity_polynome(), fprintf(), get_bool_property(), KEEP_SYMBOLS, make_complexity_unknown(), make_op_exp(), MINIMUM_VALUE, MINUS_OPERATOR_NAME, statement_to_complexity(), syntax_call, UNKNOWN_RANGE_NAME, whileloop_body, and whileloop_condition.
Referenced by instruction_to_complexity().
|
extern |
cproto-generated files
cproto-generated files
scan a ri expression and try to make a polynomial of it Modif: – entity_local_name is replaced by module_local_name. LZ 230993 – MAXINT replaced by INT_MAX, -MAXINT by INT_MIN FI 1/12/95 useful, pips_error is defined there
Definition at line 57 of file comp_scan.c.
Referenced by any_complexities(), and call_to_complexity().
|
extern |
Definition at line 58 of file comp_scan.c.
Referenced by any_complexities(), and loop_to_complexity().
|
extern |
The table intrinsic_cost_table[] gathers cost information of each intrinsic's cost; those costs are dynamically loaded from user files.
It also returns the "minimum" type of the result of each intrinsic, specified by its basic_tag and number of memory bytes. ("bigger" and "minimum" refer to the order relation defined in the routine "is_inferior_basic"; the tag is_basic_overloaded is used as a don't care tag) (ex: SIN has a type of FLOAT even if its arg is an INT)
Modif: – LOOP_OVERHEAD and CALL_OVERHEAD are added, 280993 LZ – LOOP_OVERHEAD is divided into two: INIT and BRAANCH 081093 LZ
Definition at line 286 of file comp_util.c.
Referenced by fprint_cost_table(), intrinsic_cost(), and load_cost_file().