PIPS
|
#include <ctype.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "workspace-util.h"
#include "effects-util.h"
#include "text.h"
#include "pipsdbm.h"
#include "resources.h"
#include "properties.h"
#include "misc.h"
#include "control.h"
#include "conversion.h"
#include "expressions.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
#include "text-util.h"
#include "parser_private.h"
#include "semantics.h"
#include "transformer.h"
#include "accel-util.h"
Go to the source code of this file.
Functions | |
static bool | do_solve_hardware_constraints_on_nb_proc (entity e, statement s) |
static bool | do_solve_hardware_constraints_on_volume (entity unknown, statement s) |
static bool | do_solve_hardware_constraints (statement s) |
the equation is given by sum(e) { | REGION_READ(e) U REGION_WRITE(e) | } < VOLUME More... | |
bool | solve_hardware_constraints (const char *module_name) |
constraints.c More... | |
the equation is given by sum(e) { | REGION_READ(e) U REGION_WRITE(e) | } < VOLUME
retreive the unknown variable {
}
Definition at line 248 of file constraints.c.
References do_solve_hardware_constraints_on_nb_proc(), do_solve_hardware_constraints_on_volume(), entity_undefined_p, get_current_module_entity(), get_string_property(), pips_user_error, same_string_p, and string_to_entity().
Referenced by solve_hardware_constraints().
add a new constraint to the system
check we have not already dealt with this variable
get the associated read and write regions
compute their convex hull
solve the equation if it is linear
create a system with preconditions information and the constraint limit
find numerical constraints over unknown e
SG: this is over optimistic, we should verify all elements of soluce are store-independant
welcome in the real life (RK(C) we cannot solve this equation at commile time ... never mind let's do it at runtime !
Definition at line 58 of file constraints.c.
References base_rm, CAR, constraints_for_bounds(), constraints_to_loop_bound(), contrainte_make(), CONTRAINTE_UNDEFINED_P, DIVIDE_OPERATOR_NAME, entity_array_p(), entity_initial, entity_intrinsic(), entity_user_name(), EXPRESSION, expression_normalized, expression_to_entity(), expression_undefined, expression_undefined_p, expressions_to_entities(), find_region_on_entity(), FOREACH, free_transformer(), free_value(), gen_free_list(), get_int_property(), int_to_expression(), list_to_base(), load_cumulated_rw_effects_list(), load_statement_precondition(), make_op_exp(), make_value_expression(), MakeBinaryCall(), max, MAX_OPERATOR_NAME, min, MINUS_OPERATOR_NAME, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, pips_user_error, PLUS_OPERATOR_NAME, predicate_system, reference_indices, reference_variable, region, REGION, region_any_reference, region_system, region_undefined_p, regions_must_convex_hull(), regions_read_regions(), regions_write_regions(), sc_add_egalite(), sc_add_inegalite(), sc_dup(), sc_minmax_of_variable(), sc_rectangular_hull(), set_add_element(), set_belong_p(), set_free(), set_make(), set_pointer, simplify_minmax_expression(), TCST, transformer_range(), transformer_relation, Value_to_expression(), vect_add_elem(), and vect_new().
Referenced by do_solve_hardware_constraints().
check we have not already dealt with this variable
get the associated read and write regions
compute their convex hull
create a string representation of all polynomials gathered
try to solve the polynomial
this takes the floor of the floating point expression ...
insert solution ~ this is an approximation ! it only works if root is increasing
tidy
Definition at line 160 of file constraints.c.
References entity_array_p(), entity_to_expression(), entity_user_name(), expression_constant_p(), expression_integer_constant_p(), expression_integer_value(), expression_to_float(), expression_undefined, find_region_on_entity(), FOREACH, free_expression(), free_transformer(), gen_free_list(), get_current_module_statement(), get_int_property(), insert_statement(), int, int_to_expression(), intptr_t, load_cumulated_rw_effects(), load_cumulated_rw_effects_list(), load_statement_precondition(), make_assign_statement(), monome_constant_new, monome_rm(), partial_eval_expression_and_regenerate(), pips_user_error, polynome_add(), polynome_monome_add(), POLYNOME_NUL, polynome_rm(), polynome_roots(), polynome_to_expression(), POLYNOME_UNDEFINED_P, predicate_system, reference_variable, region, REGION, region_any_reference, region_enumerate(), region_undefined_p, regions_must_convex_hull(), regions_read_regions(), regions_write_regions(), set_add_element(), set_belong_p(), set_free(), set_make(), set_pointer, transformer_range(), transformer_relation, vect_rm(), VECTEUR_NUL_P, vecteur_succ, VECTEUR_UNDEFINED_P, and vecteur_var.
Referenced by do_solve_hardware_constraints().
bool solve_hardware_constraints | ( | const char * | module_name | ) |
validate
module_name | odule_name |
Definition at line 267 of file constraints.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, do_solve_hardware_constraints(), find_statement_from_label_name(), free_value_mappings(), get_current_module_entity(), get_current_module_name(), get_current_module_statement(), get_string_property(), module_name(), module_name_to_entity(), module_reorder(), module_to_value_mappings(), reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_precondition_map(), reset_proper_rw_effects(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_precondition_map(), set_proper_rw_effects(), and statement_undefined_p.