From 49767c8d776294632fec1ffa7037a5ec67c7934a Mon Sep 17 00:00:00 2001 From: vmakarov Date: Thu, 26 Jun 2008 18:48:21 +0000 Subject: [PATCH] 2008-06-26 Kenneth Zadeck * ira-conflicts.c ira-color.c ira-lives.c ira-emit.c ira-build.c ira.c ira-costs.c : Fix comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ira@137155 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 ++ gcc/ira-build.c | 196 ++++++++++++++++++++---------------------- gcc/ira-color.c | 240 +++++++++++++++++++++++++--------------------------- gcc/ira-conflicts.c | 76 ++++++++--------- gcc/ira-costs.c | 16 ++-- gcc/ira-emit.c | 88 +++++++++---------- gcc/ira-lives.c | 90 ++++++++++---------- gcc/ira.c | 212 +++++++++++++++++++++++----------------------- 8 files changed, 447 insertions(+), 476 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 73d73ac0e55..29a91df0aed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-06-26 Kenneth Zadeck + + * ira-conflicts.c ira-color.c ira-lives.c ira-emit.c ira-build.c + ira.c ira-costs.c : Fix comments. + 2008-06-11 Vladimir Makarov * caller-save.c (restore_con_fun_n, save_con_fun_n): Use loop diff --git a/gcc/ira-build.c b/gcc/ira-build.c index ce814f6f295..2d206ada42f 100644 --- a/gcc/ira-build.c +++ b/gcc/ira-build.c @@ -163,7 +163,7 @@ create_loop_tree_nodes (bool loops_p) } } -/* The function frees the loop tree node of a loop. */ +/* Free the loop tree node of a loop. */ static void finish_loop_tree_node (loop_tree_node_t loop) { @@ -179,7 +179,7 @@ finish_loop_tree_node (loop_tree_node_t loop) } } -/* The function frees the loop tree nodes. */ +/* Free the loop tree nodes. */ static void finish_loop_tree_nodes (void) { @@ -207,8 +207,8 @@ finish_loop_tree_nodes (void) -/* The following recursive function adds loop to the loop tree - hierarchy. The loop is added only once. */ +/* The following recursive function adds LOOP to the loop tree + hierarchy. LOOP is added only once. */ static void add_loop_to_tree (struct loop *loop) { @@ -250,9 +250,9 @@ add_loop_to_tree (struct loop *loop) } } -/* The recursive function sets up levels of nodes of the tree given - its root LOOP_NODE. The enumeration starts with LEVEL. The - function returns maximal value of level in the tree + 1. */ +/* The following recursive function sets up levels of nodes of the + tree given its root LOOP_NODE. The enumeration starts with LEVEL. + The function returns maximal value of level in the tree + 1. */ static int setup_loop_tree_level (loop_tree_node_t loop_node, int level) { @@ -274,10 +274,9 @@ setup_loop_tree_level (loop_tree_node_t loop_node, int level) return max_height; } -/* The following function creates the loop tree. The algorithm is - designed to provide correct order of loops (they are ordered by - their last loop BB) and basic blocks in the chain formed by member - next. */ +/* Create the loop tree. The algorithm is designed to provide correct + order of loops (they are ordered by their last loop BB) and basic + blocks in the chain formed by member next. */ static void form_loop_tree (void) { @@ -323,8 +322,7 @@ form_loop_tree (void) -/* The function rebuilds REGNO_ALLOCNO_MAP and REGNO_ALLOCNO_MAPs of - the loops using. */ +/* Rebuild REGNO_ALLOCNO_MAP and REGNO_ALLOCNO_MAPs. */ static void rebuild_regno_allocno_maps (void) { @@ -383,7 +381,7 @@ initiate_calls (void) memset (regno_calls, 0, regno_calls_num * sizeof (VEC(rtx, heap) *)); } -/* The function expands array of the vectors containing calls for +/* Expand the array of vectors containing calls for pseudo-registers. */ static void expand_calls (void) @@ -400,8 +398,8 @@ expand_calls (void) } } -/* The function removes NULL elements from vectors containing calls - intersected by live ranges of pseudo-registers. */ +/* Remove NULL elements from vectors containing calls intersected by + live ranges of pseudo-registers. */ static void compress_calls (void) { @@ -419,8 +417,8 @@ compress_calls (void) } } -/* The function adds CALL to REGNO's vector of intersected calls and - returns the element index in the vector. */ +/* Add CALLs to REGNO's vector of intersected calls and returns the + element index in the vector. */ int add_regno_call (int regno, rtx call) { @@ -434,8 +432,8 @@ add_regno_call (int regno, rtx call) return result; } -/* The function frees array of vectors containing calls intersected by - live ranges of pseudo-registers. */ +/* Free the array of vectors containing calls intersected by live + ranges of pseudo-registers. */ static void finish_calls (void) { @@ -459,7 +457,7 @@ static VEC(allocno_t,heap) *allocno_vec; container of conflict_id_allocno_map. */ static VEC(allocno_t,heap) *conflict_id_allocno_map_vec; -/* The function initializes data concerning allocnos. */ +/* Initialize data concerning allocnos. */ static void initiate_allocnos (void) { @@ -477,7 +475,7 @@ initiate_allocnos (void) memset (regno_allocno_map, 0, max_reg_num () * sizeof (allocno_t)); } -/* The function creates and returns allocno corresponding to REGNO in +/* Create and return the allocno corresponding to REGNO in LOOP_TREE_NODE. Add the allocno to the list of allocnos with the same regno if CAP_P is FALSE. */ allocno_t @@ -565,8 +563,8 @@ set_allocno_cover_class (allocno_t a, enum reg_class cover_class) reg_class_contents[cover_class]); } -/* The function returns TRUE if conflict vector with NUM elements is - more profitable than conflict bit vector for A. */ +/* Return TRUE if the conflict vector with NUM elements is more + profitable than conflict bit vector for A. */ bool conflict_vector_profitable_p (allocno_t a, int num) { @@ -581,7 +579,7 @@ conflict_vector_profitable_p (allocno_t a, int num) return 2 * sizeof (allocno_t) * (num + 1) < 3 * nw * sizeof (INT_TYPE); } -/* The function allocates and initializes conflict vector of A for NUM +/* Allocates and initialize the conflict vector of A for NUM conflicting allocnos. */ void allocate_allocno_conflict_vec (allocno_t a, int num) @@ -599,7 +597,7 @@ allocate_allocno_conflict_vec (allocno_t a, int num) ALLOCNO_CONFLICT_VEC_P (a) = true; } -/* The function allocates and initializes conflict bit vector of A. */ +/* Allocate and initialize the conflict bit vector of A. */ static void allocate_allocno_conflict_bit_vec (allocno_t a) { @@ -614,9 +612,8 @@ allocate_allocno_conflict_bit_vec (allocno_t a) ALLOCNO_CONFLICT_VEC_P (a) = false; } -/* The function allocates and initializes conflict vector or conflict - bit vector of A for NUM conflicting allocnos whatever is more - profitable. */ +/* Allocate and initialize the conflict vector or conflict bit vector + of A for NUM conflicting allocnos whatever is more profitable. */ void allocate_allocno_conflicts (allocno_t a, int num) { @@ -626,7 +623,7 @@ allocate_allocno_conflicts (allocno_t a, int num) allocate_allocno_conflict_bit_vec (a); } -/* The function adds A2 to the conflicts of A1. */ +/* Add A2 to the conflicts of A1. */ static void add_to_allocno_conflicts (allocno_t a1, allocno_t a2) { @@ -713,7 +710,7 @@ add_to_allocno_conflicts (allocno_t a1, allocno_t a2) } } -/* The function adds A1 to the conflicts of A2 and vise versa. */ +/* Add A1 to the conflicts of A2 and vise versa. */ void add_allocno_conflict (allocno_t a1, allocno_t a2) { @@ -721,7 +718,7 @@ add_allocno_conflict (allocno_t a1, allocno_t a2) add_to_allocno_conflicts (a2, a1); } -/* The function clears all conflicts of allocno A. */ +/* Clear all conflicts of allocno A. */ static void clear_allocno_conflicts (allocno_t a) { @@ -747,7 +744,7 @@ static int *allocno_conflict_check; the current allocno. */ static int curr_allocno_conflict_check_tick; -/* The function removes duplications in conflict vector of A. */ +/* Remove duplications in conflict vector of A. */ static void compress_allocno_conflict_vec (allocno_t a) { @@ -771,8 +768,7 @@ compress_allocno_conflict_vec (allocno_t a) vec[j] = NULL; } -/* The function removes duplications in conflict vectors of all - allocnos. */ +/* Remove duplications in conflict vectors of all allocnos. */ static void compress_conflict_vecs (void) { @@ -808,7 +804,7 @@ print_expanded_allocno (allocno_t a) fprintf (ira_dump_file, ")"); } -/* The function creates and returns cap representing allocno A in the +/* Create and return the cap representing allocno A in the parent loop. */ static allocno_t create_cap_allocno (allocno_t a) @@ -838,8 +834,8 @@ create_cap_allocno (allocno_t a) return cap; } -/* The function propagates info to CAP from its member. We propagate - info which is not available at the cap creation time. */ +/* Propagates info to the CAP from its member. We must propagate info + which is not available at the cap creation time. */ static void propagate_info_to_cap (allocno_t cap) { @@ -1014,7 +1010,7 @@ free_allocno_updated_costs (allocno_t a) ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (a) = NULL; } -/* The function frees memory allocated for allocno A. */ +/* Free the memory allocated for allocno A. */ static void finish_allocno (allocno_t a) { @@ -1042,7 +1038,7 @@ finish_allocno (allocno_t a) pool_free (allocno_pool, a); } -/* The function frees memory allocated for all allocnos. */ +/* Free the memory allocated for all allocnos. */ static void finish_allocnos (void) { @@ -1128,7 +1124,7 @@ create_copy (allocno_t first, allocno_t second, int freq, rtx insn, return cp; } -/* The function attaches copy CP to allocnos involved into the copy. */ +/* Attach a copy CP to allocnos involved into the copy. */ void add_allocno_copy_to_list (copy_t cp) { @@ -1156,7 +1152,7 @@ add_allocno_copy_to_list (copy_t cp) ALLOCNO_COPIES (second) = cp; } -/* The function detaches copy CP from allocnos involved into the copy. */ +/* Detach a copy CP from allocnos involved into the copy. */ void remove_allocno_copy_from_list (copy_t cp) { @@ -1198,7 +1194,7 @@ remove_allocno_copy_from_list (copy_t cp) cp->prev_second_allocno_copy = cp->next_second_allocno_copy = NULL; } -/* The function makes copy CP a canonical copy where number of the +/* Make a copy CP a canonical copy where number of the first allocno is less than the second one. */ void swap_allocno_copy_ends_if_necessary (copy_t cp) @@ -1222,10 +1218,10 @@ swap_allocno_copy_ends_if_necessary (copy_t cp) cp->next_second_allocno_copy = temp_cp; } -/* The function creates (or updates frequency if the copy already - exists) and returns the copy of allocnos FIRST and SECOND with - frequency FREQ corresponding to move insn INSN (if any) and - originated from LOOP_TREE_NODE. */ +/* Create (or update frequency if the copy already exists) and return + the copy of allocnos FIRST and SECOND with frequency FREQ + corresponding to move insn INSN (if any) and originated from + LOOP_TREE_NODE. */ copy_t add_allocno_copy (allocno_t first, allocno_t second, int freq, rtx insn, loop_tree_node_t loop_tree_node) @@ -1287,7 +1283,7 @@ finish_copy (copy_t cp) } -/* The function frees memory allocated for all copies. */ +/* Free memory allocated for all copies. */ static void finish_copies (void) { @@ -1323,15 +1319,14 @@ initiate_cost_vectors (void) } } -/* The function allocates and returns cost vector VEC for - COVER_CLASS. */ +/* Allocate and return a cost vector VEC for COVER_CLASS. */ int * allocate_cost_vector (enum reg_class cover_class) { return pool_alloc (cost_vector_pool[cover_class]); } -/* The function frees cost vector VEC for COVER_CLASS. */ +/* Free a cost vector VEC for COVER_CLASS. */ void free_cost_vector (int *vec, enum reg_class cover_class) { @@ -1339,8 +1334,8 @@ free_cost_vector (int *vec, enum reg_class cover_class) pool_free (cost_vector_pool[cover_class], vec); } -/* The function finishes work with hard register cost vectors. It - releases allocation pool for each cover class. */ +/* Finish work with hard register cost vectors. Release allocation + pool for each cover class. */ static void finish_cost_vectors (void) { @@ -1360,7 +1355,7 @@ finish_cost_vectors (void) loop_tree_node_t ira_curr_loop_tree_node; allocno_t *ira_curr_regno_allocno_map; -/* The recursive function traverses loop tree with root LOOP_NODE +/* This recursive function traverses loop tree with root LOOP_NODE calling non-null functions PREORDER_FUNC and POSTORDER_FUNC correspondingly in preorder and postorder. The function sets up IRA_CURR_LOOP_TREE_NODE and IRA_CURR_REGNO_ALLOCNO_MAP. If BB_P, @@ -1479,9 +1474,9 @@ create_insn_allocnos (rtx x, bool output_p) } } -/* The function creates allocnos corresponding to pseudo-registers - living in the basic block represented by the corresponding loop - tree node BB_NODE. */ +/* Create allocnos corresponding to pseudo-registers living in the + basic block represented by the corresponding loop tree node + BB_NODE. */ static void create_bb_allocnos (loop_tree_node_t bb_node) { @@ -1502,9 +1497,9 @@ create_bb_allocnos (loop_tree_node_t bb_node) create_allocno (i, false, ira_curr_loop_tree_node); } -/* The function creates allocnos corresponding to pseudo-registers - living on edge E (a loop entry or exit). It also marks the - allocnos as living on the loop border. */ +/* Create allocnos corresponding to pseudo-registers living on edge E + (a loop entry or exit). Also mark the allocnos as living on the + loop border. */ static void create_loop_allocnos (edge e) { @@ -1525,9 +1520,9 @@ create_loop_allocnos (edge e) } } -/* The function creates allocnos corresponding to pseudo-registers - living in loop represented by the corresponding loop tree node - LOOP_NODE. The function is called by traverse_loop_tree. */ +/* Create allocnos corresponding to pseudo-registers living in loop + represented by the corresponding loop tree node LOOP_NODE. This + function is called by traverse_loop_tree. */ static void create_loop_tree_node_allocnos (loop_tree_node_t loop_node) { @@ -1551,9 +1546,8 @@ create_loop_tree_node_allocnos (loop_tree_node_t loop_node) } } -/* The function creates allocnos corresponding to pseudo-registers in - the current function. The function traverses the loop tree for - this. */ +/* Create allocnos corresponding to pseudo-registers in the current + function. Traverse the loop tree for this. */ static void create_allocnos (void) { @@ -1584,8 +1578,7 @@ create_allocnos (void) -/* The function sets up minimal and maximal live range points for - allocnos. */ +/* Set up minimal and maximal live range points for allocnos. */ static void setup_min_max_allocno_live_range_point (void) { @@ -1642,11 +1635,10 @@ setup_min_max_allocno_live_range_point (void) #endif } -/* The function is used to sort allocnos according to their live - ranges. Allocnos with smaller cover class are put first. Allocnos - with the same cove class are ordered according their start (min). - Allocnos with the same start are ordered according their finish - (max). */ +/* Sort allocnos according to their live ranges. Allocnos with + smaller cover class are put first. Allocnos with the same cove + class are ordered according their start (min). Allocnos with the + same start are ordered according their finish (max). */ static int allocno_range_compare_func (const void *v1p, const void *v2p) { @@ -1662,8 +1654,8 @@ allocno_range_compare_func (const void *v1p, const void *v2p) return ALLOCNO_NUM (a1) - ALLOCNO_NUM (a2); } -/* The function sorts conflict_id_allocno_map and sets up conflict id - of allocnos. */ +/* Sort conflict_id_allocno_map and set up conflict id of + allocnos. */ static void sort_conflict_id_allocno_map (void) { @@ -1683,8 +1675,8 @@ sort_conflict_id_allocno_map (void) conflict_id_allocno_map[i] = NULL; } -/* The function sets up minimal and maximal conflict ids of allocnos - with which given allocno can conflict. */ +/* Set up minimal and maximal conflict ids of allocnos with which + given allocno can conflict. */ static void setup_min_max_conflict_allocno_ids (void) { @@ -1767,8 +1759,8 @@ setup_min_max_conflict_allocno_ids (void) -/* The function creates caps representing allocnos living only inside - the loop given by LOOP_NODE on higher loop level. */ +/* Create caps representing allocnos living only inside the loop given + by LOOP_NODE on higher loop level. */ static void create_loop_tree_node_caps (loop_tree_node_t loop_node) { @@ -1787,8 +1779,8 @@ create_loop_tree_node_caps (loop_tree_node_t loop_node) create_cap_allocno (allocnos[i]); } -/* The function propagate info (not available at the cap creation - time) to caps mentioned in LOOP_NODE. */ +/* Propagate info (not available at the cap creation time) to caps + mentioned in LOOP_NODE. */ static void propagate_info_to_loop_tree_node_caps (loop_tree_node_t loop_node) { @@ -1808,14 +1800,14 @@ propagate_info_to_loop_tree_node_caps (loop_tree_node_t loop_node) /* The page contains code transforming more one region internal - representation (IR) to one region IR which is necessary for the - reload. This transformation is called IR flattening. We might - just rebuild the IR for one region but we don't do it because it - takes a lot of time. */ - -/* The function merges ranges R1 and R2 and returns the result. The - function maintains the order of ranges and tries to minimize number - of the result ranges. */ + representation (IR) to one region IR which is necessary for reload. + This transformation is called IR flattening. We might just rebuild + the IR for one region but we don't do it because it takes a lot of + time. */ + +/* Merge ranges R1 and R2 and returns the result. The function + maintains the order of ranges and tries to minimize number of the + result ranges. */ static allocno_live_range_t merge_ranges (allocno_live_range_t r1, allocno_live_range_t r2) { @@ -1915,10 +1907,10 @@ change_allocno_in_range_list (allocno_live_range_t r, allocno_t a) r->allocno = a; } -/* The function flattens IR. In other words, the function transforms - IR as it were build with one region (without loops). We could make - it much simpler by rebuilding IR with one region, but unfortunately - it takes a lot of time. MAX_REGNO_BEFORE_EMIT and +/* Flatten the IR. In other words, this function transforms IR as if + it were built with one region (without loops). We could make it + much simpler by rebuilding IR with one region, but unfortunately it + takes a lot of time. MAX_REGNO_BEFORE_EMIT and MAX_POINT_BEFORE_EMIT are correspondingly MAX_REG_NUM () and MAX_POINT before emitting insns on the loop borders. */ void @@ -2294,14 +2286,14 @@ calculate_high_pressure_loops (loop_tree_node_t loop_node, } #endif -/* This entry function creates internal representation (IR) for IRA - (allocnos, copies, loop tree nodes). If LOOPS_P is FALSE the nodes - corresponding to the loops (except the root which corresponds the - all function) and correspondingly allocnos for the loops will be - not created. Such parameter value is used for Chaitin-Briggs - coloring. The function returns TRUE if we generate loop structure - (besides nodes representing all function and the basic blocks) for - regional allocation. It means that we really need to flatten IR +/* Create a internal representation (IR) for IRA (allocnos, copies, + loop tree nodes). If LOOPS_P is FALSE the nodes corresponding to + the loops (except the root which corresponds the all function) and + correspondingly allocnos for the loops will be not created. Such + parameter value is used for Chaitin-Briggs coloring. The function + returns TRUE if we generate loop structure (besides nodes + representing all function and the basic blocks) for regional + allocation. A true return means that we really need to flatten IR before the reload. */ bool ira_build (bool loops_p) @@ -2374,7 +2366,7 @@ ira_build (bool loops_p) return false; } -/* The function releases data created by function ira_build. */ +/* Release the data created by function ira_build. */ void ira_destroy (void) { diff --git a/gcc/ira-color.c b/gcc/ira-color.c index 4de75d2625e..9a380c7ed23 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -183,8 +183,8 @@ update_copy_costs_1 (allocno_t allocno, int hard_regno, } } -/* Entry function to update costs of allocnos to increase chances to - remove some copies as the result of subsequent assignment. */ +/* Update the cost of allocnos to increase chances to remove some + copies as the result of subsequent assignment. */ static void update_copy_costs (allocno_t allocno, bool decr_p) { @@ -192,8 +192,8 @@ update_copy_costs (allocno_t allocno, bool decr_p) update_copy_costs_1 (allocno, ALLOCNO_HARD_REGNO (allocno), decr_p, 1); } -/* The function is used to sort allocnos according to the profit of - usage of a hard register instead of memory for them. */ +/* Sort allocnos according to the profit of usage of a hard register + instead of memory for them. */ static int allocno_cost_compare_func (const void *v1p, const void *v2p) { @@ -226,13 +226,13 @@ print_coalesced_allocno (allocno_t allocno) } } -/* Function choosing a hard register for ALLOCNO (or for all coalesced - allocnos represented by ALLOCNO). If RETRY_P is TRUE, it means - that the function called from function `reassign_conflict_allocnos' - and `allocno_reload_assign'. The function implements the - optimistic coalescing too: if we failed to assign a hard register - to set of the coalesced allocnos, we put them onto the coloring - stack for subsequent separate assigning. */ +/* Choose a hard register for ALLOCNO (or for all coalesced allocnos + represented by ALLOCNO). If RETRY_P is TRUE, it means that the + function called from function `reassign_conflict_allocnos' and + `allocno_reload_assign'. This function implements the optimistic + coalescing too: if we failed to assign a hard register to set of + the coalesced allocnos, we put them onto the coloring stack for + subsequent separate assigning. */ static bool assign_hard_reg (allocno_t allocno, bool retry_p) { @@ -465,7 +465,7 @@ assign_hard_reg (allocno_t allocno, bool retry_p) -/* This page contains allocator based on Chaitin-Briggs algorithm. */ +/* This page contains the allocator based on the Chaitin-Briggs algorithm. */ /* Bucket of allocnos that can colored currently without spilling. */ static allocno_t colorable_allocno_bucket; @@ -519,14 +519,13 @@ get_coalesced_allocnos_attributes (allocno_t allocno, int *freq, int *num) } } -/* The function compares two allocnos to define what allocno should be - pushed first into the coloring stack. If the function returns a - negative number, the allocno given by the first parameter will be - pushed first. In this case such allocno has less priority than the - second one and the hard register will be assigned to it after - assignment to the second one. As the result of such assignment - order, the second allocno has a better chance to get the best hard - register. */ +/* Compare two allocnos to define which allocno should be pushed first + into the coloring stack. If the return is a negative number, the + allocno given by the first parameter will be pushed first. In this + case such allocno has less priority than the second one and the + hard register will be assigned to it after assignment to the second + one. As the result of such assignment order, the second allocno + has a better chance to get the best hard register. */ static int bucket_allocno_compare_func (const void *v1p, const void *v2p) { @@ -544,7 +543,7 @@ bucket_allocno_compare_func (const void *v1p, const void *v2p) return ALLOCNO_NUM (a2) - ALLOCNO_NUM (a1); } -/* Function sorts bucket *BUCKET_PTR and returns the result through +/* Sort bucket *BUCKET_PTR and return the result through BUCKET_PTR. */ static void sort_bucket (allocno_t *bucket_ptr) @@ -642,10 +641,10 @@ static splay_tree uncolorable_allocnos_splay_tree[N_REG_CLASSES]; into account. */ #define USE_SPLAY_P(CLASS) (uncolorable_allocnos_num[CLASS] > 4000) -/* The function puts ALLOCNO onto the coloring stack without removing - it from its bucket. Pushing allocno to the coloring stack can - result in moving conflicting allocnos from the uncolorable bucket - to the colorable one. */ +/* Put ALLOCNO onto the coloring stack without removing it from its + bucket. Pushing allocno to the coloring stack can result in moving + conflicting allocnos from the uncolorable bucket to the colorable + one. */ static void push_allocno_to_stack (allocno_t allocno) { @@ -726,9 +725,8 @@ push_allocno_to_stack (allocno_t allocno) } } -/* The function puts ALLOCNO onto the coloring stack and removes it - from its bucket. The allocno is in the colorable bucket if - COLORABLE_P is TRUE. */ +/* Put ALLOCNO onto the coloring stack and remove it from its bucket. + The allocno is in the colorable bucket if COLORABLE_P is TRUE. */ static void remove_allocno_from_bucket_and_push (allocno_t allocno, bool colorable_p) { @@ -758,8 +756,7 @@ remove_allocno_from_bucket_and_push (allocno_t allocno, bool colorable_p) push_allocno_to_stack (allocno); } -/* The function puts all allocnos from colorable bucket onto the - coloring stack. */ +/* Put all allocnos from colorable bucket onto the coloring stack. */ static void push_only_colorable (void) { @@ -768,8 +765,8 @@ push_only_colorable (void) remove_allocno_from_bucket_and_push (colorable_allocno_bucket, true); } -/* The function puts ALLOCNO chosen for potential spilling onto the - coloring stack. */ +/* Puts ALLOCNO chosen for potential spilling onto the coloring + stack. */ static void push_allocno_to_spill (allocno_t allocno) { @@ -781,8 +778,8 @@ push_allocno_to_spill (allocno_t allocno) push_allocno_to_stack (allocno); } -/* The function returns frequency of exit edges (if EXIT_P) or entry - from/to the loop given by its LOOP_NODE. */ +/* Return the frequency of exit edges (if EXIT_P) or entry from/to the + loop given by its LOOP_NODE. */ int loop_edge_freq (loop_tree_node_t loop_node, int regno, bool exit_p) { @@ -817,8 +814,7 @@ loop_edge_freq (loop_tree_node_t loop_node, int regno, bool exit_p) return REG_FREQ_FROM_EDGE_FREQ (freq); } -/* The function calculates and returns cost of putting allocno A into - memory. */ +/* Calculate and return the cost of putting allocno A into memory. */ static int calculate_allocno_spill_cost (allocno_t a) { @@ -855,9 +851,8 @@ calculate_allocno_spill_cost (allocno_t a) return cost; } -/* The function is used to compare keys in the splay tree used to - choose best allocno for spilling. The best allocno has the minimal - key. */ +/* Compare keys in the splay tree used to choose best allocno for + spilling. The best allocno has the minimal key. */ static int allocno_spill_priority_compare (splay_tree_key k1, splay_tree_key k2) { @@ -879,9 +874,9 @@ allocno_spill_priority_compare (splay_tree_key k1, splay_tree_key k2) return ALLOCNO_NUM (a1) - ALLOCNO_NUM (a2); } -/* The function is used to allocate data of SIZE for the splay trees. - We allocate only spay tree roots or splay tree nodes. If you - change this, please rewrite the function. */ +/* Allocate data of SIZE for the splay trees. We allocate only spay + tree roots or splay tree nodes. If you change this, please rewrite + the function. */ static void * splay_tree_allocate (int size, void *data ATTRIBUTE_UNUSED) { @@ -890,9 +885,9 @@ splay_tree_allocate (int size, void *data ATTRIBUTE_UNUSED) return pool_alloc (splay_tree_node_pool); } -/* The function is used to free data NODE for the splay trees. We - allocate and free only spay tree roots or splay tree nodes. If you - change this, please rewrite the function. */ +/* Free data NODE for the splay trees. We allocate and free only spay + tree roots or splay tree nodes. If you change this, please rewrite + the function. */ static void splay_tree_free (void *node, void *data ATTRIBUTE_UNUSED) { @@ -1257,8 +1252,8 @@ setup_allocno_left_conflicts_num (allocno_t allocno) ALLOCNO_LEFT_CONFLICTS_NUM (allocno) = conflict_allocnos_size; } -/* The function put ALLOCNO in a bucket corresponding to its number and - size of its conflicting allocnos and hard registers. */ +/* Put ALLOCNO in a bucket corresponding to its number and size of its + conflicting allocnos and hard registers. */ static void put_allocno_into_bucket (allocno_t allocno) { @@ -1298,9 +1293,9 @@ copy_freq_compare_func (const void *v1p, const void *v2p) return cp1->num - cp2->num; } -/* The function merges two sets of coalesced allocnos given - correspondingly by allocnos A1 and A2 (more accurately merging A2 - set into A1 set). */ +/* Merge two sets of coalesced allocnos given correspondingly by + allocnos A1 and A2 (more accurately merging A2 set into A1 + set). */ static void merge_allocnos (allocno_t a1, allocno_t a2) { @@ -1322,12 +1317,12 @@ merge_allocnos (allocno_t a1, allocno_t a2) ALLOCNO_NEXT_COALESCED_ALLOCNO (last) = next; } -/* The function returns TRUE if there are conflicting allocnos from - two sets of coalesced allocnos given correspondingly by allocnos - A1 and A2. If RELOAD_P is TRUE, we use live ranges to find - conflicts because conflicts are represented only for allocnos of - the same cover class and during the reload pass we coalesce - allocnos for sharing stack memory slots. */ +/* Return TRUE if there are conflicting allocnos from two sets of + coalesced allocnos given correspondingly by allocnos A1 and A2. If + RELOAD_P is TRUE, we use live ranges to find conflicts because + conflicts are represented only for allocnos of the same cover class + and during the reload pass we coalesce allocnos for sharing stack + memory slots. */ static bool coalesced_allocno_conflict_p (allocno_t a1, allocno_t a2, bool reload_p) { @@ -1466,9 +1461,8 @@ coalesce_allocnos (bool reload_p) ira_free (sorted_copies); } -/* Function implements Chaitin-Briggs coloring for allocnos in - COLORING_ALLOCNO_BITMAP taking into account allocnos in - CONSIDERATION_ALLOCNO_BITMAP. */ +/* Chaitin-Briggs coloring for allocnos in COLORING_ALLOCNO_BITMAP + taking into account allocnos in CONSIDERATION_ALLOCNO_BITMAP. */ static void color_allocnos (void) { @@ -1518,8 +1512,7 @@ color_allocnos (void) -/* The function outputs information about the loop given by its - LOOP_TREE_NODE. */ +/* Output information about the loop given by its LOOP_TREE_NODE. */ static void print_loop_title (loop_tree_node_t loop_tree_node) { @@ -1556,10 +1549,10 @@ print_loop_title (loop_tree_node_t loop_tree_node) fprintf (ira_dump_file, "\n"); } -/* The function does coloring for allocnos inside loop (in extreme - case it can be all function) given by the corresponding - LOOP_TREE_NODE. The function is called for each loop during - top-down traverse of the loop tree. */ +/* Color the allocnos inside loop (in the extreme case it can be all + of the function) given the corresponding LOOP_TREE_NODE. The + function is called for each loop during top-down traverse of the + loop tree. */ static void color_pass (loop_tree_node_t loop_tree_node) { @@ -1726,8 +1719,8 @@ color_pass (loop_tree_node_t loop_tree_node) } } -/* The function initialized common data for coloring and calls - functions to do Chaitin-Briggs and regional coloring. */ +/* Initialize the common data for coloring and calls functions to do + Chaitin-Briggs and regional coloring. */ static void do_coloring (void) { @@ -1751,11 +1744,11 @@ do_coloring (void) -/* The functions moves spill/restore code, which are to be generated - in ira-emit.c, to less frequent points (if it is profitable) by - reassigning some allocnos (in loop with subloops containing in - another loop) to memory which results in longer live-range where - the corresponding pseudo-registers will be in memory. */ +/* Move spill/restore code, which are to be generated in ira-emit.c, + to less frequent points (if it is profitable) by reassigning some + allocnos (in loop with subloops containing in another loop) to + memory which results in longer live-range where the corresponding + pseudo-registers will be in memory. */ static void move_spill_restore (void) { @@ -1945,8 +1938,8 @@ start_allocno_priorities (allocno_t *consideration_allocnos, int n) } } -/* The function is used to sort allocnos according to their priorities - which are calculated analogous to ones in file `global.c'. */ +/* Sort allocnos according to their priorities which are calculated + analogous to ones in file `global.c'. */ static int allocno_priority_compare_func (const void *v1p, const void *v2p) { @@ -2053,9 +2046,9 @@ reassign_conflict_allocnos (int start_regno) static int *regno_coalesced_allocno_cost; static int *regno_coalesced_allocno_num; -/* The function is used to sort pseudos according frequencies of - coalesced allocno sets they belong to (putting most frequently ones - first), and according to coalesced allocno set order numbers. */ +/* Sort pseudos according frequencies of coalesced allocno sets they + belong to (putting most frequently ones first), and according to + coalesced allocno set order numbers. */ static int coalesced_pseudo_reg_freq_compare (const void *v1p, const void *v2p) { @@ -2076,9 +2069,9 @@ coalesced_pseudo_reg_freq_compare (const void *v1p, const void *v2p) It is used for sorting pseudo registers. */ static unsigned int *regno_max_ref_width; -/* The function is used to sort pseudos according their slot numbers - (putting ones with smaller numbers first, or last when the frame - pointer is not needed). */ +/* Sort pseudos according their slot numbers (putting ones with + smaller numbers first, or last when the frame pointer is not + needed). */ static int coalesced_pseudo_reg_slot_compare (const void *v1p, const void *v2p) { @@ -2148,12 +2141,11 @@ setup_coalesced_allocno_costs_and_nums (int *pseudo_regnos, int n) } } -/* The function collects spilled allocnos representing coalesced - allocno sets (the first coalesced allocno). The collected allocnos - are returned through array SPILLED_COALESCED_ALLOCNOS. The - function returns the number of the collected allocnos. The - allocnos are given by their regnos in array PSEUDO_REGNOS of length - N. */ +/* Collect spilled allocnos representing coalesced allocno sets (the + first coalesced allocno). The collected allocnos are returned + through array SPILLED_COALESCED_ALLOCNOS. The function returns the + number of the collected allocnos. The allocnos are given by their + regnos in array PSEUDO_REGNOS of length N. */ static int collect_spilled_coalesced_allocnos (int *pseudo_regnos, int n, allocno_t *spilled_coalesced_allocnos) @@ -2173,11 +2165,11 @@ collect_spilled_coalesced_allocnos (int *pseudo_regnos, int n, return num; } -/* We have coalesced allocnos involving in copies. This function - coalesces allocnos further in order to share the same memory stack - slot. Allocnos representing sets of allocnos coalesced before the - call are given in array SPILLED_COALESCED_ALLOCNOS of length NUM. - Return TRUE if some allocnos were coalesced in the function. */ +/* We have coalesced allocnos involving in copies. Coalesce allocnos + further in order to share the same memory stack slot. Allocnos + representing sets of allocnos coalesced before the call are given + in array SPILLED_COALESCED_ALLOCNOS of length NUM. Return TRUE if + some allocnos were coalesced in the function. */ static bool coalesce_spill_slots (allocno_t *spilled_coalesced_allocnos, int num) { @@ -2218,11 +2210,11 @@ coalesce_spill_slots (allocno_t *spilled_coalesced_allocnos, int num) return merged_p; } -/* The function sorts pseudo-register numbers in array PSEUDO_REGNOS - of length N for subsequent assigning stack slots to them in the - reload pass. To do this we coalesce spilled allocnos first to - decrease the number of memory-memory move insns. This function is - called by the reload. */ +/* Sort pseudo-register numbers in array PSEUDO_REGNOS of length N for + subsequent assigning stack slots to them in the reload pass. To do + this we coalesce spilled allocnos first to decrease the number of + memory-memory move insns. This function is called by the + reload. */ void sort_regnos_for_alter_reg (int *pseudo_regnos, int n, unsigned int *reg_max_ref_width) @@ -2325,7 +2317,7 @@ sort_regnos_for_alter_reg (int *pseudo_regnos, int n, /* This page contains code used by the reload pass to improve the final code. */ -/* The function is called from the reload pass to mark changes in the +/* The function is called from reload to mark changes in the allocation of REGNO made by the reload. Remember that reg_renumber reflects the change result. */ void @@ -2371,8 +2363,8 @@ mark_allocation_change (int regno) overall_cost += cost; } -/* This function is called when the reload deletes memory-memory move. - In this case we marks that the allocation of the corresponding +/* This function is called when reload deletes memory-memory move. In + this case we marks that the allocation of the corresponding allocnos should be not changed in future. Otherwise we risk to get a wrong code. */ void @@ -2388,9 +2380,9 @@ mark_memory_move_deletion (int dst_regno, int src_regno) ALLOCNO_DONT_REASSIGN_P (src) = true; } -/* The function tries to assign a hard register (except for - FORBIDDEN_REGS) to allocno A and return TRUE in the case of - success. That is an analog of retry_global_alloc for IRA. */ +/* Try to assign a hard register (except for FORBIDDEN_REGS) to + allocno A and return TRUE in the case of success. That is an + analog of retry_global_alloc for IRA. */ static bool allocno_reload_assign (allocno_t a, HARD_REG_SET forbidden_regs) { @@ -2444,8 +2436,8 @@ allocno_reload_assign (allocno_t a, HARD_REG_SET forbidden_regs) return reg_renumber[regno] >= 0; } -/* The function is used to sort pseudos according their usage - frequencies (putting most frequently ones first). */ +/* Sort pseudos according their usage frequencies (putting most + frequently ones first). */ static int pseudo_reg_compare (const void *v1p, const void *v2p) { @@ -2458,14 +2450,14 @@ pseudo_reg_compare (const void *v1p, const void *v2p) return regno1 - regno2; } -/* The function tries to allocate hard registers to - SPILLED_PSEUDO_REGS (there are NUM of them) or spilled pseudos - conflicting with pseudos in SPILLED_PSEUDO_REGS. It returns TRUE - and update SPILLED, if the allocation has been changed. The - function doesn't use BAD_SPILL_REGS and hard registers in - PSEUDO_FORBIDDEN_REGS and PSEUDO_PREVIOUS_REGS for the - corresponding pseudos. The function is called by the reload pass - at the end of each reload iteration. */ +/* Try to allocate hard registers to SPILLED_PSEUDO_REGS (there are + NUM of them) or spilled pseudos conflicting with pseudos in + SPILLED_PSEUDO_REGS. Return TRUE and update SPILLED, if the + allocation has been changed. The function doesn't use + BAD_SPILL_REGS and hard registers in PSEUDO_FORBIDDEN_REGS and + PSEUDO_PREVIOUS_REGS for the corresponding pseudos. The function + is called by the reload pass at the end of each reload + iteration. */ bool reassign_pseudos (int *spilled_pseudo_regs, int num, HARD_REG_SET bad_spill_regs, @@ -2561,9 +2553,9 @@ reassign_pseudos (int *spilled_pseudo_regs, int num, return changed_p; } -/* The function is called by the reload pass and returns already - allocated stack slot (if any) for REGNO with given INHERENT_SIZE - and TOTAL_SIZE. In the case of failure to find a slot which can be +/* The function is called by reload and returns already allocated + stack slot (if any) for REGNO with given INHERENT_SIZE and + TOTAL_SIZE. In the case of failure to find a slot which can be used for REGNO, the function returns NULL. */ rtx reuse_stack_slot (int regno, unsigned int inherent_size, @@ -2674,9 +2666,9 @@ reuse_stack_slot (int regno, unsigned int inherent_size, return x; } -/* The function is called by the reload pass every time when a new - stack slot X with TOTAL_SIZE was allocated for REGNO. We store - this info for subsequent reuse_stack_slot calls. */ +/* This is called by reload every time a new stack slot X with + TOTAL_SIZE was allocated for REGNO. We store this info for + subsequent reuse_stack_slot calls. */ void mark_new_stack_slot (rtx x, int regno, unsigned int total_size) { @@ -2805,10 +2797,10 @@ better_spill_reload_regno_p (int *regnos, int *other_regnos, -/* The function returns (through CALL_CLOBBERED_REGS) hard registers - changed by all function calls inside REGNO live range. The - function is used to improve code for saving/restore callee-clobbered - hard registers around calls (see caller-saves.c). */ +/* Return (through CALL_CLOBBERED_REGS) hard registers changed by all + function calls inside REGNO live range. This is used to improve + code for saving/restore callee-clobbered hard registers around + calls (see caller-saves.c). */ void collect_pseudo_call_clobbered_regs (int regno, HARD_REG_SET (*call_clobbered_regs)) @@ -2874,8 +2866,8 @@ ira_color (void) /* This page contains a simple register allocator without usage of allocno conflicts. This is used for fast allocation for -O0. */ -/* The function does register allocation not using allocno conflicts. - It uses only allocno live ranges. The algorithm is close to Chow's +/* Do register allocation by not using allocno conflicts. It uses + only allocno live ranges. The algorithm is close to Chow's priority coloring. */ void ira_fast_allocation (void) diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c index ae949ec5cbe..0e278b25ee7 100644 --- a/gcc/ira-conflicts.c +++ b/gcc/ira-conflicts.c @@ -60,8 +60,7 @@ static INT_TYPE **conflicts; -/* The function builds allocno conflict table by processing allocno - live ranges. */ +/* Build allocno conflict table by processing allocno live ranges. */ static void build_conflict_bit_table (void) { @@ -135,8 +134,7 @@ build_conflict_bit_table (void) -/* The function returns TRUE, if the operand constraint STR is - commutative. */ +/* Return TRUE if the operand constraint STR is commutative. */ static bool commutative_constraint_p (const char *str) { @@ -164,12 +162,11 @@ commutative_constraint_p (const char *str) return false; } -/* The function returns number of the operand which should be the same - in any case as operand with number OP_NUM (or negative value if - there is no such operand). If USE_COMMUT_OP_P is TRUE, the - function makes temporarily commutative operand exchange before - this. The function takes only really possible alternatives into - consideration. */ +/* Return the number of the operand which should be the same in any + case as operand with number OP_NUM (or negative value if there is + no such operand). If USE_COMMUT_OP_P is TRUE, the function makes + temporarily commutative operand exchange before this. The function + takes only really possible alternatives into consideration. */ static int get_dup_num (int op_num, bool use_commut_op_p) { @@ -280,8 +277,8 @@ get_dup_num (int op_num, bool use_commut_op_p) return dup; } -/* The function returns operand which should be in any case the same - as operand with number OP_NUM. If USE_COMMUT_OP_P is TRUE, the +/* Return the operand which should be, in any case, the same as + operand with number OP_NUM. If USE_COMMUT_OP_P is TRUE, the function makes temporarily commutative operand exchange before this. */ static rtx @@ -358,8 +355,8 @@ process_regs_for_copy (rtx reg1, rtx reg2, rtx insn, int freq) return true; } -/* The function processes all output registers of the current insn and - input register REG (its operand number OP_NUM) which dies in the +/* Process all of the output registers of the current insn and + the input register REG (its operand number OP_NUM) which dies in the insn as if there were a move insn between them with frequency FREQ. */ static void @@ -381,9 +378,9 @@ process_reg_shuffles (rtx reg, int op_num, int freq) } } -/* The function processes INSN and create allocno copies if - necessary. For example, it might be because INSN is a - pseudo-register move or INSN is two operand insn. */ +/* Process INSN and create allocno copies if necessary. For example, + it might be because INSN is a pseudo-register move or INSN is two + operand insn. */ static void add_insn_allocno_copies (rtx insn) { @@ -432,8 +429,7 @@ add_insn_allocno_copies (rtx insn) } } -/* The function adds copies originated from BB given by - LOOP_TREE_NODE. */ +/* Add copies originated from BB given by LOOP_TREE_NODE. */ static void add_copies (loop_tree_node_t loop_tree_node) { @@ -448,10 +444,9 @@ add_copies (loop_tree_node_t loop_tree_node) add_insn_allocno_copies (insn); } -/* The function propagates copy info for allocno A to the - corresponding allocno on upper loop tree level. So allocnos on - upper levels accumulate information about the corresponding - allocnos in nested regions. */ +/* Propagate copy info for allocno A to the corresponding allocno on + upper loop tree level. So allocnos on upper levels accumulate + information about the corresponding allocnos in nested regions. */ static void propagate_allocno_copy_info (allocno_t a) { @@ -486,8 +481,8 @@ propagate_allocno_copy_info (allocno_t a) } } -/* The function propagates copy info to the corresponding allocnos on - upper loop tree level. */ +/* Propagate copy info to the corresponding allocnos on upper loop + tree level. */ static void propagate_copy_info (void) { @@ -501,9 +496,9 @@ propagate_copy_info (void) propagate_allocno_copy_info (a); } -/* The function returns TRUE if live ranges of allocnos A1 and A2 - intersect. It is used to find a conflict for new allocnos or - allocnos with the different cover classes. */ +/* Return TRUE if live ranges of allocnos A1 and A2 intersect. It is + used to find a conflict for new allocnos or allocnos with the + different cover classes. */ bool allocno_live_ranges_intersect_p (allocno_t a1, allocno_t a2) { @@ -529,9 +524,9 @@ allocno_live_ranges_intersect_p (allocno_t a1, allocno_t a2) return false; } -/* The function returns TRUE if live ranges of pseudo-registers REGNO1 - and REGNO2 intersect. It should be used when there is only one - region. Currently it is used during the reload work. */ +/* Return TRUE if live ranges of pseudo-registers REGNO1 and REGNO2 + intersect. This should be used when there is only one region. + Currently this is used during reload. */ bool pseudo_live_ranges_intersect_p (int regno1, int regno2) { @@ -577,9 +572,8 @@ remove_conflict_allocno_copies (void) VEC_free (copy_t, heap, conflict_allocno_copy_vec); } -/* The function builds conflict vectors or bit conflict vectors - (whatever is more profitable) of all allocnos from the conflict - table. */ +/* Build conflict vectors or bit conflict vectors (whatever is more + profitable) of all allocnos from the conflict table. */ static void build_allocno_conflicts (void) { @@ -663,8 +657,8 @@ build_allocno_conflicts (void) -/* The function propagates information about allocnos modified inside - the loop given by its LOOP_TREE_NODE to its parent. */ +/* Propagate information about allocnos modified inside the loop given + by its LOOP_TREE_NODE to its parent. */ static void propagate_modified_regnos (loop_tree_node_t loop_tree_node) { @@ -677,7 +671,7 @@ propagate_modified_regnos (loop_tree_node_t loop_tree_node) -/* The function prints hard reg set SET with TITLE to FILE. */ +/* Print hard reg set SET with TITLE to FILE. */ static void print_hard_reg_set (FILE *file, const char *title, HARD_REG_SET set) { @@ -706,8 +700,8 @@ print_hard_reg_set (FILE *file, const char *title, HARD_REG_SET set) fprintf (file, "\n"); } -/* The function prints information about allocno or only regno (if - REG_P) conflicts to FILE. */ +/* Print information about allocno or only regno (if REG_P) conflicts + to FILE. */ static void print_conflicts (FILE *file, bool reg_p) { @@ -767,8 +761,8 @@ print_conflicts (FILE *file, bool reg_p) fprintf (file, "\n"); } -/* The function prints information about allocno or only regno (if - REG_P) conflicts to stderr. */ +/* Print information about allocno or only regno (if REG_P) conflicts + to stderr. */ void debug_conflicts (bool reg_p) { diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index b7a0f627d12..b66ee094817 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -172,7 +172,7 @@ copy_cost (rtx x, enum machine_mode mode, enum reg_class class, bool to_p, This procedure works alternative by alternative. For each alternative we assume that we will be able to allocate all allocnos to their ideal register class and calculate the cost of using that - alternative. Then we compute for each operand that is a + alternative. Then we compute, for each operand that is a pseudo-register, the cost of having the allocno allocated to each register class and using it in that alternative. To this cost is added the cost of the alternative. @@ -1060,8 +1060,8 @@ print_costs (FILE *f) } } -/* The function traverses BB represented by LOOP_TREE_NODE to update - the allocno costs. */ +/* Traverse the BB represented by LOOP_TREE_NODE to update the allocno + costs. */ static void process_bb_node_for_costs (loop_tree_node_t loop_tree_node) { @@ -1466,7 +1466,7 @@ init_ira_costs_once (void) cost_classes = NULL; } -/* The function frees allocated temporary cost vectors. */ +/* Free allocated temporary cost vectors. */ static void free_ira_costs (void) { @@ -1491,7 +1491,7 @@ free_ira_costs (void) cost_classes = NULL; } -/* The function called every time when register related information is +/* This is called each time register related information is changed. */ void init_ira_costs (void) @@ -1548,9 +1548,9 @@ ira_costs (void) -/* This function changes hard register costs for allocnos which lives - through function calls. The function is called only when we found - all intersected calls during building allocno live ranges. */ +/* Change hard register costs for allocnos which lives through + function calls. This is called only when we found all intersected + calls during building allocno live ranges. */ void tune_allocno_costs_and_cover_classes (void) { diff --git a/gcc/ira-emit.c b/gcc/ira-emit.c index b58743a957c..55a444dceed 100644 --- a/gcc/ira-emit.c +++ b/gcc/ira-emit.c @@ -76,7 +76,7 @@ static struct move **at_bb_start, **at_bb_end; different outside the loop. */ static int max_regno_before_changing; -/* The function returns new move of allocnos TO and FROM. */ +/* Return new move of allocnos TO and FROM. */ static struct move * create_move (allocno_t to, allocno_t from) { @@ -93,7 +93,7 @@ create_move (allocno_t to, allocno_t from) return move; } -/* The function frees memory for MOVE and its dependencies. */ +/* Free memory for MOVE and its dependencies. */ static void free_move (struct move *move) { @@ -102,8 +102,7 @@ free_move (struct move *move) ira_free (move); } -/* The function frees memory for list of the moves given by its - HEAD. */ +/* Free memory for list of the moves given by its HEAD. */ static void free_move_list (struct move *head) { @@ -116,9 +115,8 @@ free_move_list (struct move *head) } } -/* The function returns TRUE if the the move list LIST1 and LIST2 - are equal (two moves are equal if they involve the same - allocnos). */ +/* Return TRUE if the the move list LIST1 and LIST2 are equal (two + moves are equal if they involve the same allocnos). */ static bool eq_move_lists_p (struct move *list1, struct move *list2) { @@ -171,8 +169,8 @@ change_regs (rtx *loc) return result; } -/* The function attaches MOVE to the edge E. The move is attached to - the head of the list if HEAD_P is TRUE. */ +/* Attach MOVE to the edge E. The move is attached to the head of the + list if HEAD_P is TRUE. */ static void add_to_edge_list (edge e, struct move *move, bool head_p) { @@ -192,8 +190,8 @@ add_to_edge_list (edge e, struct move *move, bool head_p) } } -/* The function creates and returns new pseudo-register with the same - attributes as ORIGINAL_REG. */ +/* Create and return new pseudo-register with the same attributes as + ORIGINAL_REG. */ static rtx create_new_reg (rtx original_reg) { @@ -210,8 +208,8 @@ create_new_reg (rtx original_reg) return new_reg; } -/* The function returns TRUE if loop given by SUBNODE inside the - loop given by NODE. */ +/* Eeturn TRUE if loop given by SUBNODE inside the loop given by + NODE. */ static bool subloop_tree_node_p (loop_tree_node_t subnode, loop_tree_node_t node) { @@ -221,9 +219,8 @@ subloop_tree_node_p (loop_tree_node_t subnode, loop_tree_node_t node) return false; } -/* The function sets up member `reg' to REG for allocnos which has the - same regno as ALLOCNO and which are inside the loop corresponding to - ALLOCNO. */ +/* Set up member `reg' to REG for allocnos which has the same regno as + ALLOCNO and which are inside the loop corresponding to ALLOCNO. */ static void set_allocno_reg (allocno_t allocno, rtx reg) { @@ -257,10 +254,10 @@ set_allocno_reg (allocno_t allocno, rtx reg) } } -/* The following function returns TRUE if move of SRC_ALLOCNO to - DEST_ALLOCNO does not change value of the destination. One possible - reason for this is the situation when SRC_ALLOCNO is not modified - in the corresponding loop. */ +/* Return TRUE if move of SRC_ALLOCNO to DEST_ALLOCNO does not change + value of the destination. One possible reason for this is the + situation when SRC_ALLOCNO is not modified in the corresponding + loop. */ static bool not_modified_p (allocno_t src_allocno, allocno_t dest_allocno) { @@ -282,9 +279,9 @@ not_modified_p (allocno_t src_allocno, allocno_t dest_allocno) return node != NULL; } -/* The function generates and attaches moves to the edge E. It looks - at the final regnos of allocnos living on the edge with the same - original regno to figure out when moves should be generated. */ +/* Generate and attach moves to the edge E. This looks at the final + regnos of allocnos living on the edge with the same original regno + to figure out when moves should be generated. */ static void generate_edge_moves (edge e) { @@ -343,8 +340,8 @@ static bitmap used_regno_bitmap; with a common parent. */ static bitmap renamed_regno_bitmap; -/* The following function changes (if necessary) pseudo-registers - inside loop given by loop tree node NODE. */ +/* Change (if necessary) pseudo-registers inside loop given by loop + tree node NODE. */ static void change_loop (loop_tree_node_t node) { @@ -441,7 +438,7 @@ change_loop (loop_tree_node_t node) } } -/* The function processes to set up flag somewhere_renamed_p. */ +/* Process to set up flag somewhere_renamed_p. */ static void set_allocno_somewhere_renamed_p (void) { @@ -458,8 +455,8 @@ set_allocno_somewhere_renamed_p (void) } } -/* The function returns TRUE if move lists on all edges given in - vector VEC are equal. */ +/* Return TRUE if move lists on all edges given in vector VEC are + equal. */ static bool eq_edge_move_lists_p (VEC(edge,gc) *vec) { @@ -473,10 +470,9 @@ eq_edge_move_lists_p (VEC(edge,gc) *vec) return true; } -/* The function looks at all entry edges (if START_P) or exit edges of - basic block BB and puts move lists at the BB start or end if it is - possible. In other words, it decreases code duplication of - allocno moves. */ +/* Look at all entry edges (if START_P) or exit edges of basic block + BB and put move lists at the BB start or end if it is possible. In + other words, this decreases code duplication of allocno moves. */ static void unify_moves (basic_block bb, bool start_p) { @@ -551,10 +547,10 @@ traverse_moves (move_t move) VEC_safe_push (move_t, heap, move_vec, move); } -/* The function removes unnecessary moves in the LIST, makes - topological sorting, and removes cycles on hard reg dependencies by - introducing new allocnos assigned to memory and additional moves. - It returns the result move list. */ +/* Remove unnecessary moves in the LIST, makes topological sorting, + and removes cycles on hard reg dependencies by introducing new + allocnos assigned to memory and additional moves. It returns the + result move list. */ static move_t modify_move_list (move_t list) { @@ -679,8 +675,8 @@ modify_move_list (move_t list) return first; } -/* The function generates RTX move insns from the move list LIST. It - updates allocation cost using move execution frequency FREQ. */ +/* Generate RTX move insns from the move list LIST. This updates + allocation cost using move execution frequency FREQ. */ static rtx emit_move_list (move_t list, int freq) { @@ -734,8 +730,8 @@ emit_move_list (move_t list, int freq) return result; } -/* The function generates RTX move insns from move lists attached to - basic blocks and edges. */ +/* Generate RTX move insns from move lists attached to basic blocks + and edges. */ static void emit_moves (void) { @@ -810,10 +806,10 @@ update_costs (allocno_t a, bool read_p, int freq) } } -/* The function processes moves from LIST with execution FREQ to add - ranges, copies, and modify costs for allocnos involved in the - moves. All regnos living through the list is in LIVE_THROUGH, and - the loop tree node used to find corresponding allocnos is NODE. */ +/* Process moves from LIST with execution FREQ to add ranges, copies, + and modify costs for allocnos involved in the moves. All regnos + living through the list is in LIVE_THROUGH, and the loop tree node + used to find corresponding allocnos is NODE. */ static void add_range_and_copies_from_move_list (move_t list, loop_tree_node_t node, bitmap live_through, int freq) @@ -912,8 +908,8 @@ add_range_and_copies_from_move_list (move_t list, loop_tree_node_t node, } } -/* The function processes all move list to add ranges, conflicts, - copies, and modify costs for allocnos involved in the moves. */ +/* Process all move list to add ranges, conflicts, copies, and modify + costs for allocnos involved in the moves. */ static void add_ranges_and_copies (void) { diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c index 8bf0623fc1e..b4e82ca90c4 100644 --- a/gcc/ira-lives.c +++ b/gcc/ira-lives.c @@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see pseudo-register conflicts. */ /* Program points are enumerated by number from range 0..MAX_POINT-1. - There are approximately tow times more program points than insns. + There are approximately two times more program points than insns. One program points correspond points between subsequent insns and other ones correspond to points after usage of input operands but before setting the output operands in insns. */ @@ -122,9 +122,9 @@ update_allocno_pressure_excess_length (allocno_t a) ALLOCNO_EXCESS_PRESSURE_POINTS_NUM (a) += curr_point - start + 1; } -/* The function processing death of register REGNO. It updates live - hard regs or finish the current live range for the allocno - corresponding to REGNO. */ +/* Process the death of register REGNO. This updates hard_regs_live + or finishes the current live range for the allocno corresponding to + REGNO. */ static void make_regno_dead (int regno) { @@ -145,8 +145,8 @@ make_regno_dead (int regno) update_allocno_pressure_excess_length (a); } -/* The function processing birth and, right after then, death of - register REGNO. */ +/* Process the birth and, right after then, death of register + REGNO. */ static void make_regno_born_and_dead (int regno) { @@ -158,10 +158,10 @@ make_regno_born_and_dead (int regno) basic block. */ static int curr_reg_pressure[N_REG_CLASSES]; -/* The function marks allocno A as currently living and updates - current register pressure, maximal register pressure for the - current BB, start point of the register pressure excess, and - conflicting hard registers of A. */ +/* Mark allocno A as currently living and update current register + pressure, maximal register pressure for the current BB, start point + of the register pressure excess, and conflicting hard registers of + A. */ static void set_allocno_live (allocno_t a) { @@ -184,10 +184,9 @@ set_allocno_live (allocno_t a) curr_bb_node->reg_pressure[cover_class] = curr_reg_pressure[cover_class]; } -/* The function marks allocno A as currently not living and updates - current register pressure, start point of the register pressure - excess, and register pressure excess length for living - allocnos. */ +/* Mark allocno A as currently not living and update current register + pressure, start point of the register pressure excess, and register + pressure excess length for living allocnos. */ static void clear_allocno_live (allocno_t a) { @@ -385,9 +384,9 @@ mark_reg_death (rtx reg) } } -/* The function checks that CONSTRAINTS permits to use only one hard - register. If it is so, the function returns the class of the hard - register. Otherwise it returns NO_REGS. */ +/* Checks that CONSTRAINTS permits to use only one hard register. If + it is so, the function returns the class of the hard register. + Otherwise it returns NO_REGS. */ static enum reg_class single_reg_class (const char *constraints, rtx op, rtx equiv_const) { @@ -529,10 +528,10 @@ single_reg_operand_class (int op_num) recog_data.operand[op_num], NULL_RTX); } -/* The function processes input operands, if IN_P, or output operands - otherwise of the current insn with FREQ to find allocno which can - use only one hard register and makes other currently living - allocnos conflicting with the hard register. */ +/* Processes input operands, if IN_P, or output operands otherwise of + the current insn with FREQ to find allocno which can use only one + hard register and makes other currently living allocnos conflicting + with the hard register. */ static void process_single_reg_class_operands (bool in_p, int freq) { @@ -604,11 +603,10 @@ process_single_reg_class_operands (bool in_p, int freq) } } -/* The function processes insns of the basic block given by its - LOOP_TREE_NODE to update allocno live ranges, allocno hard register - conflicts, intersected calls, and register pressure info for - allocnos for the basic block for and regions containing the basic - block. */ +/* Process insns of the basic block given by its LOOP_TREE_NODE to + update allocno live ranges, allocno hard register conflicts, + intersected calls, and register pressure info for allocnos for the + basic block for and regions containing the basic block. */ static void process_bb_node_lives (loop_tree_node_t loop_tree_node) { @@ -847,8 +845,7 @@ process_bb_node_lives (loop_tree_node_t loop_tree_node) } } -/* The function creates and sets up START_POINT_RANGES and - FINISH_POINT_RANGES. */ +/* Create and set up START_POINT_RANGES and FINISH_POINT_RANGES. */ static void create_start_finish_chains (void) { @@ -874,9 +871,9 @@ create_start_finish_chains (void) } } -/* The function is used to rebuild START_POINT_RANGES and - FINISH_POINT_RANGES after new live ranges and program points were - added as a result if new insn generation. */ +/* Rebuild START_POINT_RANGES and FINISH_POINT_RANGES after new live + ranges and program points were added as a result if new insn + generation. */ void rebuild_start_finish_chains (void) { @@ -885,7 +882,7 @@ rebuild_start_finish_chains (void) create_start_finish_chains (); } -/* The function prints live ranges R to file F. */ +/* Print live ranges R to file F. */ void print_live_range_list (FILE *f, allocno_live_range_t r) { @@ -894,14 +891,14 @@ print_live_range_list (FILE *f, allocno_live_range_t r) fprintf (f, "\n"); } -/* The function prints live ranges R to stderr. */ +/* Print live ranges R to stderr. */ void debug_live_range_list (allocno_live_range_t r) { print_live_range_list (stderr, r); } -/* The function prints live ranges of allocno A to file F. */ +/* Print live ranges of allocno A to file F. */ static void print_allocno_live_ranges (FILE *f, allocno_t a) { @@ -909,14 +906,14 @@ print_allocno_live_ranges (FILE *f, allocno_t a) print_live_range_list (f, ALLOCNO_LIVE_RANGES (a)); } -/* The function prints live ranges of allocno A to stderr. */ +/* Print live ranges of allocno A to stderr. */ void debug_allocno_live_ranges (allocno_t a) { print_allocno_live_ranges (stderr, a); } -/* The function prints live ranges of all allocnos to file F. */ +/* Print live ranges of all allocnos to file F. */ static void print_live_ranges (FILE *f) { @@ -927,19 +924,19 @@ print_live_ranges (FILE *f) print_allocno_live_ranges (f, a); } -/* The function prints live ranges of all allocnos to stderr. */ +/* Print live ranges of all allocnos to stderr. */ void debug_live_ranges (void) { print_live_ranges (stderr); } -/* The function propagates new info about allocno A (see comments - about accumulated info in allocno definition) to the corresponding - allocno on upper loop tree level. So allocnos on upper levels - accumulate information about the corresponding allocnos in nested - regions. The new info means allocno info finally calculated in - this file. */ +/* Propagate new info about allocno A (see comments about accumulated + info in allocno definition) to the corresponding allocno on upper + loop tree level. So allocnos on upper levels accumulate + information about the corresponding allocnos in nested regions. + The new info means allocno info finally calculated in this + file. */ static void propagate_new_allocno_info (allocno_t a) { @@ -970,8 +967,8 @@ propagate_new_allocno_info (allocno_t a) } } -/* The function propagates new info about allocnos to the - corresponding allocnos on upper loop tree level. */ +/* Propagate new info about allocnos to the corresponding allocnos on + upper loop tree level. */ static void propagate_new_info (void) { @@ -1006,8 +1003,7 @@ create_allocno_live_ranges (void) sparseset_free (allocnos_live); } -/* The function frees arrays START_POINT_RANGES and - FINISH_POINT_RANGES. */ +/* Free arrays START_POINT_RANGES and FINISH_POINT_RANGES. */ void finish_allocno_live_ranges (void) { diff --git a/gcc/ira.c b/gcc/ira.c index 3183f9d3de3..4792ccd2172 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -52,17 +52,17 @@ along with GCC; see the file COPYING3. If not see conflicting hard-registers, there are a few allocno attributes which are important for understanding the allocation algorithm: - - *Live ranges*. This is a list of ranges of *program points* - where the allocno lives. Program points represent places - where a pseudo can be born or become dead (there are + - *Live ranges*. This is a list of ranges of *program + points* where the allocno lives. Program points represent + places where a pseudo can be born or become dead (there are approximately two times more program points than the insns) and they are represented by integers starting with 0. The live ranges are used to find conflicts between allocnos of different cover classes. They also play very important role - for transformation of IRA internal representation for several - regions into one region representation. The later is used - during the reload pass work because each allocno represents - all corresponding pseudo-register. + for the transformation of the IRA internal representation of + several regions into a one region representation. The later is + used during the reload pass work because each allocno + represents all of the corresponding pseudo-registers. - *Hard-register costs*. This is a vector of size equal to the number of available hard-registers of the allocno's cover @@ -109,7 +109,7 @@ along with GCC; see the file COPYING3. If not see register coalescing). But IRA also creates copies for operands of an insn which should be assigned to the same hard-register due to constraints in the machine description (it usually - results in removing a move generated in the reload to satisfy + results in removing a move generated in reload to satisfy the constraints) and copies referring to the allocno which is the output operand of an instruction and the allocno which is an input operand dying in the instruction (creation of such @@ -171,24 +171,24 @@ along with GCC; see the file COPYING3. If not see * Putting allocnos onto the coloring stack. IRA uses Briggs optimistic coloring which is a major improvement over - Chaitin's coloring. Therefore IRa does not spill allocnos at - this point. There is some freedom in order of putting + Chaitin's coloring. Therefore IRA does not spill allocnos at + this point. There is some freedom in the order of putting allocnos on the stack which can affect the final result of the allocation. IRA uses some heuristics to improve the order. * Popping the allocnos from the stack and assigning them hard registers. If IRA can not assign a hard register to an - allocno and allocno is coalesced, IRA undoes coalescing and - put the uncoalesced allocnos onto the satck in hope that some - such allocnos will get a hard register separately. If IRA - fails to assign hard register or memory is more profitable - for it, IRA spills the allocno. IRA assigns allocno the - hard-register with minimal full allocation cost which - reflects the cost of usage of the hard-register for the - allocno and cost of usage of the hard-register for allocnos - conflicting with given allocno. - - * After allono assigning in the region, IRA modifies hard + allocno and the allocno is coalesced, IRA undoes the + coalescing and puts the uncoalesced allocnos onto the stack in + the hope that some such allocnos will get a hard register + separately. If IRA fails to assign hard register or memory + is more profitable for it, IRA spills the allocno. IRA + assigns the allocno the hard-register with minimal full + allocation cost which reflects the cost of usage of the + hard-register for the allocno and cost of usage of the + hard-register for allocnos conflicting with given allocno. + + * After allono assigning in the region, IRA modifies the hard register and memory costs for the corresponding allocnos in the subregions to reflect the cost of possible loads, stores, or moves on the border of the region and its subregions. @@ -198,11 +198,11 @@ along with GCC; see the file COPYING3. If not see corresponding cover class is less than number of available hard registers for given cover class. - o Spill/restore code moving. When IRA performs allocation - traversing regions in top-down order, it does not know what + o Spill/restore code moving. When IRA performs an allocation + by traversing regions in top-down order, it does not know what happens below in the region tree. Therefore, sometimes IRA misses opportunities to perform a better allocation. A simple - ooptimization tries to improve allocation in a region having + optimization tries to improve allocation in a region having subregions and containing in another region. If the corresponding allocnos in the subregion are spilled, it spills the region allocno if it is profitable. The optimization @@ -215,18 +215,18 @@ along with GCC; see the file COPYING3. If not see pseudo-register outside and inside a region respectively may be assigned to different locations (hard-registers or memory). In this case IRA creates and uses a new pseudo-register inside the - region and add code to move allocno values on the region's + region and adds code to move allocno values on the region's borders. This is done during top-down traversal of the regions (file ira-emit.c). In some complicated cases IRA can create a new allocno to move allocno values (e.g. when a swap of values stored in two hard-registers is needed). At this stage, the - new allocno marked as spilled. IRA still creates the + new allocno is marked as spilled. IRA still creates the pseudo-register and the moves on the region borders even when both allocnos were assigned to the same hard-register. If the reload pass spills a pseudo-register for some reason, the effect will be smaller because another allocno will still be in the hard-register. In most cases, this is better then spilling - both allocnos. If the reload does not change the allocation + both allocnos. If reload does not change the allocation for the two pseudo-registers, the trivial move will be removed by post-reload optimizations. IRA does not generate moves for allocnos assigned to the same hard register when the default @@ -243,7 +243,7 @@ along with GCC; see the file COPYING3. If not see rebuilding would be, but is much faster. o After IR flattening, IRA tries to assign hard registers to all - spilled allocnos. It is impelemented by a simple and fast + spilled allocnos. This is impelemented by a simple and fast priority coloring algorithm (see function reassign_conflict_allocnos::ira-color.c). Here new allocnos created during the code change pass can be assigned to hard @@ -352,21 +352,21 @@ int move_loops_num, additional_jumps_num; of given mode starting with given hard register. */ HARD_REG_SET reg_mode_hard_regset[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES]; -/* The following two variables are array analog of macros +/* The following two variables are array analogs of the macros MEMORY_MOVE_COST and REGISTER_MOVE_COST. */ short int memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2]; move_table *register_move_cost[MAX_MACHINE_MODE]; /* Similar to may_move_in_cost but it is calculated in IRA instead of - regclass. Another difference we take only available hard registers - into account to figure out that one register class is a subset of - the another one. */ + regclass. Another difference is that we take only available hard + registers into account to figure out that one register class is a + subset of the another one. */ move_table *register_may_move_in_cost[MAX_MACHINE_MODE]; /* Similar to may_move_out_cost but it is calculated in IRA instead of - regclass. Another difference we take only available hard registers - into account to figure out that one register class is a subset of - the another one. */ + regclass. Another difference is that we take only available hard + registers into account to figure out that one register class is a + subset of the another one. */ move_table *register_may_move_out_cost[MAX_MACHINE_MODE]; /* Register class subset relation: TRUE if the first class is a subset @@ -374,12 +374,12 @@ move_table *register_may_move_out_cost[MAX_MACHINE_MODE]; allocation. */ int class_subset_p[N_REG_CLASSES][N_REG_CLASSES]; -/* Temporary hard reg set used for different calculation. */ +/* Temporary hard reg set used for a different calculation. */ static HARD_REG_SET temp_hard_regset; -/* The function sets up map REG_MODE_HARD_REGSET. */ +/* The function sets up the map REG_MODE_HARD_REGSET. */ static void setup_reg_mode_hard_regset (void) { @@ -402,8 +402,8 @@ setup_reg_mode_hard_regset (void) all functions of the current compilation unit. */ static HARD_REG_SET no_unit_alloc_regs; -/* Array of number of hard registers of given class which are - available for the allocation. The order is defined by the +/* Array of the number of hard registers of given class which are + available for allocation. The order is defined by the allocation order. */ short class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER]; @@ -459,7 +459,7 @@ setup_class_hard_regs (void) allocation for given classes. */ int available_class_regs[N_REG_CLASSES]; -/* Function setting up AVAILABLE_CLASS_REGS. */ +/* Set up AVAILABLE_CLASS_REGS. */ static void setup_available_class_regs (void) { @@ -476,10 +476,9 @@ setup_available_class_regs (void) } } -/* The function setting up different global variables defining info - about hard registers for the allocation. It depends on - USE_HARD_FRAME_P whose TRUE value means that we can use hard - frame pointer for the allocation. */ +/* Set up global variables defining info about hard registers for the + allocation. These depend on USE_HARD_FRAME_P whose TRUE value means + that we can use the hard frame pointer for the allocation. */ static void setup_alloc_regs (bool use_hard_frame_p) { @@ -492,7 +491,7 @@ setup_alloc_regs (bool use_hard_frame_p) -/* The function sets up MEMORY_MOVE_COST, REGISTER_MOVE_COST. */ +/* Set up MEMORY_MOVE_COST, REGISTER_MOVE_COST. */ static void setup_class_subset_and_memory_move_costs (void) { @@ -549,7 +548,7 @@ static struct obstack ira_obstack; /* Obstack used for storing all bitmaps of the IRA. */ static struct bitmap_obstack ira_bitmap_obstack; -/* The function allocates memory of size LEN for IRA data. */ +/* Allocate memory of size LEN for IRA data. */ void * ira_allocate (size_t len) { @@ -563,7 +562,7 @@ ira_allocate (size_t len) return res; } -/* The function reallocates memory PTR of size LEN for IRA data. */ +/* Reallocate memory PTR of size LEN for IRA data. */ void * ira_reallocate (void *ptr, size_t len) { @@ -577,7 +576,7 @@ ira_reallocate (void *ptr, size_t len) return res; } -/* The function free memory ADDR allocated for IRA data. */ +/* Free memory ADDR allocated for IRA data. */ void ira_free (void *addr ATTRIBUTE_UNUSED) { @@ -589,14 +588,14 @@ ira_free (void *addr ATTRIBUTE_UNUSED) } -/* The function allocates and returns bitmap for IRA. */ +/* Allocate and returns bitmap for IRA. */ bitmap ira_allocate_bitmap (void) { return BITMAP_ALLOC (&ira_bitmap_obstack); } -/* The function frees bitmap B allocated for IRA. */ +/* Free bitmap B allocated for IRA. */ void ira_free_bitmap (bitmap b ATTRIBUTE_UNUSED) { @@ -605,7 +604,7 @@ ira_free_bitmap (bitmap b ATTRIBUTE_UNUSED) -/* The function outputs information about allocation of all allocnos +/* Output information about allocation of all allocnos into file F. */ void print_disposition (FILE *f) @@ -637,8 +636,8 @@ print_disposition (FILE *f) fprintf (f, "\n"); } -/* The function outputs information about allocation of all allocnos - into stderr. */ +/* Outputs information about allocation of all allocnos into + stderr. */ void debug_disposition (void) { @@ -652,8 +651,7 @@ debug_disposition (void) excluded from the consideration). */ static enum reg_class alloc_reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES]; -/* The function initializes the table of subclasses of each reg - class. */ +/* Initialize the table of subclasses of each reg class. */ static void setup_reg_subclasses (void) { @@ -702,7 +700,7 @@ int reg_class_cover_size; used for this. */ enum reg_class reg_class_cover[N_REG_CLASSES]; -/* The value is number of elements in the subsequent array. */ +/* The number of elements in the subsequent array. */ int important_classes_num; /* The array containing non-empty classes (including non-empty cover @@ -717,8 +715,8 @@ int important_class_nums[N_REG_CLASSES]; #ifdef IRA_COVER_CLASSES -/* The function checks IRA_COVER_CLASSES and sets the four global - variables defined above. */ +/* Check IRA_COVER_CLASSES and sets the four global variables defined + above. */ static void setup_cover_and_important_classes (void) { @@ -771,7 +769,7 @@ enum reg_class class_translate[N_REG_CLASSES]; #ifdef IRA_COVER_CLASSES -/* The function sets up array CLASS_TRANSLATE. */ +/* Set up array CLASS_TRANSLATE. */ static void setup_class_translate (void) { @@ -841,25 +839,26 @@ setup_class_translate (void) } #endif -/* The biggest important class inside of intersection of the two - classes (that is calculated taking only hard registers available - for allocation into account). If the both classes contain no hard - registers available for allocation, the value is calculated with - taking all hard-registers including fixed ones into account. */ +/* The biggest important reg_class inside of intersection of the two + reg_classes (that is calculated taking only hard registers + available for allocation into account). If the both reg_classes + contain no hard registers available for allocation, the value is + calculated by taking all hard-registers including fixed ones into + account. */ enum reg_class reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES]; -/* The biggest important class inside of union of the two classes - (that is calculated taking only hard registers available for - allocation into account). If the both classes contain no hard - registers available for allocation, the value is calculated with - taking all hard-registers including fixed ones into account. In - other words, the value is the corresponding reg_class_subunion - value. */ +/* The biggest important reg_class inside of union of the two + reg_classes (that is calculated taking only hard registers + available for allocation into account). If the both reg_classes + contain no hard registers available for allocation, the value is + calculated by taking all hard-registers including fixed ones into + account. In other words, the value is the corresponding + reg_class_subunion value. */ enum reg_class reg_class_union[N_REG_CLASSES][N_REG_CLASSES]; #ifdef IRA_COVER_CLASSES -/* The function sets up REG_CLASS_INTERSECT and REG_CLASS_UNION. */ +/* Set up REG_CLASS_INTERSECT and REG_CLASS_UNION. */ static void setup_reg_class_intersect_union (void) { @@ -926,8 +925,7 @@ setup_reg_class_intersect_union (void) #endif -/* The function outputs all cover classes and the translation map into - file F. */ +/* Output all cover classes and the translation map into file F. */ static void print_class_cover (FILE *f) { @@ -943,7 +941,7 @@ print_class_cover (FILE *f) reg_class_names[class_translate[i]]); } -/* The function outputs all cover classes and the translation map into +/* Output all cover classes and the translation map into stderr. */ void debug_class_cover (void) @@ -951,8 +949,8 @@ debug_class_cover (void) print_class_cover (stderr); } -/* Function setting up different arrays concerning class subsets, - cover and important classes. */ +/* Set up different arrays concerning class subsets, cover and + important classes. */ static void find_reg_class_closure (void) { @@ -974,7 +972,7 @@ int reg_class_nregs[N_REG_CLASSES][MAX_MACHINE_MODE]; /* Maximal value of the previous array elements. */ int max_nregs; -/* Function forming REG_CLASS_NREGS map. */ +/* Form REG_CLASS_NREGS map. */ static void setup_reg_class_nregs (void) { @@ -998,7 +996,7 @@ setup_reg_class_nregs (void) values for given mode are zero. */ HARD_REG_SET prohibited_class_mode_regs[N_REG_CLASSES][NUM_MACHINE_MODES]; -/* The function setting up PROHIBITED_CLASS_MODE_REGS. */ +/* Set up PROHIBITED_CLASS_MODE_REGS. */ static void setup_prohibited_class_mode_regs (void) { @@ -1024,7 +1022,7 @@ setup_prohibited_class_mode_regs (void) -/* The function allocates and initializes REGISTER_MOVE_COST, +/* Allocate and initialize REGISTER_MOVE_COST, REGISTER_MAY_MOVE_IN_COST, and REGISTER_MAY_MOVE_OUT_COST for MODE if it is not done yet. */ void @@ -1066,7 +1064,7 @@ init_register_move_cost (enum machine_mode mode) HARD_REG_SET zero_hard_reg_set; HARD_REG_SET one_hard_reg_set; -/* The function called once during compiler work. It sets up +/* This is called once during compiler work. It sets up different arrays whose values don't depend on the compiled function. */ void @@ -1085,8 +1083,8 @@ init_ira_once (void) init_ira_costs_once (); } -/* The function frees register_move_cost, register_may_move_in_cost, - and register_may_move_out_cost for each mode. */ +/* Free register_move_cost, register_may_move_in_cost, and + register_may_move_out_cost for each mode. */ static void free_register_move_costs (void) { @@ -1104,7 +1102,7 @@ free_register_move_costs (void) } } -/* The function called every time when register related information is +/* This is called every time when register related information is changed. */ void init_ira (void) @@ -1137,7 +1135,7 @@ HARD_REG_SET prohibited_mode_move_regs[NUM_MACHINE_MODES]; /* Flag of that the above array has been initialized. */ static bool prohibited_mode_move_regs_initialized_p = false; -/* The function setting up PROHIBITED_MODE_MOVE_REGS. */ +/* Set up PROHIBITED_MODE_MOVE_REGS. */ static void setup_prohibited_mode_move_regs (void) { @@ -1235,8 +1233,7 @@ compute_regs_asm_clobbered (char *regs_asm_clobbered) } -/* The function sets up ELIMINABLE_REGSET, NO_ALLOC_REGS, and - REGS_EVER_LIVE. */ +/* Set up ELIMINABLE_REGSET, NO_ALLOC_REGS, and REGS_EVER_LIVE. */ static void setup_eliminable_regset (void) { @@ -1321,7 +1318,7 @@ bool *reg_equiv_invariant_p; NULL_RTX. */ rtx *reg_equiv_const; -/* The function sets up the two array declared above. */ +/* Set up the two arrays declared above. */ static void find_reg_equiv_invariant_const (void) { @@ -1374,8 +1371,8 @@ find_reg_equiv_invariant_const (void) -/* The function sets up REG_RENUMBER and CALLER_SAVE_NEEDED (used by - the reload) from the allocation found by IRA. */ +/* Set up REG_RENUMBER and CALLER_SAVE_NEEDED (used by reload) from + the allocation found by IRA. */ static void setup_reg_renumber (void) { @@ -1408,8 +1405,8 @@ setup_reg_renumber (void) } } -/* The function sets up allocno assignment flags for further - allocation improvements. */ +/* Set up allocno assignment flags for further allocation + improvements. */ static void setup_allocno_assignment_flags (void) { @@ -1439,8 +1436,8 @@ setup_allocno_assignment_flags (void) } } -/* The function evaluates overall allocation cost and costs for using - hard registers and memory for allocnos. */ +/* Evaluate overall allocation cost and the costs for using hard + registers and memory for allocnos. */ static void calculate_allocation_cost (void) { @@ -1488,8 +1485,8 @@ calculate_allocation_cost (void) } #ifdef ENABLE_IRA_CHECKING -/* The function checks correctness of the allocation. We do need this - because of complicated code to transform more one region internal +/* Check the correctness of the allocation. We do need this because + of complicated code to transform more one region internal representation into one region representation. */ static void check_allocation (void) @@ -1525,8 +1522,8 @@ check_allocation (void) } #endif -/* The function fixes values of array REG_EQUIV_INIT after live range - splitting done by IRA. */ +/* Fix values of array REG_EQUIV_INIT after live range splitting done + by IRA. */ static void fix_reg_equiv_init (void) { @@ -1573,7 +1570,7 @@ fix_reg_equiv_init (void) } #ifdef ENABLE_IRA_CHECKING -/* The function prints redundant memory-memory copies. */ +/* Print redundant memory-memory copies. */ static void print_redundant_copies (void) { @@ -1631,7 +1628,7 @@ setup_preferred_alternate_classes_for_new_pseudos (int start) -/* Regional allocation can create new pseudo-registers. The function +/* Regional allocation can create new pseudo-registers. This function expands some arrays for pseudo-registers. */ static void expand_reg_info (int old_size) @@ -1649,11 +1646,11 @@ expand_reg_info (int old_size) -/* This page contains code for sorting the insn chain used by the - reload. In old register allocator, the insn chain order - corresponds to the order of insns in RTL. By putting insns with - higher execution frequency first, the reload has a better chance to - generate less expensive operand reloads for such insns. */ +/* This page contains code for sorting the insn chain used by reload. + In the old register allocator, the insn chain order corresponds to + the order of insns in RTL. By putting insns with higher execution + frequency first, reload has a better chance to generate less + expensive operand reloads for such insns. */ /* Map bb index -> order number in the BB chain in RTL code. */ static int *basic_block_order_nums; @@ -1674,8 +1671,7 @@ chain_freq_compare (const void *v1p, const void *v2p) return (const char *) v1p - (const char *) v2p; } -/* The function is used to sort insn chain according insn original - order. */ +/* Sort the insn chain according insn original order. */ static int chain_bb_compare (const void *v1p, const void *v2p) { @@ -1690,7 +1686,7 @@ chain_bb_compare (const void *v1p, const void *v2p) return (const char *) v1p - (const char *) v2p; } -/* The function sorts insn chain according to insn frequencies if +/* Sort the insn chain according to insn frequencies if FREQ_P or according to insn original order otherwise. */ void sort_insn_chain (bool freq_p) -- 2.11.4.GIT