GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
#include "ssa.h"
#include "cgraph.h"
#include "fold-const.h"
#include "tree-eh.h"
#include "stor-layout.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "tree-cfg.h"
#include "tree-dfa.h"
#include "ipa-param-manipulation.h"
#include "print-tree.h"
#include "gimple-pretty-print.h"
#include "builtins.h"
#include "tree-ssa.h"
#include "tree-inline.h"
#include "alloc-pool.h"
#include "symbol-summary.h"
#include "symtab-clones.h"
#include "tree-phinodes.h"
#include "cfgexpand.h"
#include "attribs.h"
#include "sreal.h"
#include "ipa-cp.h"
#include "ipa-prop.h"
Data Structures | |
struct | pass_through_split_map |
class | ipa_edge_modification_info |
class | ipa_edge_modification_sum |
Macros | |
#define | INCLUDE_ALGORITHM |
Functions | |
DEBUG_FUNCTION void | ipa_verify_edge_has_no_modifications (cgraph_edge *cs) |
void | push_function_arg_decls (vec< tree > *args, tree fndecl) |
void | push_function_arg_types (vec< tree > *types, tree fntype) |
void | ipa_dump_adjusted_parameters (FILE *f, vec< ipa_adjusted_param, va_gc > *adj_params) |
static void | fill_vector_of_new_param_types (vec< tree > *new_types, vec< tree > *otypes, vec< ipa_adjusted_param, va_gc > *adj_params, bool use_prev_indices) |
static bool | drop_type_attribute_if_params_changed_p (tree name) |
static tree | build_adjusted_function_type (tree orig_type, vec< tree > *new_param_types, bool method2func, bool skip_return, bool args_modified) |
static bool | isra_get_ref_base_and_offset (tree expr, tree *base_p, unsigned *unit_offset_p) |
static void | purge_all_uses (tree name, hash_set< tree > *killed_ssas) |
static int | compare_param_body_replacement (const void *va, const void *vb) |
static tree | replace_with_mapped_expr (tree *remap, int *walk_subtrees, void *data) |
static tree | get_ssa_base_param (tree t, bool ignore_default_def) |
static ipa_edge_modification_info * | record_argument_state_1 (cgraph_edge *cs, const vec< int > &new_index_map, const vec< pass_through_split_map > &new_pt_map, int new_always_copy_delta) |
static void | record_argument_state (copy_body_data *id, gimple *orig_stmt, const vec< int > &new_index_map, const vec< pass_through_split_map > &new_pt_map, int new_always_copy_delta) |
void | ipa_edge_modifications_finalize () |
static int | compare_ssa_versions (const void *va, const void *vb) |
void | ipa_release_ssas_in_hash (hash_set< tree > *killed_ssas) |
Variables | |
static const char * | ipa_param_prefixes [IPA_PARAM_PREFIX_COUNT] |
static const char * | ipa_param_op_names [IPA_PARAM_PREFIX_COUNT] |
static ipa_edge_modification_sum * | ipa_edge_modifications |
#define INCLUDE_ALGORITHM |
Manipulation of formal and actual parameters of functions and function calls. Copyright (C) 2017-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/>.
|
static |
Build and return a function type just like ORIG_TYPE but with parameter types given in NEW_PARAM_TYPES - which can be NULL if, but only if, ORIG_TYPE itself has NULL TREE_ARG_TYPEs. If METHOD2FUNC is true, also make it a FUNCTION_TYPE instead of FUNCTION_TYPE. If ARG_MODIFIED is true drop attributes that are no longer up to date.
References build_distinct_type_copy(), build_function_type(), copy_node(), drop_type_attribute_if_params_changed_p(), gcc_checking_assert, get_attribute_name(), i, last, nreverse(), NULL, NULL_TREE, TREE_CHAIN, tree_cons(), tree_last(), TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, TYPE_ATTRIBUTES, TYPE_CONTEXT, void_list_node, and void_type_node.
Referenced by ipa_param_adjustments::build_new_function_type(), and ipa_param_body_adjustments::modify_formal_parameters().
|
static |
Comparator for sorting and searching ipa_param_body_adjustments::m_replacements.
References a, b, and DECL_UID.
Referenced by ipa_param_body_adjustments::sort_replacements().
|
static |
Helper used to sort a vector of SSA_NAMES.
References a, b, and SSA_NAME_VERSION.
Referenced by ipa_release_ssas_in_hash().
Return true if attribute should be dropped if parameter changed.
References is_attribute_p().
Referenced by build_adjusted_function_type().
|
static |
Fill NEW_TYPES with types of a function after its current OTYPES have been modified as described in ADJ_PARAMS. When USE_PREV_INDICES is true, use prev_clone_index from ADJ_PARAMS as opposed to base_index when the parameter is false.
References ipa_adjusted_param::base_index, build_aligned_type(), gcc_unreachable, GET_MODE_ALIGNMENT, i, IPA_PARAM_OP_COPY, IPA_PARAM_OP_NEW, IPA_PARAM_OP_SPLIT, is_gimple_reg_type(), ipa_adjusted_param::op, ipa_adjusted_param::prev_clone_index, ipa_adjusted_param::type, TYPE_ALIGN, TYPE_MODE, and vec_safe_length().
Referenced by ipa_param_adjustments::build_new_function_type(), and ipa_param_body_adjustments::common_initialization().
If T is an SSA_NAME, return NULL if it is not a default def or return its base variable if it is. If IGNORE_DEFAULT_DEF is true, the base variable is always returned, regardless if it is a default def. Return T if it is not an SSA_NAME.
References NULL_TREE, SSA_NAME_IS_DEFAULT_DEF, SSA_NAME_VAR, and TREE_CODE.
Referenced by ipa_param_body_adjustments::get_expr_replacement().
void ipa_dump_adjusted_parameters | ( | FILE * | f, |
vec< ipa_adjusted_param, va_gc > * | adj_params ) |
Dump the adjustments in the vector ADJUSTMENTS to dump_file in a human friendly way, assuming they are meant to be applied to FNDECL.
References ipa_adjusted_param::alias_ptr_type, ipa_adjusted_param::base_index, i, IPA_PARAM_OP_COPY, ipa_param_op_names, IPA_PARAM_OP_NEW, IPA_PARAM_OP_SPLIT, IPA_PARAM_OP_UNDEFINED, ipa_param_prefixes, ipa_adjusted_param::op, ipa_adjusted_param::param_prefix_index, ipa_adjusted_param::prev_clone_adjustment, ipa_adjusted_param::prev_clone_index, print_node_brief(), ipa_adjusted_param::reverse, ipa_adjusted_param::type, ipa_adjusted_param::unit_offset, and vec_safe_length().
Referenced by ipa_param_adjustments::dump().
void ipa_edge_modifications_finalize | ( | ) |
Deallocate summaries which otherwise stay alive until the end of compilation.
References ipa_edge_modifications, and NULL.
Referenced by toplev::finalize().
Call release_ssa_name on all elements in KILLED_SSAS in a defined order.
References compare_ssa_versions(), and release_ssa_name().
Referenced by copy_body(), and ipa_param_adjustments::modify_call().
DEBUG_FUNCTION void ipa_verify_edge_has_no_modifications | ( | cgraph_edge * | cs | ) |
Fail compilation if CS has any summary associated with it in ipa_edge_modifications.
References gcc_assert, and ipa_edge_modifications.
Referenced by cgraph_edge::redirect_call_stmt_to_callee().
|
static |
Wrapper around get_base_ref_and_offset for cases interesting for IPA-SRA transformations. Return true if EXPR has an interesting form and fill in *BASE_P and *UNIT_OFFSET_P with the appropriate info.
References poly_int< N, C >::force_shwi(), get_ref_base_and_extent_hwi(), poly_int< N, C >::is_constant(), mem_ref_offset(), offset, ipa_adjusted_param::reverse, TREE_CODE, TREE_OPERAND, and UINT_MAX.
Referenced by ipa_param_body_adjustments::get_expr_replacement(), and ipa_param_body_adjustments::modify_call_stmt().
Remove all statements that use NAME directly or indirectly. KILLED_SSAS contains the SSA_NAMEs that are already being or have been processed and new ones need to be added to it. The function only has to process situations handled by ssa_name_only_returned_p in ipa-sra.cc with the exception that it can assume it must never reach a use in a return statement.
References hash_set< KeyId, Lazy, Traits >::add(), FOR_EACH_IMM_USE_STMT, gcc_assert, gimple_assign_lhs(), gimple_debug_bind_p(), gimple_debug_bind_reset_value(), gimple_phi_result(), gimple_vdef(), gsi_for_stmt(), gsi_remove(), is_gimple_assign(), NULL_TREE, TREE_CODE, update_stmt(), and worklist.
Referenced by ipa_param_adjustments::modify_call().
Fill an empty vector ARGS with PARM_DECLs representing formal parameters of FNDECL. The function should not be called during LTO WPA phase except for thunks (or functions with bodies streamed in).
References count, DECL_ARGUMENTS, DECL_CHAIN, gcc_assert, and gimple_has_body_p().
Referenced by ipa_param_body_adjustments::common_initialization(), ipcp_update_vr(), simd_clone_adjust_argument_types(), and simd_clone_vector_of_formal_parm_types().
Fill an empty vector TYPES with trees representing formal parameters of function type FNTYPE.
References count, TREE_CHAIN, TREE_VALUE, and TYPE_ARG_TYPES.
Referenced by ipa_param_adjustments::build_new_function_type(), ipa_param_body_adjustments::common_initialization(), and simd_clone_vector_of_formal_parm_types().
|
static |
Record information about what modifications to call arguments have already been done by clone materialization into a summary of an edge describing the call in this clone and all its clones. NEW_INDEX_MAP, NEW_PT_MAP and NEW_ALWAYS_COPY_DELTA have the same meaning as record_argument_state_1. In order to associate the info with the right edge summaries, we need address of the ORIG_STMT in the function from which we are cloning (because the edges have not yet been re-assigned to the new statement that has just been created) and ID, the structure governing function body copying.
References ipa_edge_modification_info::always_copy_delta, cgraph_node::clones, gcc_assert, cgraph_node::get_edge(), ipa_edge_modification_info::index_map, ipa_edge_modifications, cgraph_node::next_sibling_clone, NULL, ipa_edge_modification_info::pass_through_map, record_argument_state_1(), and symtab.
Referenced by ipa_param_body_adjustments::modify_call_stmt().
|
static |
Record information about what modifications to call arguments have already been done by clone materialization into a summary describing CS. The information is stored in NEW_INDEX_MAP, NEW_PT_MAP and NEW_ALWAYS_COPY_DELTA and correspond to equivalent fields in ipa_edge_modification_info. Return the edge summary.
References ipa_edge_modification_info::always_copy_delta, pass_through_split_map::base_index, gcc_assert, i, ipa_edge_modification_info::index_map, inverse(), ipa_edge_modifications, pass_through_split_map::new_index, ipa_edge_modification_info::pass_through_map, and pass_through_split_map::unit_offset.
Referenced by record_argument_state().
Callback to walk_tree. If REMAP is an SSA_NAME that is present in hash_map passed in DATA, replace it with unshared version of what it was mapped to. If an SSA argument would be remapped to NULL, the whole operation needs to abort which is signaled by returning error_mark_node.
References error_mark_node, hash_map< KeyId, Value, Traits >::get(), TREE_CODE, TYPE_P, and unshare_expr().
Referenced by ipa_param_body_adjustments::remap_with_debug_expressions().
|
static |
Call summary to store information about edges which have had their arguments partially modified already.
Referenced by ipa_edge_modifications_finalize(), ipa_verify_edge_has_no_modifications(), ipa_param_adjustments::modify_call(), record_argument_state(), and record_argument_state_1().
|
static |
Names of parameters for dumping. Keep in sync with enum ipa_parm_op.
Referenced by ipa_dump_adjusted_parameters().
|
static |
Actual prefixes of different newly synthetized parameters. Keep in sync with IPA_PARAM_PREFIX_* defines.
Referenced by ipa_param_body_adjustments::common_initialization(), and ipa_dump_adjusted_parameters().