GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "alias.h"
#include "tree.h"
#include "basic-block.h"
#include "print-tree.h"
#include "flags.h"
#include "predict.h"
#include "function.h"
#include "cfg.h"
#include "diagnostic.h"
#include "tree-pretty-print.h"
#include "alloc-pool.h"
#include "cselib.h"
#include "dumpfile.h"
#include "dwarf2out.h"
#include "pretty-print.h"
#include "print-rtl.h"
#include "rtl-iter.h"
Variables | |
const char * | print_rtx_head = "" |
DEBUG_VARIABLE int | debug_rtx_count = 0 |
DEBUG_FUNCTION void debug | ( | const rtx_def & | ref | ) |
Dump rtx REF.
References debug_rtx().
DEBUG_FUNCTION void debug | ( | const rtx_def * | ptr | ) |
References debug.
|
extern |
References BASIC_BLOCK_FOR_FN, cfun, and debug_bb_slim().
|
extern |
References debug_bb(), TDF_BLOCKS, and TDF_SLIM.
Referenced by debug_bb_n_slim().
|
extern |
Emit a slim dump of X (an insn) to stderr.
References dump_insn_slim().
DEBUG_FUNCTION void debug_rtl_slim | ( | const rtx_insn * | first, |
const rtx_insn * | last, | ||
int | count, | ||
int | flags ) |
References count, dump_rtl_slim(), and last.
Same as above, but using dump_rtl_slim.
DEBUG_FUNCTION void debug_rtx | ( | const_rtx | x | ) |
Call this function from the debugger to see what X looks like.
References NULL, and rtx_writer::print_rtx().
Referenced by _fatal_insn(), debug(), debug_df_insn(), debug_dv(), debug_rtx_list(), debug_rtx_range(), make_insn_raw(), rtl_verify_fallthru(), and verify_rtx_sharing().
DEBUG_FUNCTION const rtx_insn * debug_rtx_find | ( | const rtx_insn * | x, |
int | uid ) |
Call this function to search an rtx_insn list to find one with insn uid UID, and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT. The found insn is returned to enable further debugging analysis.
References debug_rtx_count, debug_rtx_list(), INSN_UID(), and NEXT_INSN().
DEBUG_FUNCTION void debug_rtx_list | ( | const rtx_insn * | x, |
int | n ) |
Call this function to print list from X on. N is a count of the rtx's to print. Positive values print from the specified rtx_insn on. Negative values print a window around the rtx_insn. EG: -5 prints 2 rtx_insn's on either side (in addition to the specified rtx_insn).
References count, debug_rtx(), i, NEXT_INSN(), and PREV_INSN().
Referenced by debug_rtx_find().
DEBUG_FUNCTION void debug_rtx_range | ( | const rtx_insn * | start, |
const rtx_insn * | end ) |
Call this function to print an rtx_insn list from START to END inclusive.
References debug_rtx(), end(), and NEXT_INSN().
|
static |
Like debug_rtx but with no newline, as debug_helper will add one. Note: No debug_slim(rtx_insn *) variant implemented, as this function can serve for both rtx and rtx_insn.
References NULL, and rtx_writer::print_rtx().
void dump_insn_slim | ( | FILE * | f, |
const rtx_insn * | x ) |
Emit a slim dump of X (an insn) to the file F, including any register note attached to the instruction.
References pp_flush(), print_insn_with_notes(), and pretty_printer::set_output_stream().
Referenced by attempt_change(), check_and_process_move(), combine_instructions(), combine_reload_insn(), debug_insn_slim(), dump_inc_insn(), dump_mem_insn(), ext_dce_try_optimize_insn(), final_scan_insn_1(), inherit_reload_reg(), lra_constraints(), lra_process_new_insns(), merge_in_block(), print_rtl_with_bb(), process_invariant_for_inheritance(), record_reg_classes(), remove_inheritance_pseudos(), rtl_dump_bb(), scan_one_insn(), split_reg(), try_combine(), undo_optional_reloads(), update_ebb_live_info(), and vt_initialize().
void dump_rtl_slim | ( | FILE * | f, |
const rtx_insn * | first, | ||
const rtx_insn * | last, | ||
int | count, | ||
int | flags ) |
Same as above, but stop at LAST or when COUNT == 0. If COUNT < 0 it will stop only at LAST or NULL rtx.
References count, last, NEXT_INSN(), NULL, pp_flush(), print_insn_with_notes(), and pretty_printer::set_output_stream().
Referenced by debug_rtl_slim(), inherit_reload_reg(), lra_dump_insns(), lra_process_new_insns(), and split_reg().
void dump_value_slim | ( | FILE * | f, |
const_rtx | x, | ||
int | verbose ) |
Print X, an RTL value node, to file F in slim format. Include additional information if VERBOSE is nonzero. Value nodes are constants, registers, labels, symbols and memory.
References pp_flush(), print_value(), pretty_printer::set_output_stream(), and verbose.
Referenced by curr_insn_transform(), equiv_address_substitution(), get_reload_reg(), ira_update_equiv_info_by_shuffle_insn(), and process_addr_reg().
|
static |
The functions below try to print RTL in a form resembling assembler mnemonics. Because this form is more concise than the "traditional" form of RTL printing in Lisp-style, the form printed by this file is called "slim". RTL dumps in slim format can be obtained by appending the "-slim" option to -fdump-rtl-<pass>. Control flow graph output as a DOT file is always printed in slim form. The normal interface to the functionality provided in this pretty-printer is through the dump_*_slim functions to print to a stream, or via the print_*_slim functions to print into a user's pretty-printer. It is also possible to obtain a string for a single pattern as a string pointer, via str_pattern_slim, but this usage is discouraged.
This recognizes rtx'en classified as expressions. These are always represent some action on values or results of other expression, that may be stored in objects representing values.
References CONST_INT_P, GEN_INT, GET_CODE, GET_RTX_CLASS, GET_RTX_NAME, i, INTVAL, NULL_RTX, pp_comma, pp_decimal_int, pp_left_bracket, pp_left_paren, pp_right_paren, pp_string(), print_pattern(), print_value(), RTX_BIN_ARITH, RTX_COMM_ARITH, RTX_COMM_COMPARE, RTX_COMPARE, RTX_TERNARY, RTX_UNARY, TRAP_CONDITION, verbose, XEXP, XINT, XVECEXP, and XVECLEN.
Referenced by print_pattern(), and print_value().
void print_inline_rtx | ( | FILE * | outf, |
const_rtx | x, | ||
int | ind ) |
Print an rtx on the current line of FILE. Initially indent IND characters.
References NULL, and rtx_writer::print_rtx().
Referenced by canon_address(), check_mem_read_rtx(), cselib_lookup(), debug_reload_to_stream(), dump_cands(), dump_cselib_table(), dump_cselib_val(), expand_loc(), init_eliminable_invariants(), insert_insn_start_basic_block(), insert_store(), log_op_type(), main(), replace_store_insn(), try_fwprop_subst_note(), update_ld_motion_stores(), val_resolve(), and val_store().
void print_insn | ( | pretty_printer * | pp, |
const rtx_insn * | x, | ||
int | verbose ) |
This is the main function in slim rtl visualization mechanism. X is an insn, to be printed into PP. This function tries to print it properly in human-readable form, resembling assembler mnemonics (instead of the older Lisp-style form). If VERBOSE is TRUE, insns are printed with more complete (but longer) pattern names and with extra information, and prefixed with their INSN_UIDs.
References BLOCK_NUMBER, DEBUG_MARKER_INSN_P, DEBUG_TEMP_UID, DECL_NAME, DECL_P, DECL_UID, gcc_unreachable, GET_CODE, GET_NOTE_INSN_NAME, IDENTIFIER_POINTER, INSN_DEBUG_MARKER_KIND, INSN_UID(), INSN_VAR_LOCATION_DECL, INSN_VAR_LOCATION_LOC, NOTE_BASIC_BLOCK, NOTE_BLOCK, NOTE_DELETED_LABEL_NAME, NOTE_EH_HANDLER, NOTE_KIND, NOTE_VAR_LOCATION, NULL, PATTERN(), pp_left_brace, pp_printf(), pp_right_brace, pp_string(), print_pattern(), TREE_CODE, VAR_LOC_UNKNOWN_P, verbose, and XVECEXP.
Referenced by print_insn_with_notes().
void print_insn_with_notes | ( | pretty_printer * | pp, |
const rtx_insn * | x ) |
Pretty-print a slim dump of X (an insn) to PP, including any register note attached to the instruction.
References GET_CODE, GET_REG_NOTE_NAME, INSN_P, pp_newline(), pp_printf(), pp_string(), print_insn(), print_pattern(), print_rtx_head, REG_NOTE_KIND, REG_NOTES, XEXP, and XINT.
Referenced by dump_insn_slim(), dump_rtl_slim(), print_pattern(), and rtl_dump_bb_for_graph().
void print_mem_expr | ( | FILE * | outfile, |
const_tree | expr ) |
References CONST_CAST_TREE, dump_flags, fputc(), print_generic_expr(), and TDF_SLIM.
Referenced by dump_attrs_list(), output_asm_operand_names(), rtx_writer::print_rtx(), rtx_writer::print_rtx_operand(), and rtx_writer::print_rtx_operand_code_r().
void print_pattern | ( | pretty_printer * | pp, |
const_rtx | x, | ||
int | verbose ) |
The next step in insn detalization, its pattern recognition.
References as_a(), COND_EXEC_CODE, COND_EXEC_TEST, const0_rtx, rtx_sequence::element(), gcc_assert, GET_CODE, GET_RTX_NAME, i, rtx_sequence::insn(), INSN_P, rtx_sequence::len(), PAT_VAR_LOCATION_LOC, pp_equal, pp_exclamation, pp_left_brace, pp_left_paren, pp_newline(), pp_printf(), pp_right_brace, pp_semicolon, pp_string(), print_exp(), print_insn_with_notes(), print_pattern(), print_rtx_head, print_value(), SET, SET_DEST, SET_SRC, TRAP_CONDITION, verbose, XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by print_exp(), print_insn(), print_insn_with_notes(), print_pattern(), and str_pattern_slim().
|
static |
Print X to FILE.
References poly_int< N, C >::coeffs, HOST_WIDE_INT_PRINT_DEC, i, poly_int< N, C >::is_constant(), and NUM_POLY_INT_COEFFS.
Referenced by rtx_writer::print_rtx(), rtx_writer::print_rtx_operand(), and rtx_writer::print_rtx_operand_code_r().
void print_rtl | ( | FILE * | outf, |
const_rtx | rtx_first ) |
External entry point for printing a chain of insns starting with RTX_FIRST onto file OUTF. A blank line separates insns. If RTX_FIRST is not an insn, then it alone is printed, with no newline.
References NULL, and rtx_writer::print_rtl().
Referenced by analyze_insn_to_expand_var(), bypass_block(), cprop_insn(), cprop_jump(), df_print_note(), do_local_cprop(), dump_class(), dump_expr_hash_table_entry(), dump_hash_table(), dump_hash_table(), dump_iv_info(), eliminate_partially_redundant_load(), expansion_failed(), find_simple_exit(), iv_analyze_biv(), iv_analyze_def(), iv_analyze_op(), maybe_dump_rtl_for_gimple_stmt(), mem_loc_descriptor(), output_description(), print_ldst_list(), print_node(), print_store_motion_mems(), reorg_loops(), and update_ld_motion_stores().
void print_rtl_single | ( | FILE * | outf, |
const_rtx | x ) |
Like print_rtx, except specify a file.
References NULL, and rtx_writer::print_rtl_single_with_indent().
Referenced by add_removable_extension(), combine_reaching_defs(), combine_set_extension(), cselib_expand_value_rtx_1(), delete_redundant_insns_1(), discover_loops(), dump_attrs_list(), dump_expr_hash_table_entry(), dump_onepart_variable_differences(), dump_var(), eliminate_partially_redundant_load(), ext_dce_try_optimize_insn(), final_scan_insn_1(), find_and_remove_re(), iv_analyze_def(), iv_analyze_op(), new_cselib_val(), print_rtl_with_bb(), print_rtx_insn_vec(), recog_for_combine_1(), rest_of_clean_state(), rtl_dump_bb(), split_live_ranges_for_shrink_wrap(), transform_ifelse(), try_fwprop_subst_pattern(), try_shrink_wrapping(), and vt_initialize().
Print the elements of VEC to FILE.
References fputc(), i, and print_rtl_single().
Referenced by print_ldst_list(), and print_store_motion_mems().
void print_simple_rtl | ( | FILE * | outf, |
const_rtx | x ) |
Like print_rtl except without all the detail; for example, if RTX is a CONST_INT then print in decimal format.
References NULL, and rtx_writer::print_rtl().
Referenced by insert_part_to_rtx_on_edge(), insert_rtx_to_part_on_edge(), mark_reg_dependencies(), replace_read(), and store_modifies_mem_p().
void print_value | ( | pretty_printer * | pp, |
const_rtx | x, | ||
int | verbose ) |
Prints rtxes, I customarily classified as values. They're constants, registers, labels, symbols and memory accesses.
References CONST_DOUBLE_HIGH, CONST_DOUBLE_LOW, CONST_DOUBLE_REAL_VALUE, CONST_FIXED_VALUE, CONST_POLY_INT_COEFFS, CONST_WIDE_INT_ELT, CONST_WIDE_INT_NUNITS, DEBUG_EXPR_TREE_DECL, DEBUG_TEMP_UID, fixed_to_decimal(), FLOAT_MODE_P, GET_CODE, GET_MODE, GET_MODE_NAME, GET_RTX_NAME, HOST_WIDE_INT_PRINT_HEX, i, INSN_UID(), INTVAL, label_ref_label(), NUM_POLY_INT_COEFFS, pp_greater, pp_left_bracket, pp_modulo, pp_printf(), pp_right_bracket, pp_right_paren, pp_scalar, pp_string(), pp_wide_int(), pp_wide_integer(), pretty_print_string(), print_exp(), print_value(), real_to_decimal(), reg_names, REGNO, SIGNED, SUBREG_BYTE, SUBREG_REG, verbose, XEXP, and XSTR.
Referenced by dump_value_slim(), print_exp(), print_pattern(), and print_value().
void rtl_dump_bb_for_graph | ( | pretty_printer * | pp, |
basic_block | bb ) |
Dumps basic block BB to pretty-printer PP in slim form and without and no indentation, for use as a label of a DOT graph record-node.
References FOR_BB_INSNS, pp_bar, pp_write_text_as_dot_label_to_stream(), pp_write_text_to_stream(), and print_insn_with_notes().
const char * str_pattern_slim | ( | const_rtx | x | ) |
Pretty-print pattern X of some insn in non-verbose mode. Return a string pointer to the pretty-printer buffer. This function is only exported exists only to accommodate some older users of the slim RTL pretty printers. Please do not use it for new code.
References ggc_strdup, pp_formatted_text(), and print_pattern().
Determine if X is of a kind suitable for dumping via reuse_rtx.
References CASE_CONST_UNIQUE, GET_CODE, and NULL.
Referenced by rtx_reuse_manager::preprocess().
DEBUG_VARIABLE int debug_rtx_count = 0 |
Count of rtx's to print with debug_rtx_list. This global exists because gdb user defined commands have no arguments.
Referenced by debug_rtx_find().
const char* print_rtx_head = "" |
Print RTL for GCC. Copyright (C) 1987-2024 Free Software Foundation, Inc. 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 is compiled twice: once for the generator programs, once for the compiler.
These headers all define things which are not available in generator programs.
Disable warnings about quoting issues in the pp_xxx calls below that (intentionally) don't follow GCC diagnostic conventions.
String printed at beginning of each RTL when it is dumped. This string is set to ASM_COMMENT_START when the RTL is dumped in the assembly output file.
Referenced by final_scan_insn_1(), print_insn_with_notes(), print_pattern(), rtx_writer::print_rtl(), rtx_writer::print_rtl_single_with_indent(), print_rtl_with_bb(), rtx_writer::print_rtx(), rtx_writer::print_rtx_operand_code_0(), rtx_writer::print_rtx_operand_code_e(), and rtx_writer::print_rtx_operand_codes_E_and_V().