osprey/kg++fe/gnu/ra-colorize.c File Reference

#include "config.h"
#include "system.h"
#include "rtl.h"
#include "tm_p.h"
#include "function.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "basic-block.h"
#include "df.h"
#include "output.h"
#include "ra.h"

Include dependency graph for ra-colorize.c:

Go to the source code of this file.

Data Types

type  web_pair

Defines

#define INV_REG_ALLOC_ORDER(c)   c
#define set_cand(i, w)
#define WEB_PAIR_HASH_SIZE   8192

Functions/Subroutines

static void push_list PARAMS ((struct dlist *, struct dlist **))
static void free_dlist PARAMS ((struct dlist **))
static void put_web_at_end PARAMS ((struct web *, enum node_type))
static void put_move PARAMS ((struct move *, enum move_type))
static void build_worklists PARAMS ((struct df *))
static void enable_move PARAMS ((struct web *))
static void decrement_degree PARAMS ((struct web *, int))
static void simplify PARAMS ((void))
static void remove_move_1 PARAMS ((struct web *, struct move *))
static int ok PARAMS ((struct web *, struct web *))
static unsigned int simplify_p PARAMS ((enum node_type))
static int color_usable_p PARAMS ((int, HARD_REG_SET, HARD_REG_SET, enum machine_mode))
int get_free_reg PARAMS ((HARD_REG_SET, HARD_REG_SET, enum machine_mode))
static int get_biased_reg PARAMS ((HARD_REG_SET, HARD_REG_SET, HARD_REG_SET, HARD_REG_SET, enum machine_mode))
static int count_long_blocks PARAMS ((HARD_REG_SET, int))
static char *hardregset_to_string PARAMS ((HARD_REG_SET))
static void calculate_dont_begin PARAMS ((struct web *, HARD_REG_SET *))
static int comp_webs_maxcost PARAMS ((const void *, const void *))
static void add_web_pair_cost PARAMS ((struct web *, struct web *, unsigned HOST_WIDE_INT, unsigned int))
static void
sort_and_combine_web_pairs 
PARAMS ((int))
static void push_list (struct dlist *x, struct dlist **list)
static void push_list_end (struct dlist *x, struct dlist **list)
void remove_list (struct dlist *x, struct dlist **list)
struct dlistpop_list (struct dlist **list)
static void free_dlist (struct dlist **list)
void put_web (struct web *web, enum node_type type)
void reset_lists ()
static void put_web_at_end (struct web *web, enum node_type type)
void remove_web_from_list (struct web *web)
static void put_move (struct move *move, enum move_type type)
static void build_worklists (df)
static void enable_move (struct web *web)
static void decrement_degree (struct web *web, int dec)
static void simplify ()
static void remove_move_1 (struct web *web, struct move *move)
static void remove_move (struct web *web, struct move *move)
void merge_moves (struct web *u, struct web *v)
static void add_worklist (struct web *web)
static int ok (struct web *target, struct web *source)
static int conservative (struct web *target, struct web *source)
struct webalias (struct web *web)
static unsigned int simplify_p (enum node_type type)
static void combine (struct web *u, struct web *v)
static void coalesce ()
static void freeze_moves (struct web *web)
static void freeze ()
static unsigned HOST_WIDE_INT default_spill_heuristic (struct web *web)
static void select_spill ()
static int color_usable_p (int c, HARD_REG_SET dont_begin_colors, HARD_REG_SET free_colors, enum machine_mode mode)
int get_free_reg (HARD_REG_SET dont_begin_colors, HARD_REG_SET free_colors, enum machine_mode mode)
static int get_biased_reg (HARD_REG_SET dont_begin_colors, HARD_REG_SET bias, HARD_REG_SET prefer_colors, HARD_REG_SET free_colors, enum machine_mode mode)
static int count_long_blocks (HARD_REG_SET free_colors, int len)
static char * hardregset_to_string (HARD_REG_SET s)
static void calculate_dont_begin (struct web *web, HARD_REG_SET *result)
static void colorize_one_web (struct web *web, int hard)
static void assign_colors ()
static void try_recolor_web (struct web *web)
static void insert_coalesced_conflicts ()
static int comp_webs_maxcost (void *w1, void *w2) const
static void recolor_spills ()
static void check_colors ()
static void unalias_web (struct web *web)
static void break_aliases_to_web (struct web *web)
static void break_precolored_alias (struct web *web)
static void restore_conflicts_from_coalesce (struct web *web)
static void break_coalesced_spills ()
static void init_web_pairs ()
static void add_web_pair_cost (struct web *web1, struct web *web2, unsigned HOST_WIDE_INT cost, unsigned int conflicts)
static int comp_web_pairs (void *w1, void *w2) const
static void sort_and_combine_web_pairs (int for_move)
static void aggressive_coalesce ()
static void extended_coalesce_2 ()
static void check_uncoalesced_moves ()
void ra_colorize_graph (struct df *df)
void ra_colorize_init ()
void ra_colorize_free_all ()

