PIPS
|
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "database.h"
#include "ri-util.h"
#include "effects-util.h"
#include "constants.h"
#include "misc.h"
#include "text.h"
#include "boolean.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "sommet.h"
#include "ray_dte.h"
#include "sg.h"
#include "polyedre.h"
#include "union.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
#include "semantics.h"
#include "transformer.h"
#include "pipsdbm.h"
#include "resources.h"
Go to the source code of this file.
Macros | |
#define | BACKWARD TRUE |
#define | FORWARD FALSE |
Functions | |
bool | same_reg_ignore_action (region reg1, region reg2) |
put reg in list of one element for call to alias_pairs More... | |
static bool | member (region reg, list reg_list) |
tests if reg and any member of reg_list are same_reg_ignore_action More... | |
list | append_reg_if_not_present (list reg_list, region reg) |
adds reg as final element on the end of reg_list unless reg is already present in reg_list More... | |
static bool | add_pair_to_existing_list (list alias_pair) |
GLOBAL IN: l_alias_lists GLOBAL OUT: l_alias_lists. More... | |
bool | alias_lists (const char *module_name) |
GLOBAL OUT: l_alias_lists. More... | |
Variables | |
static list | l_alias_lists = NIL |
#define BACKWARD TRUE |
Definition at line 64 of file sav_alias_lists.c.
#define FORWARD FALSE |
Definition at line 65 of file sav_alias_lists.c.
GLOBAL IN: l_alias_lists GLOBAL OUT: l_alias_lists.
Definition at line 332 of file sav_alias_lists.c.
References ACTION_IN, ACTION_OUT, append_reg_if_not_present(), CAR, CDR, EFFECT, ifdebug, l_alias_lists, LIST, NIL, pips_debug, print_inout_regions(), print_region, region, reset_action_interpretation(), same_reg_ignore_action(), and set_action_interpretation().
Referenced by alias_lists().
bool alias_lists | ( | const char * | module_name | ) |
GLOBAL OUT: l_alias_lists.
list in_alias_pairs, out_alias_pairs, in_alias_pair, out_alias_pair;
ATTENTION: we have to do ALL this just to call print_inout_regions for debug !!
that's it, but we musn't forget to reset everything below
make alias lists from the IN_alias_pairs
DBR_IN_ALIAS_PAIRS is a newgen structure of type effects_classes which has one field called classes which is a list of newgen structures of type effects (and each newgen structure of type effects has one field called effects which is a list of elements of type effect)
wrong but did work:
in_alias_pairs = effects_to_list((effects) db_get_memory_resource(DBR_IN_ALIAS_PAIRS, module_name, true));
seems right but didn't work (gets 2nd element of each pair only):
MAP(EFFECTS, alias_pair_effects, { list alias_pair = effects_effects(alias_pair_effects);
make alias lists from the OUT_alias_pairs
check all callees for sub-regions of existing aliases
make_alias_lists_for_sub_regions(module_name);
Definition at line 389 of file sav_alias_lists.c.
References add_pair_to_existing_list(), CONS, db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, effects_classes_classes, free_value_mappings(), gen_nconc(), get_current_module_entity(), ifdebug, in_alias_pairs(), l_alias_lists, LIST, local_name_to_top_level_entity(), make_effects_classes(), MAP, module, module_name(), module_to_value_mappings(), NIL, out_alias_pairs(), pips_debug, print_inout_regions(), regions_dup(), reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_proper_rw_effects(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_proper_rw_effects(), and strdup().
adds reg as final element on the end of reg_list unless reg is already present in reg_list
Definition at line 299 of file sav_alias_lists.c.
References CONS, EFFECT, gen_nconc(), member(), NIL, pips_debug, and region_dup().
Referenced by add_pair_to_existing_list(), and append_all_not_present().
tests if reg and any member of reg_list are same_reg_ignore_action
Definition at line 257 of file sav_alias_lists.c.
References CAR, CDR, EFFECT, NIL, pips_debug, region, rest_list, and same_reg_ignore_action().
Referenced by append_reg_if_not_present().
put reg in list of one element for call to alias_pairs
l_pairs = alias_pairs( module_name, CONS(EFFECT,reg,NIL) ); turn list_pairs into an alias list alias_list = CONS(EFFECT,reg,NIL); MAP(EFFECTS,alias_pair, { alias_list = gen_nconc(alias_list,CDR(alias_pair)); }, l_pairs); l_alias_lists = gen_nconc(l_alias_lists,CONS(LIST,alias_list,NIL)); } if there is no alias for reg in this module if ( no_alias_for(reg) ) { for each alias_list=[alias_reg|list_trans_alias_reg] of this module,... MAP(LIST,alias_list, { alias_reg = EFFECT( CAR(alias_list) ); ... except for COMMON region alias_lists, do if ( ! storage_ram_p( entity_storage(region_entity(alias_reg)) )) { see if reg is properly included in alias_reg if ( effects_same_action_p(alias_reg,reg) ) { reg_sys = region_system(reg); alias_reg_sys = region_system(alias_reg); if (sc_inclusion_p_ofl(reg_sys,alias_reg_sys) && ! sc_inclusion_p_ofl(alias_reg_sys,reg_sys) ) and, if so, add alias list for reg to this module make_alias_list_sub_region(reg,module_name);
} } }, l_alias_lists); } } we need the callees of the current module
module_callees = (callees) db_get_memory_resource(DBR_CALLEES, module_name, true); for each callee do MAP(STRING, callee_name, { callee_alias_lists = (list) db_get_memory_resource(DBR_ALIAS_LISTS, callee_name, true); for each alias list do MAP(EFFECTS, alias_list_effects, { list callee_alias_list = regions_dup(effects_to_list(alias_list_effects)); don't treat COMMON regions if ( ! storage_ram_p( entity_storage(region_entity(EFFECT(CAR(callee_alias_list)))) )) { for any alias in this module do MAP(EFFECT, trans_reg, { if ( module_entity == region_entity(trans_reg) ) if it is a sub-region of an IN or OUT region of this module then make an alias list for it in this module make_alias_list_if_sub_region(trans_reg, module_name); }, CDR(callee_alias_list)); }
}, callee_alias_lists); }, callees_callees(module_callees)); } tests if reg1 and reg2 are the same, ignoring their action_tags (read/write) but checking their precision (may/exact)
Definition at line 213 of file sav_alias_lists.c.
References effect_approximation_tag, effect_entity(), effect_undefined_p, pips_debug, region_system, and sc_equal_p_ofl.
Referenced by add_pair_to_existing_list(), compare_other_list(), match_this_callee_class_elem(), and member().
Definition at line 67 of file sav_alias_lists.c.
Referenced by add_pair_to_existing_list(), and alias_lists().