GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "df.h"
#include "valtrack.h"
#include "regs.h"
#include "memmodel.h"
#include "emit-rtl.h"
#include "rtl-iter.h"
Data Structures | |
struct | rtx_subst_pair |
Replace auto-increment addressing modes with explicit operations to access the same addresses without modifying the corresponding registers.
References CASE_CONST_ANY, cleanup_auto_inc_dec(), gcc_assert, gen_int_mode(), GET_CODE, GET_MODE, GET_MODE_SIZE(), GET_RTX_FORMAT, GET_RTX_LENGTH, i, INSN_P, offset, ORIGINAL_REGNO, REG_P, REGNO, rtvec_alloc(), RTX_CODE, RTX_FLAG, shallow_copy_rtx(), shared_const_p(), XEXP, XVEC, XVECEXP, and XVECLEN.
Referenced by cleanup_auto_inc_dec(), dead_debug_insert_temp(), and propagate_for_debug_subst().
void dead_debug_add | ( | struct dead_debug_local * | debug, |
df_ref | use, | ||
unsigned int | uregno ) |
Add USE to DEBUG, or substitute it right away if it's a pseudo in the global substitution list. USE must be a dead reference to UREGNO in a debug insn. Create a bitmap for DEBUG as needed.
References BITMAP_ALLOC, bitmap_set_bit, dead_debug_global_replace_temp(), debug, dead_debug_use::next, NULL, and dead_debug_use::use.
Referenced by dce_process_block(), df_note_bb_compute(), move_insn_for_shrink_wrap(), and word_dce_process_block().
|
static |
Locate the entry for REG in GLOBAL->htab.
References hash_table< Descriptor, Lazy, Allocator >::find(), gcc_checking_assert, dead_debug_global::htab, and dead_debug_global_entry::reg.
Referenced by dead_debug_global_replace_temp(), and dead_debug_insert_temp().
void dead_debug_global_finish | ( | struct dead_debug_global * | global, |
bitmap | used ) |
Release GLOBAL->used unless it is the same as USED. Release the mapping hash table if it was initialized.
References BITMAP_FREE, dead_debug_global::htab, NULL, and dead_debug_global::used.
Referenced by fast_dce().
void dead_debug_global_init | ( | struct dead_debug_global * | debug, |
bitmap | used ) |
Initialize DEBUG to an empty list, and clear USED, if given.
References bitmap_clear(), debug, NULL, and rtx_def::used.
Referenced by fast_dce().
|
static |
Insert an entry mapping REG to DTEMP in GLOBAL->htab.
References dead_debug_global_entry::dtemp, hash_table< Descriptor, Lazy, Allocator >::find_slot(), gcc_checking_assert, dead_debug_global::htab, and dead_debug_global_entry::reg.
Referenced by dead_debug_promote_uses().
|
static |
If UREGNO, referenced by USE, is a pseudo marked as used in GLOBAL, replace it with a USE of the debug temp recorded for it, and return TRUE. Otherwise, just return FALSE. If PTO_RESCAN is given, instead of rescanning modified INSNs right away, add their UIDs to the bitmap, allocating one of *PTO_RESCAN is NULL.
References BITMAP_ALLOC, bitmap_bit_p, bitmap_set_bit, dead_debug_global_find(), df_insn_rescan(), DF_REF_INSN, DF_REF_REAL_LOC, dead_debug_global_entry::dtemp, gcc_checking_assert, GET_CODE, INSN_UID(), NULL, dead_debug_global_entry::reg, REG_P, REGNO, and dead_debug_global::used.
Referenced by dead_debug_add(), and dead_debug_promote_uses().
int dead_debug_insert_temp | ( | struct dead_debug_local * | debug, |
unsigned int | uregno, | ||
rtx_insn * | insn, | ||
enum debug_temp_where | where ) |
If UREGNO is referenced by any entry in DEBUG, emit a debug insn before or after INSN (depending on WHERE), that binds a (possibly global) debug temp to the widest-mode use of UREGNO, if WHERE is *_WITH_REG, or the value stored in UREGNO by INSN otherwise, and replace all uses of UREGNO in DEBUG with uses of the debug temp. INSN must be where UREGNO dies, if WHERE is *_BEFORE_*, or where it is set otherwise. Return the number of debug insns emitted.
References BITMAP_ALLOC, bitmap_bit_p, bitmap_clear_bit(), bitmap_set_bit, candidate(), cleanup_auto_inc_dec(), dead_debug_global_find(), dead_debug_reset_uses(), debug, DEBUG_EXPR_TREE_DECL, DEBUG_INSN_P, debug_lowpart_subreg(), DEBUG_TEMP_AFTER_WITH_REG, DEBUG_TEMP_AFTER_WITH_REG_FORCE, DEBUG_TEMP_BEFORE_WITH_VALUE, DF_REF_INSN, DF_REF_REAL_LOC, DF_REF_REGNO, dead_debug_global_entry::dtemp, emit_debug_insn_after(), emit_debug_insn_before(), gcc_checking_assert, gen_rtx_VAR_LOCATION(), GET_CODE, GET_MODE, GET_MODE_BITSIZE(), hard_regno_nregs(), INSN_UID(), INSN_VAR_LOCATION_LOC, make_debug_expr_from_rtl(), dead_debug_use::next, NULL, NULL_RTX, dead_debug_global_entry::reg, REG_NREGS, REG_P, REGNO, regno_reg_rtx, SET_DEST, SET_SRC, single_set(), subreg_lowpart_p(), SUBREG_REG, dead_debug_use::use, VAR_INIT_STATUS_INITIALIZED, and volatile_insn_p().
Referenced by dce_process_block(), dead_debug_promote_uses(), df_create_unused_note(), df_note_bb_compute(), df_set_unused_notes_for_mw(), move_insn_for_shrink_wrap(), and word_dce_process_block().
void dead_debug_local_finish | ( | struct dead_debug_local * | debug, |
bitmap | used ) |
Reset all debug insns with pending uses. Release the bitmap in it, unless it is USED. USED must be the same bitmap passed to dead_debug_local_init.
References BITMAP_FREE, dead_debug_promote_uses(), dead_debug_reset_uses(), debug, df_insn_rescan(), DF_INSN_UID_SAFE_GET, EXECUTE_IF_SET_IN_BITMAP, and df_insn_info::insn.
Referenced by dce_process_block(), df_note_bb_compute(), prepare_shrink_wrap(), and word_dce_process_block().
void dead_debug_local_init | ( | struct dead_debug_local * | debug, |
bitmap | used, | ||
struct dead_debug_global * | global ) |
Initialize DEBUG to an empty list, and clear USED, if given. Link back to GLOBAL, if given, and bring in used bits from it.
References BITMAP_ALLOC, bitmap_clear(), bitmap_copy(), debug, NULL, and dead_debug_global::used.
Referenced by dce_process_block(), df_note_bb_compute(), prepare_shrink_wrap(), and word_dce_process_block().
|
static |
Promote pending local uses of pseudos in DEBUG to global substitutions. Uses of non-pseudos are left alone for resetting.
References BITMAP_ALLOC, bitmap_set_bit, dead_debug_global_insert(), dead_debug_global_replace_temp(), dead_debug_insert_temp(), debug, DEBUG_EXPR_TREE_DECL, DEBUG_INSN_P, DEBUG_TEMP_BEFORE_WITH_VALUE, DF_REF_INSN, DF_REF_NEXT_REG, DF_REF_REAL_LOC, DF_REG_DEF_CHAIN, DF_REG_USE_CHAIN, dead_debug_global_entry::dtemp, emit_debug_insn_before(), gcc_checking_assert, gen_rtx_UNKNOWN_VAR_LOC, gen_rtx_VAR_LOCATION(), GET_CODE, GET_MODE, df_insn_info::insn, INSN_UID(), INSN_VAR_LOCATION_LOC, make_debug_expr_from_rtl(), NULL, REGNO, and VAR_INIT_STATUS_INITIALIZED.
Referenced by dead_debug_local_finish().
|
static |
Reset all debug uses in HEAD, and clear DEBUG->to_rescan bits of each reset insn. DEBUG is not otherwise modified. If HEAD is DEBUG->head, DEBUG->head will be set to NULL at the end. Otherwise, entries from DEBUG->head that pertain to reset insns will be removed, and only then rescanned.
References BITMAP_ALLOC, bitmap_bit_p, bitmap_clear_bit(), BITMAP_FREE, bitmap_set_bit, debug, df_insn_rescan_debug_internal(), DF_INSN_UID_SAFE_GET, DF_REF_INSN, EXECUTE_IF_SET_IN_BITMAP, gen_rtx_UNKNOWN_VAR_LOC, df_insn_info::insn, INSN_UID(), INSN_VAR_LOCATION_LOC, dead_debug_use::next, NULL, and dead_debug_use::use.
Referenced by dead_debug_insert_temp(), and dead_debug_local_finish().
|
static |
Like lowpart_subreg, but if a subreg is not valid for machine, force it anyway - for use in debug insns.
References GET_MODE, NULL_RTX, offset, simplify_gen_subreg(), and subreg_lowpart_offset().
Referenced by dead_debug_insert_temp().
Infrastructure for tracking user variable locations and values throughout compilation. Copyright (C) 2010-2024 Free Software Foundation, Inc. Contributed by Alexandre Oliva <aoliva@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/>.
gen_lowpart_no_emit hook implementation for DEBUG_INSNs. In DEBUG_INSNs, all lowpart SUBREGs are valid, despite what the machine requires for instructions.
References gen_lowpart_if_possible(), GET_MODE, NULL_RTX, and subreg_lowpart_offset().
Referenced by propagate_for_debug().
void propagate_for_debug | ( | rtx_insn * | insn, |
rtx_insn * | last, | ||
rtx | dest, | ||
rtx | src, | ||
basic_block | this_basic_block ) |
Replace all the occurrences of DEST with SRC in DEBUG_INSNs between INSN and LAST, not including INSN, but including LAST. Also stop at the end of THIS_BASIC_BLOCK.
References rtx_subst_pair::adjusted, BB_END, DEBUG_BIND_INSN_P, df_insn_rescan(), end(), gen_lowpart_for_debug(), rtl_hooks::gen_lowpart_no_emit, gen_rtx_UNKNOWN_VAR_LOC, rtx_subst_pair::insn, INSN_VAR_LOCATION_LOC, last, NEXT_INSN(), propagate_for_debug_subst(), simplify_replace_fn_rtx(), this_basic_block, rtx_subst_pair::to, and volatile_insn_p().
Referenced by attempt_change(), and try_combine().
DATA points to an rtx_subst_pair. Return the value that should be substituted.
References ALL, cleanup_auto_inc_dec(), copy_rtx(), DEBUG_EXPR_TREE_DECL, df_insn_rescan(), emit_debug_insn_before(), FOR_EACH_SUBRTX, gen_rtx_UNKNOWN_VAR_LOC, gen_rtx_VAR_LOCATION(), GET_MODE, make_compound_operation(), make_debug_expr_from_rtl(), NULL_RTX, REG_P, rtx_equal_p(), SET, rtx_subst_pair::to, VAR_INIT_STATUS_INITIALIZED, and volatile_insn_p().
Referenced by propagate_for_debug().