Variables

static struct dlistmv_worklist
static struct dlistmv_coalesced
static struct dlistmv_constrained
static struct dlistmv_frozen
static struct dlistmv_active
static struct web_pairweb_pair_hash [WEB_PAIR_HASH_SIZE]
static struct web_pairweb_pair_list
static unsigned int num_web_pairs


Define Documentation

#define INV_REG_ALLOC_ORDER ( c   )     c

Definition at line 1042 of file ra-colorize.c.

Referenced by get_free_reg().

#define set_cand ( i,
 ) 

Value:

do { \
        if (!candidates[(i)] \
      || (candidates[(i)]->spill_cost < (w)->spill_cost)) \
    candidates[(i)] = (w); \
    } while (0)

Referenced by colorize_one_web().

#define WEB_PAIR_HASH_SIZE   8192

Definition at line 2398 of file ra-colorize.c.

Referenced by add_web_pair_cost().


Function Documentation

static void add_web_pair_cost ( struct web web1,
struct web web2,
unsigned HOST_WIDE_INT  cost,
unsigned int  conflicts 
) [static]

static void add_worklist ( struct web web  )  [static]

Definition at line 559 of file ra-colorize.c.

References FREEZE, NUM_REGS, PRECOLORED, put_web(), remove_list(), SIMPLIFY, and WEBS.

Referenced by coalesce().

static void aggressive_coalesce (  )  [static]

struct web* alias ( struct web web  )  [read]

Definition at line 703 of file ra-colorize.c.

References COALESCED.

static void assign_colors (  )  [static]

static void break_aliases_to_web ( struct web web  )  [static]

static void break_coalesced_spills (  )  [static]

static void break_precolored_alias ( struct web web  )  [static]

static void build_worklists ( df   )  [static]

static void calculate_dont_begin ( struct web web,
HARD_REG_SET *  result 
) [static]

static void check_colors (  )  [static]

static void check_uncoalesced_moves (  )  [static]

static void coalesce (  )  [static]

static int color_usable_p ( int  c,
HARD_REG_SET  dont_begin_colors,
HARD_REG_SET  free_colors,
enum machine_mode  mode 
) [static]

Definition at line 1020 of file ra-colorize.c.

References HARD_REGNO_MODE_OK, HARD_REGNO_NREGS, i, size, and TEST_HARD_REG_BIT.

Referenced by colorize_one_web().

static void colorize_one_web ( struct web web,
int  hard 
) [static]

static void combine ( struct web u,
struct web v 
) [static]

static int comp_web_pairs ( void w1,
void w2 
) const [static]

Definition at line 2456 of file ra-colorize.c.

References web_pair::conflicts, web_pair::cost, p1, and p2.

Referenced by sort_and_combine_web_pairs().

static int comp_webs_maxcost ( void w1,
void w2 
) const [static]

Definition at line 1958 of file ra-colorize.c.

References web::spill_cost.

Referenced by build_worklists(), and recolor_spills().

static int conservative ( struct web target,
struct web source 
) [static]

static int count_long_blocks ( HARD_REG_SET  free_colors,
int  len 
) [static]

Definition at line 1136 of file ra-colorize.c.

References count, FIRST_PSEUDO_REGISTER, i, and TEST_HARD_REG_BIT.

Referenced by colorize_one_web().

static void decrement_degree ( struct web web,
int  dec 
) [static]

static unsigned HOST_WIDE_INT default_spill_heuristic ( struct web web  )  [static]

Definition at line 951 of file ra-colorize.c.

References flag_ra_break_aliases, HOST_WIDE_INT, and ret.

Referenced by ra_colorize_init().

static void enable_move ( struct web web  )  [static]

static void extended_coalesce_2 (  )  [static]

static void free_dlist ( struct dlist **  list  )  [static]

Definition at line 166 of file ra-colorize.c.

