#include "config.h"#include "system.h"#include "machmode.h"#include "hard-reg-set.h"#include "rtl.h"#include "tm_p.h"#include "flags.h"#include "basic-block.h"#include "regs.h"#include "function.h"#include "insn-config.h"#include "reload.h"#include "output.h"#include "toplev.h"

Go to the source code of this file.
Data Types | |
| type | allocno |
Defines | |
| #define | INT_BITS HOST_BITS_PER_WIDE_INT |
| #define | INT_TYPE HOST_WIDE_INT |
| #define | CONFLICTP(I, J) |
| #define | EXECUTE_IF_SET_IN_ALLOCNO_SET(ALLOCNO_SET, ALLOCNO, CODE) |
| #define | SET_REGBIT(TABLE, I, J) SET_HARD_REG_BIT (allocno[I].TABLE, J) |
| #define | SET_ALLOCNO_LIVE(I) |
| #define | CLEAR_ALLOCNO_LIVE(I) |
Functions/Subroutines | |
| static int allocno_compare | PARAMS ((const PTR, const PTR)) |
| static void global_conflicts | PARAMS ((void)) |
| static void find_reg | PARAMS ((int, HARD_REG_SET, int, int, int)) |
| static void record_one_conflict | PARAMS ((int)) |
| static void record_conflicts | PARAMS ((int *, int)) |
| static void mark_reg_store | PARAMS ((rtx, rtx, void *)) |
| static void mark_reg_conflicts | PARAMS ((rtx)) |
| static void mark_reg_live_nc | PARAMS ((int, enum machine_mode)) |
| static void set_preference | PARAMS ((rtx, rtx)) |
| static void dump_conflicts | PARAMS ((FILE *)) |
| static void reg_dies | PARAMS ((int, enum machine_mode, struct insn_chain *)) |
| int | global_alloc (FILE *file) |
| static int | allocno_compare (PTR v1p, const PTR v2p) const |
| static void | global_conflicts () |
| static void | expand_preferences () |
| static void | prune_preferences () |
| static void | find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbered, int retrying) |
| void | retry_global_alloc (int regno, HARD_REG_SET forbidden_regs) |
| static void | record_one_conflict (int regno) |
| static void | record_conflicts (int *allocno_vec, int len) |
| static void | mirror_conflicts () |
| static void | mark_reg_store (rtx reg, rtx setter, data) |
| static void | mark_reg_clobber (rtx reg, rtx setter, data) |
| static void | mark_reg_conflicts (rtx reg) |
| static void | mark_reg_death (rtx reg) |
| static void | mark_reg_live_nc (int regno, enum machine_mode mode) |
| static void | set_preference (rtx dest, rtx src) |
| void | mark_elimination (int from, int to) |
| static void | reg_becomes_live (rtx reg, setter, void *regs_set) |
| static void | reg_dies (int regno, enum machine_mode mode, struct insn_chain *chain) |
| void | build_insn_chain (rtx first) |
| static void | dump_conflicts (FILE *file) |
| void | dump_global_regs (FILE *file) |
Variables | |
| static int | max_allocno |
| static int * | reg_allocno |
| static struct allocno * | allocno |
| static int * | allocno_order |
| static int * | reg_may_share |
| static INT_TYPE * | conflicts |
| static int | allocno_row_words |
| static HARD_REG_SET | hard_regs_live |
| static HARD_REG_SET | no_global_alloc_regs |
| static HARD_REG_SET | regs_used_so_far |
| static int | local_reg_n_refs [FIRST_PSEUDO_REGISTER] |
| static int | local_reg_freq [FIRST_PSEUDO_REGISTER] |
| static int | local_reg_live_length [FIRST_PSEUDO_REGISTER] |
| static INT_TYPE * | allocnos_live |
| static rtx * | regs_set |
| static int | n_regs_set |
| static HARD_REG_SET | eliminable_regset |
| static regset | live_relevant_regs |
| #define CLEAR_ALLOCNO_LIVE | ( | I | ) |
| #define CONFLICTP | ( | I, | |||
| J | ) |
Value:
(conflicts[(I) * allocno_row_words + (unsigned) (J) / INT_BITS] \ & ((INT_TYPE) 1 << ((unsigned) (J) % INT_BITS)))
Definition at line 175 of file global.c.
Referenced by dump_conflicts(), and expand_preferences().
| #define EXECUTE_IF_SET_IN_ALLOCNO_SET | ( | ALLOCNO_SET, | |||
| ALLOCNO, | |||||
| CODE | ) |
Value:
do { \ int i_; \ int allocno_; \ INT_TYPE *p_ = (ALLOCNO_SET); \ \ for (i_ = allocno_row_words - 1, allocno_ = 0; i_ >= 0; \ i_--, allocno_ += INT_BITS) \ { \ unsigned INT_TYPE word_ = (unsigned INT_TYPE) *p_++; \ \ for ((ALLOCNO) = allocno_; word_; word_ >>= 1, (ALLOCNO)++) \ { \ if (word_ & 1) \ {CODE;} \ } \ } \ } while (0)
Definition at line 181 of file global.c.
Referenced by find_reg(), global_conflicts(), prune_preferences(), and record_one_conflict().
| #define INT_BITS HOST_BITS_PER_WIDE_INT |
| #define INT_TYPE HOST_WIDE_INT |
Definition at line 158 of file global.c.
Referenced by global_alloc(), global_conflicts(), IPO_Types_Are_Compatible(), and mirror_conflicts().
| #define SET_ALLOCNO_LIVE | ( | I | ) |
Value:
Definition at line 247 of file global.c.
Referenced by global_conflicts(), and mark_reg_store().
| #define SET_REGBIT | ( | TABLE, | |||
| I, | |||||
| J | ) | SET_HARD_REG_BIT (allocno[I].TABLE, J) |
Definition at line 600 of file global.c.
References double, floor_log2, allocno::freq, allocno::live_length, allocno::n_refs, REG_FREQ_MAX, and size.
Referenced by global_alloc().
Definition at line 1794 of file global.c.
Referenced by global_alloc(), rest_of_compilation(), rest_of_handle_global_alloc(), and rest_of_handle_old_regalloc().
Definition at line 1900 of file global.c.
References allocno_order, CONFLICTP, FIRST_PSEUDO_REGISTER, fprintf(), i, max_allocno, max_regno, nregs, reg_allocno, reg_renumber, size, and TEST_HARD_REG_BIT.
Referenced by global_alloc().
Definition at line 1958 of file global.c.
Referenced by rest_of_compilation(), rest_of_handle_global_alloc(), and rest_of_handle_old_regalloc().
Definition at line 841 of file global.c.
References a1, a2, CONFLICTP, GET_CODE, get_insns(), allocno::hard_reg_copy_preferences, allocno::hard_reg_full_preferences, allocno::hard_reg_preferences, insn, INSN_P, IOR_HARD_REG_SET, NEXT_INSN, REG, reg_allocno, REG_DEAD, REG_NOTE_KIND, REG_NOTES, REGNO, SET_DEST, SET_SRC, single_set, and XEXP.
Referenced by global_alloc().
| static void find_reg | ( | int | num, | |
| HARD_REG_SET | losers, | |||
| int | alt_regs_p, | |||
| int | accept_call_clobbered, | |||
| int | retrying | |||
| ) | [static] |
Definition at line 980 of file global.c.
References allocno_row_words, AND_COMPL_HARD_REG_SET, caller_save_needed, CALLER_SAVE_PROFITABLE, CANNOT_CHANGE_MODE_CLASS, CLEAR_HARD_REG_SET, conflicts, COPY_HARD_REG_SET, double, EXECUTE_IF_SET_IN_ALLOCNO_SET, FIRST_PSEUDO_REGISTER, flag_caller_saves, for(), GO_IF_HARD_REG_SUBSET, HARD_REG_SET, HARD_REGNO_CALL_PART_CLOBBERED, HARD_REGNO_MODE_OK, HARD_REGNO_NREGS, i, if(), invalid_mode_change_p(), IOR_COMPL_HARD_REG_SET, IOR_HARD_REG_SET, LAST_STACK_REG, local_reg_freq, local_reg_live_length, local_reg_n_refs, losing_caller_save_reg_set, max_regno, mode, NO_REGS, PSEUDO_REGNO_MODE, r, reg_allocno, reg_class_contents, reg_class_subset_p(), reg_may_share, reg_preferred_class(), reg_renumber, REGNO_REG_CLASS, regs_used_so_far, SET_HARD_REG_BIT, size, STACK_REGS, TEST_HARD_REG_BIT, tmp1, and tmp2.
Referenced by find_reg(), find_reload_regs(), global_alloc(), and retry_global_alloc().
| int global_alloc | ( | FILE * | file | ) |
Definition at line 317 of file global.c.
Referenced by rest_of_compilation(), rest_of_handle_global_alloc(), and rest_of_handle_old_regalloc().
Definition at line 630 of file global.c.
References a, allocno_row_words, allocnos_live, b, EDGE_ABNORMAL, basic_block_def::end, EXECUTE_IF_SET_IN_ALLOCNO_SET, EXECUTE_IF_SET_IN_REG_SET, find_regno_note(), FIRST_PSEUDO_REGISTER, FIRST_STACK_REG, edge::flags, FOR_EACH_BB, free(), GET_CODE, basic_block_def::global_live_at_start, hard_regs_live, basic_block_def::head, i, insn, INT_TYPE, LAST_STACK_REG, mark_reg_clobber(), mark_reg_conflicts(), mark_reg_death(), mark_reg_live_nc(), mark_reg_store(), max_allocno, max_parallel, memset, multiple_sets(), n_regs_set, NEXT_INSN, note_stores(), NULL, NULL_RTX, PATTERN, basic_block_def::pred, edge::pred_next, PSEUDO_REGNO_MODE, record_conflicts(), record_one_conflict(), REG, reg_allocno, REG_DEAD, REG_INC, REG_NO_CONFLICT, REG_NOTE_KIND, REG_NOTES, reg_overlap_mentioned_p(), reg_renumber, REG_SET_TO_HARD_REG_SET, REG_UNUSED, REGNO, regs_set, RTX_CODE, rtx_equal_p(), SET, SET_ALLOCNO_LIVE, SET_DEST, XEXP, xmalloc(), XVECEXP, and XVECLEN.
Referenced by global_alloc().
| void mark_elimination | ( | int | from, | |
| int | to | |||
| ) |
Definition at line 1491 of file global.c.
References GET_CODE, and mark_reg_store().
Referenced by global_conflicts().
Definition at line 1503 of file global.c.
References FIRST_PSEUDO_REGISTER, fixed_regs, GET_CODE, GET_MODE, HARD_REGNO_NREGS, last, record_one_conflict(), REG, reg_allocno, reg_renumber, REGNO, and SUBREG_REG.
Referenced by global_conflicts().
Definition at line 1543 of file global.c.
References CLEAR_ALLOCNO_LIVE, CLEAR_HARD_REG_BIT, FIRST_PSEUDO_REGISTER, fixed_regs, GET_MODE, HARD_REGNO_NREGS, hard_regs_live, last, reg_allocno, reg_renumber, and REGNO.
Referenced by global_conflicts().
| static void mark_reg_live_nc | ( | int | regno, | |
| enum machine_mode | mode | |||
| ) | [static] |
Definition at line 1580 of file global.c.
References HARD_REGNO_NREGS, hard_regs_live, last, and SET_HARD_REG_BIT.
Referenced by global_conflicts().
Definition at line 1442 of file global.c.
References FIRST_PSEUDO_REGISTER, fixed_regs, GET_CODE, GET_MODE, HARD_REGNO_NREGS, hard_regs_live, last, n_regs_set, record_one_conflict(), REG, reg_allocno, reg_renumber, REGNO, regs_set, SET_ALLOCNO_LIVE, SET_HARD_REG_BIT, set_preference(), SET_SRC, and SUBREG_REG.
Referenced by global_conflicts(), and mark_reg_clobber().
Definition at line 1394 of file global.c.
References allocno_row_words, conflicts, i, INT_BITS, INT_TYPE, max_allocno, p, q0, q1, and q2.
Referenced by global_alloc().
| static void reg_dies PARAMS | ( | (int, enum machine_mode, struct insn_chain *) | ) | [static] |
| static void mark_reg_live_nc PARAMS | ( | (int, enum machine_mode) | ) | [static] |
| static void record_conflicts PARAMS | ( | (int *, int) | ) | [static] |
| static void record_one_conflict PARAMS | ( | (int) | ) | [static] |
| static void find_reg PARAMS | ( | (int, HARD_REG_SET, int, int, int) | ) | [static] |
Definition at line 77 of file cplus-dem.c.
Definition at line 892 of file global.c.
References allocno_order, allocno_row_words, AND_COMPL_HARD_REG_SET, call_used_reg_set, allocno::calls_crossed, CLEAR_HARD_REG_SET, conflicts, COPY_HARD_REG_SET, EXECUTE_IF_SET_IN_ALLOCNO_SET, fixed_reg_set, free(), allocno::hard_reg_conflicts, allocno::hard_reg_copy_preferences, allocno::hard_reg_full_preferences, allocno::hard_reg_preferences, HARD_REG_SET, i, IOR_COMPL_HARD_REG_SET, IOR_HARD_REG_SET, max_allocno, reg_class_contents, reg_preferred_class(), allocno::regs_someone_prefers, size, and xmalloc().
Referenced by global_alloc().
| static void record_conflicts | ( | int * | allocno_vec, | |
| int | len | |||
| ) | [static] |
Definition at line 1377 of file global.c.
References allocno_row_words, hard_regs_live, and IOR_HARD_REG_SET.
Referenced by global_conflicts().
| static void record_one_conflict | ( | int | regno | ) | [static] |
Definition at line 1333 of file global.c.
References allocno_row_words, allocnos_live, conflicts, EXECUTE_IF_SET_IN_ALLOCNO_SET, FIRST_PSEUDO_REGISTER, hard_regs_live, IOR_HARD_REG_SET, reg_allocno, and SET_HARD_REG_BIT.
Referenced by global_conflicts(), mark_reg_conflicts(), and mark_reg_store().
Definition at line 1733 of file global.c.
References FIRST_PSEUDO_REGISTER, fixed_regs, GET_CODE, GET_MODE, HARD_REGNO_NREGS, nregs, REG, reg_renumber, REGNO, SET_REGNO_REG_SET, and SUBREG_REG.
Referenced by build_insn_chain().
| static void reg_dies | ( | int | regno, | |
| enum machine_mode | mode, | |||
| struct insn_chain * | chain | |||
| ) | [static] |
Definition at line 1767 of file global.c.
References CLEAR_REGNO_REG_SET, FIRST_PSEUDO_REGISTER, fixed_regs, HARD_REGNO_NREGS, nregs, reg_renumber, and SET_REGNO_REG_SET.
Referenced by build_insn_chain().
| void retry_global_alloc | ( | int | regno, | |
| HARD_REG_SET | forbidden_regs | |||
| ) |
Definition at line 1300 of file global.c.
References find_reg(), mark_home_live(), N_REG_CLASSES, NO_REGS, reg_allocno, reg_alternate_class(), reg_renumber, REGNO, and regno_reg_rtx.
Referenced by finish_spills().
Definition at line 1602 of file global.c.
References copy, FIRST_PSEUDO_REGISTER, GET_CODE, GET_MODE, GET_RTX_FORMAT, HARD_REGNO_NREGS, i, offset, REG, reg_allocno, reg_renumber, REGMODE_NATURAL_SIZE, REGNO, SET_REGBIT, SUBREG_BYTE, SUBREG_REG, subreg_regno_offset(), and XEXP.
Referenced by mark_reg_store().
int* allocno_order [static] |
Definition at line 145 of file global.c.
Referenced by dump_conflicts(), global_alloc(), and prune_preferences().
int allocno_row_words [static] |
Definition at line 171 of file global.c.
Referenced by find_reg(), global_alloc(), global_conflicts(), mirror_conflicts(), prune_preferences(), record_conflicts(), and record_one_conflict().
INT_TYPE* allocnos_live [static] |
Definition at line 242 of file global.c.
Referenced by global_alloc(), global_conflicts(), and record_one_conflict().
INT_TYPE* conflicts [static] |
Definition at line 166 of file global.c.
Referenced by SWP_ALLOCATOR::_best_fit(), SWP_ALLOCATOR::_has_conflicts(), SWP_ALLOCATOR::_num_new_conflicts(), SWP_ALLOCATOR::_update_conflicts(), compute_coalesced_reg_partition(), find_reg(), global_alloc(), livethrough_conflicts_bb(), mirror_conflicts(), prune_preferences(), and record_one_conflict().
HARD_REG_SET eliminable_regset [static] |
HARD_REG_SET hard_regs_live [static] |
Definition at line 212 of file global.c.
Referenced by global_conflicts(), mark_reg_death(), mark_reg_live_nc(), mark_reg_store(), record_conflicts(), and record_one_conflict().
regset live_relevant_regs [static] |
Definition at line 1728 of file global.c.
Referenced by build_insn_chain(), reg_becomes_live(), and reg_dies().
int local_reg_freq[FIRST_PSEUDO_REGISTER] [static] |
int local_reg_live_length[FIRST_PSEUDO_REGISTER] [static] |
int local_reg_n_refs[FIRST_PSEUDO_REGISTER] [static] |
int max_allocno [static] |
Definition at line 80 of file global.c.
Referenced by dump_conflicts(), global_alloc(), global_conflicts(), mirror_conflicts(), and prune_preferences().
int n_regs_set [static] |
HARD_REG_SET no_global_alloc_regs [static] |
int* reg_allocno [static] |
Definition at line 85 of file global.c.
Referenced by dump_conflicts(), expand_preferences(), find_reg(), global_alloc(), global_conflicts(), mark_reg_conflicts(), mark_reg_death(), mark_reg_store(), record_one_conflict(), retry_global_alloc(), and set_preference().
int* reg_may_share [static] |
HARD_REG_SET regs_used_so_far [static] |
1.5.6