GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "predict.h"
#include "df.h"
#include "insn-config.h"
#include "regs.h"
#include "memmodel.h"
#include "ira.h"
#include "recog.h"
#include "lra-int.h"
Functions | |
static int | move_freq_compare_func (const void *v1p, const void *v2p) |
static void | merge_pseudos (int regno1, int regno2) |
static bool | substitute (rtx *loc) |
static bool | substitute_within_insn (rtx_insn *insn) |
static bool | mem_move_p (int regno1, int regno2) |
static void | update_live_info (bitmap lr_bitmap) |
static bool | coalescable_pseudo_p (int regno) |
bool | lra_coalesce (void) |
Variables | |
static int * | first_coalesced_pseudo |
static int * | next_coalesced_pseudo |
static bitmap_head | coalesced_pseudos_bitmap |
int | lra_coalesce_iter |
static bitmap_head | used_pseudos_bitmap |
|
static |
Return true if pseudo REGNO can be potentially coalesced.
References ira_reg_equiv, lra_assert, and NULL_RTX.
Referenced by lra_coalesce().
bool lra_coalesce | ( | void | ) |
The major function for aggressive pseudo coalescing of moves only if the both pseudos were spilled and not special reload pseudos.
References bitmap_bit_p, bitmap_clear(), bitmap_initialize(), bitmap_ior_into(), BLOCK_FOR_INSN(), cfun, coalescable_pseudo_p(), coalesced_pseudos_bitmap, df_get_live_in(), df_get_live_out(), first_coalesced_pseudo, FOR_BB_INSNS_SAFE, FOR_EACH_BB_FN, free(), get_max_uid(), i, INSN_P, INSN_UID(), lra_assert, lra_coalesce_iter, lra_dump_file, lra_intersected_live_ranges_p(), lra_reg_info, lra_set_insn_deleted(), lra_set_regno_unique_value(), lra_update_insn_regno_info(), max_reg_num(), max_regno, mem_move_p(), merge_pseudos(), move_freq_compare_func(), next_coalesced_pseudo, NULL, NULL_RTX, ORIGINAL_REGNO, qsort, REG_FREQ_FROM_BB, reg_obstack, REG_P, REGNO, SET_DEST, set_noop_p(), SET_SRC, side_effects_p(), single_set(), substitute_within_insn(), timevar_pop(), timevar_push(), update_live_info(), and used_pseudos_bitmap.
Referenced by lra().
|
static |
Return true if the move involving REGNO1 and REGNO2 is a potential memory-memory move.
References reg_renumber.
Referenced by lra_coalesce().
|
static |
Merge two sets of coalesced pseudos given correspondingly by pseudos REGNO1 and REGNO2 (more accurately merging REGNO2 group into REGNO1 group). Set up COALESCED_PSEUDOS_BITMAP.
References bitmap_set_bit, coalesced_pseudos_bitmap, first_coalesced_pseudo, last, lra_reg::live_ranges, lra_copy_live_range_list(), lra_merge_live_ranges(), lra_reg_info, lra_update_biggest_mode(), and next_coalesced_pseudo.
Referenced by lra_coalesce().
|
static |
The function is used to sort moves according to their execution frequencies.
References BLOCK_FOR_INSN(), INSN_UID(), and REG_FREQ_FROM_BB.
Referenced by lra_coalesce().
Change pseudos in *LOC on their coalescing group representatives.
References first_coalesced_pseudo, GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, NULL_RTX, REGNO, regno_reg_rtx, substitute(), XEXP, XVECEXP, and XVECLEN.
Referenced by substitute(), and substitute_within_insn().
Specialize "substitute" for use on an insn. This can't change the insn ptr, just the contents of the insn.
References substitute().
Referenced by lra_coalesce().
|
static |
Set up USED_PSEUDOS_BITMAP, and update LR_BITMAP (a BB live info bitmap).
References bitmap_and_compl_into(), bitmap_clear(), bitmap_empty_p(), bitmap_ior_into(), bitmap_set_bit, coalesced_pseudos_bitmap, EXECUTE_IF_AND_IN_BITMAP, first_coalesced_pseudo, and used_pseudos_bitmap.
Referenced by lra_coalesce().
|
static |
Pseudos which go away after coalescing.
Referenced by lra_coalesce(), merge_pseudos(), and update_live_info().
|
static |
Coalesce spilled pseudos. Copyright (C) 2010-2024 Free Software Foundation, Inc. Contributed by Vladimir Makarov <vmakarov@redhat.com>. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
This file contains a pass making some simple RTL code transformations by coalescing pseudos to remove some move insns. Spilling pseudos in LRA can create memory-memory moves. We should remove potential memory-memory moves before the next constraint pass because the constraint pass will generate additional insns for such moves and all these insns will be hard to remove afterwards. Here we coalesce only spilled pseudos. Coalescing non-spilled pseudos (with different hard regs) might result in spilling additional pseudos because of possible conflicts with other non-spilled pseudos and, as a consequence, in more constraint passes and even LRA infinite cycling. Trivial the same hard register moves will be removed by subsequent compiler passes. We don't coalesce special reload pseudos. It complicates LRA code a lot without visible generated code improvement. The pseudo live-ranges are used to find conflicting pseudos during coalescing. Most frequently executed moves is tried to be coalesced first.
Arrays whose elements represent the first and the next pseudo (regno) in the coalesced pseudos group to which given pseudo (its regno is the index) belongs. The next of the last pseudo in the group refers to the first pseudo in the group, in other words the group is represented by a cyclic list.
Referenced by lra_coalesce(), merge_pseudos(), substitute(), and update_live_info().
int lra_coalesce_iter |
The current iteration (1, 2, ...) of the coalescing pass.
Referenced by lra(), and lra_coalesce().
|
static |
Referenced by lra_coalesce(), and merge_pseudos().
|
static |
Pseudos used instead of the coalesced pseudos.
Referenced by lra_coalesce(), and update_live_info().