References NULL.

Referenced by reset_lists().

static void freeze (  )  [static]

Definition at line 932 of file ra-colorize.c.

References d, DLIST_WEB, FREEZE, freeze_moves(), pop_list(), put_web(), SIMPLIFY, and WEBS.

Referenced by ra_colorize_graph().

static void freeze_moves ( struct web web  )  [static]

static int get_biased_reg ( HARD_REG_SET  dont_begin_colors,
HARD_REG_SET  bias,
HARD_REG_SET  prefer_colors,
HARD_REG_SET  free_colors,
enum machine_mode  mode 
) [static]

int get_free_reg ( HARD_REG_SET  dont_begin_colors,
HARD_REG_SET  free_colors,
enum machine_mode  mode 
)

static char* hardregset_to_string ( HARD_REG_SET  s  )  [static]

Definition at line 1162 of file ra-colorize.c.

References c, HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_PRINT_HEX, i, and sprintf().

Referenced by colorize_one_web().

static void init_web_pairs (  )  [static]

Definition at line 2406 of file ra-colorize.c.

References memset, and NULL.

Referenced by aggressive_coalesce(), and extended_coalesce_2().

static void insert_coalesced_conflicts (  )  [static]

void merge_moves ( struct web u,
struct web v 
)

static int ok ( struct web target,
struct web source 
) [static]

Definition at line 573 of file ra-colorize.c.

References COALESCED, GET_MODE, HARD_REGNO_MODE_OK, HARD_REGNO_NREGS, hardreg2web, i, web::id, igraph, igraph_index, never_use_colors, conflict_link::next, sub_conflict::next, NULL, web::num_conflicts, NUM_REGS, num_webs, PRECOLORED, SELECT, size, sl, conflict_link::sub, sup_igraph, conflict_link::t, sub_conflict::t, TEST_BIT, TEST_HARD_REG_BIT, and wl.

Referenced by _bfd_coff_reloc_link_order(), _bfd_generic_reloc_link_order(), _bfd_m68hc11_elf_merge_private_bfd_data(), _bfd_mips_elf_merge_private_bfd_data(), _bfd_mmix_check_all_relocs(), _bfd_sh_align_load_span(), _cpp_create_definition(), _cpp_create_trad_definition(), _unit_bksp(), add_binding(), add_exception_specifier(), adjustl_intrinsic(), aggressive_coalesce(), analyze_iv_to_split_insn(), aout_link_reloc_link_order(), ar_sim(), assert_semantics(), assignment_stmt_semantics(), Attempt_Reshape(), attr_init_semantics(), avr_operand(), bfd_elf_gc_sections(), Bound_Difference_To_Linex(), c_parser_attributes(), calculate_live_on_entry(), call_list_semantics(), CFG_transformation(), cgraph_decide_inlining(), change_subscript(), Check_Arrays(), Check_Doacross_Sync_Coverage(), check_ext_dependent_givs(), check_for_constructors(), check_forall_triplet_for_index(), check_stat_variable(), check_uncoalesced_moves(), check_where_conformance(), Cif_Errstring(), cif_named_constant_rec(), class_can_hold_mode(), coalesce(), collect_source_relocs(), compute_removed_literals(), compute_text_actions(), const_init_semantics(), create_constructor_constant(), create_iso_definition(), create_namelist_descriptor(), create_runtime_array_constructor(), create_runtime_struct_constructor(), create_scalar_type_tbl(), create_strct_tbl(), cvrt_str_to_cn(), data_repeat_semantics(), Dep_Carried_Outside_Or_Zero(), directive_stmt_semantics(), discombobulate_structure_ref(), ecoff_reloc_link_order(), elf_gc_sections(), elf_link_add_object_symbols(), elf_link_input_bfd(), elf_reloc_link_order(), elfNN_ia64_merge_private_bfd_data(), else_stmt_semantics(), encode_decode_stmt_semantics(), enter_cmd_line_cc_define(), equivalence_semantics(), execute_fold_all_builtins(), expand_asm_operands(), expand_binop(), expand_case(), ffecom_2pass_advise_entrypoint(), ffedata_eval_offset_(), ffeequiv_layout_cblock(), ffeexpr_cb_comma_c_(), ffeintrin_is_intrinsic(), ffestc_establish_impletter_(), ffetarget_layout(), find_reg(), find_relaxable_sections(), find_reloads(), finish_spills(), Fiss_Gather_Inner_Loop(), fold_aggragate_expression(), fold_binary(), folder_driver(), forall_semantics(), frv_asm_out_constructor(), frv_asm_out_destructor(), gen_far_branch(), gen_forall_max_expr(), gen_internal_dope_vector(), grok_op_properties(), grokdeclarator(), grokfield(), grokfndecl(), iand_intrinsic(), ieee_object_p(), if_stmt_semantics(), init_caller_save(), init_whole_array(), RG::Insert(), insert_restore(), insert_save(), interpret_adjustl_intrinsic(), interpret_array_construct_opr(), interpret_binary_intrinsic_opr(), interpret_binary_opr(), interpret_concat_opr(), interpret_constructor(), interpret_csmg_opr(), interpret_cvmgt_opr(), interpret_implied_do(), interpret_index_opr(), interpret_max_min_opr(), interpret_ref(), interpret_repeat_intrinsic(), interpret_reshape_intrinsic(), interpret_shape_intrinsic(), interpret_sik_intrinsic(), interpret_size_intrinsic(), interpret_srk_intrinsic(), interpret_struct_construct_opr(), interpret_transfer_intrinsic(), interpret_trim_intrinsic(), interpret_ubound_intrinsic(), interpret_unary_intrinsic_opr(), interpret_unary_opr(), LU_MAT< T >::Inv(), invert_jump_1(), IPA_LNO_Annotate_Array_Call(), IPA_LNO_Annotate_Scalar_Call(), IPFEC_Query_Skiplist(), IPL_EX_Value_Evaluate(), lbound_intrinsic(), Linear_Expr_With_Mode(), mips_elf_perform_relocation(), no_conflict_p(), note_yacc_type(), open_mp_directive_semantics(), optimize_reshape(), output_pop_multiple(), output_push_multiple(), output_struct_ids(), parse_initializer(), LU_MAT< T >::Particular_Solution(), peel_loop_completely(), peel_loop_simple(), pp_base_format(), print_insn_avr(), print_insn_sh(), Projected_Region_From_St(), push_class_level_binding(), SD_INFO::Push_Memory_Nodes(), put_string_in_tmp(), Query_Skiplist(), read_in_module_tbl(), read_sytb_from_module_file(), relax_property_section(), relax_section(), CG_GROUPING::reserve_resource(), reshape_intrinsic(), resolve_ext_opr(), rewrite_use_outer(), Row_Echelon(), scan_fortran_macro(), scan_linker_output(), scan_parameters(), set_multilib_dir(), shape_intrinsic(), size_offset_binary_calc(), size_offset_logical_calc(), size_offset_min_max_calc(), SNL_GEN_2D_Regtile(), SNL_GEN_U_Ctiling(), SNL_INV_Compact_Scalar_Expand(), SNL_INV_Scalar_Expand(), SNL_Peel_Iteration(), Solve_For(), sort_and_combine_web_pairs(), split_branches(), supplement_binding(), SWP_Bundle_First_In_Group(), SWP_Bundle_Next_Cycle(), SWP_Bundle_Next_In_Group(), tagged_types_tu_compatible_p(), transfer_intrinsic(), tree_unroll_loop(), SNL_DEP_INFO::U_Fully_Permutable(), ubound_intrinsic(), Unit_Stride_Reference(), Unroll_Dowhile_Loop(), unroll_loop_constant_iterations(), unroll_loop_runtime_iterations(), unroll_loop_stupid(), Upper_Bound_Standardize(), validate_char_len(), validate_kind(), vax_float_literal(), vect_analyze_data_ref_accesses(), vect_analyze_loop(), vect_analyze_operations(), where_stmt_semantics(), WN_add_lno_info(), WN_dup_dep_vertex(), WN_Solve_For(), WN_Upper_Bound_Standardize(), xcoff_reloc_link_order(), and xtensa_callback_required_dependence().

static void sort_and_combine_web_pairs PARAMS ( (int)   )  [static]

static void add_web_pair_cost PARAMS ( (struct web *, struct web *, unsigned HOST_WIDE_INT, unsigned int)   )  [static]

static int comp_webs_maxcost PARAMS ( (const void *, const void *)   )  [static]

static void calculate_dont_begin PARAMS ( (struct web *, HARD_REG_SET *)   )  [static]

static char* hardregset_to_string PARAMS ( (HARD_REG_SET)   )  [static]

static int count_long_blocks PARAMS ( (HARD_REG_SET, int)   )  [static]

static int get_biased_reg PARAMS ( (HARD_REG_SET, HARD_REG_SET, HARD_REG_SET, HARD_REG_SET, enum machine_mode  )  [static]

int get_free_reg PARAMS ( (HARD_REG_SET, HARD_REG_SET, enum machine_mode  ) 

static int color_usable_p PARAMS ( (int, HARD_REG_SET, HARD_REG_SET, enum machine_mode  )  [static]

static unsigned int simplify_p PARAMS ( (enum node_type  )  [inline, static]

static int ok PARAMS ( (struct web *, struct web *)   )  [static]

static void remove_move_1 PARAMS ( (struct web *, struct move *)   )  [static]

static void simplify PARAMS ( (void  )  [static, read]

Definition at line 77 of file cplus-dem.c.

static void decrement_degree PARAMS ( (struct web *, int)   )  [static]

static void enable_move PARAMS ( (struct web *)   )  [static]

static void build_worklists PARAMS ( (struct df *)   )  [static]

static void put_move PARAMS ( (struct move *, enum move_type  )  [static]

static void put_web_at_end PARAMS ( (struct web *, enum node_type  )  [static]

static void free_dlist PARAMS ( (struct dlist **)   )  [static]

static void push_list PARAMS ( (struct dlist *, struct dlist **)   )  [static]

struct dlist* pop_list ( struct dlist **  list  )  [read]

static void push_list ( struct dlist x,
struct dlist **  list 
) [static]

Definition at line 103 of file ra-colorize.c.

References abort, and dlist::prev.

Referenced by put_move(), and put_web().

static void push_list_end ( struct dlist x,
struct dlist **  list 
) [static]

Definition at line 116 of file ra-colorize.c.

References abort, dlist::next, and dlist::prev.

Referenced by put_web_at_end().

static void put_move ( struct move move,
enum move_type  type 
) [inline, static]

void put_web ( struct web web,
enum node_type  type 
) [inline]

static void put_web_at_end ( struct web web,
enum node_type  type 
) [static]

Definition at line 274 of file ra-colorize.c.

References abort, INITIAL, PRECOLORED, push_list_end(), SIMPLIFY, and WEBS.

Referenced by unalias_web().

void ra_colorize_free_all (  ) 

void ra_colorize_graph ( struct df df  ) 

void ra_colorize_init (  ) 

Definition at line 2713 of file ra-colorize.c.

References default_spill_heuristic().

Referenced by init_ra().

static void recolor_spills (  )  [static]

void remove_list ( struct dlist x,
struct dlist **  list 
)

static void remove_move ( struct web web,
struct move move 
) [static]

Definition at line 520 of file ra-colorize.c.

References abort, move_list::move, move_list::next, and remove_move_1().

Referenced by coalesce(), and freeze_moves().

static void remove_move_1 ( struct web web,
struct move move 
) [static]

Definition at line 497 of file ra-colorize.c.

References move_list::move, and move_list::next.

Referenced by remove_move().

void remove_web_from_list ( struct web web  ) 

void reset_lists (  ) 

static void restore_conflicts_from_coalesce ( struct web web  )  [static]

static void select_spill (  )  [static]

static void simplify (  )  [static]

static unsigned int simplify_p ( enum node_type  type  )  [inline, static]

Definition at line 715 of file ra-colorize.c.

References SIMPLIFY, SIMPLIFY_FAT, and SIMPLIFY_SPILL.

Referenced by combine().

static void sort_and_combine_web_pairs ( int  for_move  )  [static]

static void try_recolor_web ( struct web web  )  [static]

static void unalias_web ( struct web web  )  [static]


Variable Documentation

struct dlist * mv_active [static]

Definition at line 98 of file ra-colorize.c.

Definition at line 97 of file ra-colorize.c.

Definition at line 97 of file ra-colorize.c.

struct dlist* mv_frozen [static]

Definition at line 98 of file ra-colorize.c.

Definition at line 97 of file ra-colorize.c.

unsigned int num_web_pairs [static]

Definition at line 2401 of file ra-colorize.c.

struct web_pair* web_pair_hash[WEB_PAIR_HASH_SIZE] [static]

Definition at line 2399 of file ra-colorize.c.

Definition at line 2400 of file ra-colorize.c.


Generated on Wed Apr 8 15:42:12 2009 for Open64 by  doxygen 1.5.6