GCC Middle and Back End API Reference
gimple-fold.h File Reference

Go to the source code of this file.

Functions

tree create_tmp_reg_or_ssa_name (tree, gimple *stmt=NULL)
 
tree canonicalize_constructor_val (tree, tree)
 
tree get_symbol_constant_value (tree)
 
bool get_range_strlen (tree, c_strlen_data *, unsigned eltsize)
 
void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree)
 
bool update_gimple_call (gimple_stmt_iterator *, tree, int,...)
 
bool fold_stmt (gimple_stmt_iterator *)
 
bool fold_stmt (gimple_stmt_iterator *, tree(*)(tree))
 
bool fold_stmt_inplace (gimple_stmt_iterator *)
 
tree maybe_fold_and_comparisons (tree, enum tree_code, tree, tree, enum tree_code, tree, tree, basic_block=nullptr)
 
tree maybe_fold_or_comparisons (tree, enum tree_code, tree, tree, enum tree_code, tree, tree, basic_block=nullptr)
 
bool optimize_atomic_compare_exchange_p (gimple *)
 
void fold_builtin_atomic_compare_exchange (gimple_stmt_iterator *)
 
tree no_follow_ssa_edges (tree)
 
tree follow_single_use_edges (tree)
 
tree follow_all_ssa_edges (tree)
 
tree gimple_fold_stmt_to_constant_1 (gimple *, tree(*)(tree), tree(*)(tree)=no_follow_ssa_edges)
 
tree gimple_fold_stmt_to_constant (gimple *, tree(*)(tree))
 
tree fold_ctor_reference (tree, tree, const poly_uint64 &, const poly_uint64 &, tree, unsigned HOST_WIDE_INT *=NULL)
 
tree fold_const_aggregate_ref_1 (tree, tree(*)(tree))
 
tree fold_const_aggregate_ref (tree)
 
tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree, bool *can_refer=NULL)
 
tree gimple_get_virt_method_for_vtable (HOST_WIDE_INT, tree, unsigned HOST_WIDE_INT, bool *can_refer=NULL)
 
tree gimple_fold_indirect_ref (tree)
 
bool gimple_fold_builtin_sprintf (gimple_stmt_iterator *)
 
bool gimple_fold_builtin_snprintf (gimple_stmt_iterator *)
 
bool arith_code_with_undefined_signed_overflow (tree_code)
 
void rewrite_to_defined_overflow (gimple_stmt_iterator *)
 
gimple_seq rewrite_to_defined_overflow (gimple *)
 
void replace_call_with_value (gimple_stmt_iterator *, tree)
 
tree tree_vec_extract (gimple_stmt_iterator *, tree, tree, tree, tree)
 
void gsi_replace_with_seq_vops (gimple_stmt_iterator *, gimple_seq)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, enum tree_code, tree, tree)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, enum tree_code, tree, tree, tree)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, enum tree_code, tree, tree, tree, tree)
 
template<class ... Args>
tree gimple_build (gimple_seq *seq, location_t loc, enum tree_code code, tree type, Args ...ops)
 
template<class ... Args>
tree gimple_build (gimple_seq *seq, enum tree_code code, tree type, Args ...ops)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, combined_fn, tree)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, combined_fn, tree, tree)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, combined_fn, tree, tree, tree)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, combined_fn, tree, tree, tree, tree)
 
template<class ... Args>
tree gimple_build (gimple_seq *seq, location_t loc, combined_fn fn, tree type, Args ...args)
 
template<class ... Args>
tree gimple_build (gimple_seq *seq, combined_fn fn, tree type, Args ...args)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, code_helper, tree, tree)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, code_helper, tree, tree, tree)
 
tree gimple_build (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, code_helper, tree, tree, tree, tree)
 
template<class ... Args>
tree gimple_build (gimple_seq *seq, location_t loc, code_helper code, tree type, Args ...ops)
 
template<class ... Args>
tree gimple_build (gimple_seq *seq, code_helper code, tree type, Args ...ops)
 
tree gimple_convert (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, tree, tree)
 
tree gimple_convert (gimple_seq *seq, location_t loc, tree type, tree op)
 
tree gimple_convert (gimple_seq *seq, tree type, tree op)
 
tree gimple_convert_to_ptrofftype (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, tree)
 
tree gimple_convert_to_ptrofftype (gimple_seq *seq, location_t loc, tree op)
 
tree gimple_convert_to_ptrofftype (gimple_seq *seq, tree op)
 
tree gimple_build_vector_from_val (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, tree, tree)
 
tree gimple_build_vector_from_val (gimple_seq *seq, location_t loc, tree type, tree op)
 
tree gimple_build_vector_from_val (gimple_seq *seq, tree type, tree op)
 
tree gimple_build_vector (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, tree_vector_builder *)
 
tree gimple_build_vector (gimple_seq *seq, location_t loc, tree_vector_builder *builder)
 
tree gimple_build_vector (gimple_seq *seq, tree_vector_builder *builder)
 
tree gimple_build_round_up (gimple_stmt_iterator *, bool, enum gsi_iterator_update, location_t, tree, tree, unsigned HOST_WIDE_INT)
 
tree gimple_build_round_up (gimple_seq *seq, location_t loc, tree type, tree old_size, unsigned HOST_WIDE_INT align)
 
tree gimple_build_round_up (gimple_seq *seq, tree type, tree old_size, unsigned HOST_WIDE_INT align)
 
bool gimple_stmt_nonnegative_warnv_p (gimple *, bool *, int=0)
 
bool gimple_stmt_integer_valued_real_p (gimple *, int=0)
 
tree gimple_simplify (enum tree_code, tree, tree, gimple_seq *, tree(*)(tree))
 
tree gimple_simplify (enum tree_code, tree, tree, tree, gimple_seq *, tree(*)(tree))
 
tree gimple_simplify (enum tree_code, tree, tree, tree, tree, gimple_seq *, tree(*)(tree))
 
tree gimple_simplify (combined_fn, tree, tree, gimple_seq *, tree(*)(tree))
 
tree gimple_simplify (combined_fn, tree, tree, tree, gimple_seq *, tree(*)(tree))
 
tree gimple_simplify (combined_fn, tree, tree, tree, tree, gimple_seq *, tree(*)(tree))
 

Function Documentation

◆ arith_code_with_undefined_signed_overflow()

bool arith_code_with_undefined_signed_overflow ( tree_code code)
extern
Return true if CODE is an operation that when operating on signed
integer types involves undefined behavior on overflow and the
operation can be expressed with unsigned arithmetic.   

Referenced by final_value_replacement_loop(), if_convertible_gimple_assign_stmt_p(), move_computations_worker(), predicate_statements(), split_loop(), and update_range_test().

◆ canonicalize_constructor_val()

tree canonicalize_constructor_val ( tree cval,
tree from_decl )
extern

◆ create_tmp_reg_or_ssa_name()

tree create_tmp_reg_or_ssa_name ( tree type,
gimple * stmt )
extern
Gimple folding definitions.

   Copyright (C) 2011-2024 Free Software Foundation, Inc.
   Contributed by Richard Guenther <rguenther@suse.de>

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/>.   
Create a temporary for TYPE for a statement STMT.  If the current function
is in SSA form, a SSA name is created.  Otherwise a temporary register
is made.   

References cfun, create_tmp_reg(), gimple_in_ssa_p(), and make_ssa_name().

Referenced by copy_bb(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_strcat(), gimple_fold_builtin_strchr(), gimple_fold_builtin_string_compare(), and gimple_load_first_char().

◆ fold_builtin_atomic_compare_exchange()

◆ fold_const_aggregate_ref()

◆ fold_const_aggregate_ref_1()

◆ fold_ctor_reference()

tree fold_ctor_reference ( tree type,
tree ctor,
const poly_uint64 & poly_offset,
const poly_uint64 & poly_size,
tree from_decl,
unsigned HOST_WIDE_INT * suboff )
extern
CTOR is a value initializing memory.  Fold a reference of TYPE and
bit size POLY_SIZE to the memory at bit POLY_OFFSET.  When POLY_SIZE
is zero, attempt to fold a reference to the entire subobject
which OFFSET refers to.  This is used when folding accesses to
string members of aggregates.  When non-null, set *SUBOFF to
the bit offset of the accessed subobject.   

References AGGREGATE_TYPE_P, can_native_interpret_type_p(), canonicalize_constructor_val(), CONSTANT_CLASS_P, fold_array_ctor_reference(), fold_nonarray_ctor_reference(), fold_unary, INT_MAX, poly_int< N, C >::is_constant(), known_eq, native_encode_expr(), native_encode_initializer(), native_interpret_expr(), NULL_TREE, offset, STRIP_USELESS_TYPE_CONVERSION, wi::to_poly_widest(), TREE_CODE, TREE_TYPE, TYPE_REVERSE_STORAGE_ORDER, TYPE_SIZE, unshare_expr(), and useless_type_conversion_p().

Referenced by constant_byte_string(), fold_array_ctor_reference(), fold_const_aggregate_ref_1(), fold_nonarray_ctor_reference(), and fully_constant_vn_reference_p().

◆ fold_stmt() [1/2]

bool fold_stmt ( gimple_stmt_iterator * gsi)
extern

◆ fold_stmt() [2/2]

bool fold_stmt ( gimple_stmt_iterator * gsi,
tree(* valueize )(tree) )
extern

References fold_stmt_1().

◆ fold_stmt_inplace()

bool fold_stmt_inplace ( gimple_stmt_iterator * gsi)
extern
Perform the minimal folding on statement *GSI.  Only operations like
*&x created by constant propagation are handled.  The statement cannot
be replaced with a new one.  Return true if the statement was
changed, false otherwise.
The statement *GSI should be in valid gimple form but may
be in unfolded state as resulting from for example constant propagation
which can produce *&x = 0.   

References changed, fold_stmt_1(), gcc_assert, gsi_stmt(), and no_follow_ssa_edges().

Referenced by create_expression_by_pieces(), forward_propagate_addr_expr_1(), insert_debug_temp_for_var_def(), optimize_recip_sqrt(), replace_reciprocal(), replace_reciprocal_squares(), and update_ops().

◆ follow_all_ssa_edges()

◆ follow_single_use_edges()

◆ get_range_strlen()

bool get_range_strlen ( tree arg,
c_strlen_data * pdata,
unsigned eltsize )
extern
Try to obtain the range of the lengths of the string(s) referenced
by ARG, or the size of the largest array ARG refers to if the range
of lengths cannot be determined, and store all in *PDATA which must
be zero-initialized on input except PDATA->MAXBOUND may be set to
a non-null tree node other than INTEGER_CST to request to have it
set to the length of the longest string in a PHI.  ELTSIZE is
the expected size of the string element in bytes: 1 for char and
some power of 2 for wide characters.
Return true if the range [PDATA->MINLEN, PDATA->MAXLEN] is suitable
for optimization.  Returning false means that a nonzero PDATA->MINLEN
doesn't reflect the true lower bound of the range when PDATA->MAXLEN
is -1 (in that case, the actual range is indeterminate, i.e.,
[0, PTRDIFF_MAX - 2].   

References build_all_ones_cst(), get_range_strlen(), integer_all_onesp(), c_strlen_data::maxbound, c_strlen_data::maxlen, c_strlen_data::minlen, size_type_node, SRK_LENRANGE, ssize_int, and visited.

◆ get_symbol_constant_value()

tree get_symbol_constant_value ( tree sym)
extern

◆ gimple_build() [1/16]

template<class ... Args>
tree gimple_build ( gimple_seq * seq,
code_helper code,
tree type,
Args ... ops )
inline

◆ gimple_build() [2/16]

template<class ... Args>
tree gimple_build ( gimple_seq * seq,
combined_fn fn,
tree type,
Args ... args )
inline

◆ gimple_build() [3/16]

template<class ... Args>
tree gimple_build ( gimple_seq * seq,
enum tree_code code,
tree type,
Args ... ops )
inline

◆ gimple_build() [4/16]

template<class ... Args>
tree gimple_build ( gimple_seq * seq,
location_t loc,
code_helper code,
tree type,
Args ... ops )
inline

◆ gimple_build() [5/16]

template<class ... Args>
tree gimple_build ( gimple_seq * seq,
location_t loc,
combined_fn fn,
tree type,
Args ... args )
inline

◆ gimple_build() [6/16]

template<class ... Args>
tree gimple_build ( gimple_seq * seq,
location_t loc,
enum tree_code code,
tree type,
Args ... ops )
inline

◆ gimple_build() [7/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
code_helper ,
tree ,
tree  )
extern

◆ gimple_build() [8/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
code_helper ,
tree ,
tree ,
tree  )
extern

◆ gimple_build() [9/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
code_helper ,
tree ,
tree ,
tree ,
tree  )
extern

◆ gimple_build() [10/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
combined_fn ,
tree  )
extern

◆ gimple_build() [11/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
combined_fn ,
tree ,
tree  )
extern

◆ gimple_build() [12/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
combined_fn ,
tree ,
tree ,
tree  )
extern

◆ gimple_build() [13/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
combined_fn ,
tree ,
tree ,
tree ,
tree  )
extern

◆ gimple_build() [14/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
enum tree_code,
tree ,
tree  )
extern
gimple_build, functionally matching fold_buildN, outputs stmts
int the provided sequence, matching and simplifying them on-the-fly.
Supposed to replace force_gimple_operand (fold_buildN (...), ...).   

Referenced by gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), and gimple_build().

◆ gimple_build() [15/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
enum tree_code,
tree ,
tree ,
tree  )
extern

◆ gimple_build() [16/16]

tree gimple_build ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
enum tree_code,
tree ,
tree ,
tree ,
tree  )
extern

◆ gimple_build_round_up() [1/3]

tree gimple_build_round_up ( gimple_seq * seq,
location_t loc,
tree type,
tree old_size,
unsigned HOST_WIDE_INT align )
inline

◆ gimple_build_round_up() [2/3]

tree gimple_build_round_up ( gimple_seq * seq,
tree type,
tree old_size,
unsigned HOST_WIDE_INT align )
inline

◆ gimple_build_round_up() [3/3]

tree gimple_build_round_up ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
tree ,
tree ,
unsigned HOST_WIDE_INT )
extern

◆ gimple_build_vector() [1/3]

tree gimple_build_vector ( gimple_seq * seq,
location_t loc,
tree_vector_builder * builder )
inline

◆ gimple_build_vector() [2/3]

tree gimple_build_vector ( gimple_seq * seq,
tree_vector_builder * builder )
inline

◆ gimple_build_vector() [3/3]

tree gimple_build_vector ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
tree_vector_builder *  )
extern

◆ gimple_build_vector_from_val() [1/3]

tree gimple_build_vector_from_val ( gimple_seq * seq,
location_t loc,
tree type,
tree op )
inline

◆ gimple_build_vector_from_val() [2/3]

tree gimple_build_vector_from_val ( gimple_seq * seq,
tree type,
tree op )
inline

◆ gimple_build_vector_from_val() [3/3]

tree gimple_build_vector_from_val ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
tree ,
tree  )
extern

◆ gimple_convert() [1/3]

tree gimple_convert ( gimple_seq * seq,
location_t loc,
tree type,
tree op )
inline

◆ gimple_convert() [2/3]

tree gimple_convert ( gimple_seq * seq,
tree type,
tree op )
inline

◆ gimple_convert() [3/3]

tree gimple_convert ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
tree ,
tree  )
extern

Referenced by gimple_convert(), and gimple_convert().

◆ gimple_convert_to_ptrofftype() [1/3]

tree gimple_convert_to_ptrofftype ( gimple_seq * seq,
location_t loc,
tree op )
inline

◆ gimple_convert_to_ptrofftype() [2/3]

tree gimple_convert_to_ptrofftype ( gimple_seq * seq,
tree op )
inline

◆ gimple_convert_to_ptrofftype() [3/3]

tree gimple_convert_to_ptrofftype ( gimple_stmt_iterator * ,
bool ,
enum gsi_iterator_update,
location_t ,
tree  )
extern

◆ gimple_fold_builtin_snprintf()

bool gimple_fold_builtin_snprintf ( gimple_stmt_iterator * gsi)
extern
Simplify a call to the snprintf builtin with arguments DEST, DESTSIZE,
FMT, and ORIG.  ORIG may be null if this is a 3-argument call.  We don't
attempt to simplify calls with more than 4 arguments.

Return true if simplification was possible, otherwise false.   

References as_a(), build_int_cstu(), builtin_decl_implicit(), c_getstr(), fold_convert, fold_stmt(), get_maxval_strlen(), gimple_build_assign(), gimple_build_call(), gimple_call_arg(), gimple_call_lhs(), gimple_call_num_args(), gimple_seq_add_stmt_without_update(), gsi_prev(), gsi_replace_with_seq_vops(), gsi_stmt(), init_target_chars(), known_lower(), NULL, NULL_TREE, SRK_STRLEN, target_percent, target_percent_s, TREE_TYPE, and useless_type_conversion_p().

◆ gimple_fold_builtin_sprintf()

bool gimple_fold_builtin_sprintf ( gimple_stmt_iterator * gsi)
extern
Simplify a call to the sprintf builtin with arguments DEST, FMT, and ORIG.
ORIG may be null if this is a 2-argument call.  We don't attempt to
simplify calls with more than 3 arguments.

Return true if simplification was possible, otherwise false.   

References build_int_cst(), builtin_decl_implicit(), c_getstr(), copy_warning(), fold_convert, fold_stmt(), get_maxval_strlen(), gimple_build_assign(), gimple_build_call(), gimple_call_arg(), gimple_call_lhs(), gimple_call_num_args(), gimple_seq_add_stmt_without_update(), gsi_prev(), gsi_replace_with_seq_vops(), gsi_stmt(), init_target_chars(), NULL, NULL_TREE, POINTER_TYPE_P, SRK_STRLEN, target_percent, target_percent_s, TREE_TYPE, and useless_type_conversion_p().

◆ gimple_fold_indirect_ref()

tree gimple_fold_indirect_ref ( tree t)
extern
Given a pointer value T, return a simplified version of an
indirection through T, or NULL_TREE if no simplification is
possible.  Note that the resulting type may be different from
the type pointed to in the sense that it is still compatible
from the langhooks point of view.  

References bitsize_int, build1(), build4(), DECL_P, fold_build1, fold_build2, fold_build3, gimple_fold_indirect_ref(), known_lt, NULL_TREE, offset, POINTER_TYPE_P, size_zero_node, STRIP_NOPS, wi::to_wide(), TREE_CODE, tree_fits_uhwi_p(), tree_int_cst_equal(), TREE_OPERAND, tree_to_shwi(), tree_to_uhwi(), TREE_TYPE, TYPE_DOMAIN, TYPE_MIN_VALUE, TYPE_REF_CAN_ALIAS_ALL, TYPE_SIZE, TYPE_SIZE_UNIT, TYPE_VECTOR_SUBPARTS(), useless_type_conversion_p(), and wide_int_to_tree().

Referenced by copy_tree_body_r(), expand_thunk(), gimple_fold_indirect_ref(), gimple_fold_indirect_ref_rhs(), and maybe_make_indirect().

◆ gimple_fold_stmt_to_constant()

tree gimple_fold_stmt_to_constant ( gimple * stmt,
tree(* valueize )(tree) )
extern
Fold STMT to a constant using VALUEIZE to valueize SSA names.
Returns NULL_TREE if folding to a constant is not possible, otherwise
returns a constant according to is_gimple_min_invariant.   

References gimple_fold_stmt_to_constant_1(), is_gimple_min_invariant(), and NULL_TREE.

Referenced by object_sizes_execute().

◆ gimple_fold_stmt_to_constant_1()

tree gimple_fold_stmt_to_constant_1 ( gimple * stmt,
tree(* valueize )(tree),
tree(* gvalueize )(tree) )
extern
Fold STMT to a constant using VALUEIZE to valueize SSA names.

Either NULL_TREE, a simplified but non-constant or a constant
is returned.

???  This should go into a gimple-fold-inline.h file to be eventually
privatized with the single valueize function used in the various TUs
to avoid the indirect function call overhead.   

References as_a(), build1_loc(), build_invariant_address(), build_zero_cst(), CONSTANT_CLASS_P, CONSTRUCTOR_ELTS, CONSTRUCTOR_NELTS, decl_address_invariant_p(), dump_file, dump_flags, EXPR_LOCATION, fndecl_built_in_p(), fold_binary_loc(), fold_build2, fold_builtin_call_array(), fold_const_aggregate_ref_1(), fold_convert, fold_ternary_loc(), fold_unary_loc(), FOR_EACH_CONSTRUCTOR_VALUE, gcc_unreachable, get_addr_base_and_unit_offset_1(), get_gimple_rhs_class(), get_symbol_constant_value(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs3(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, gimple_builtin_call_types_compatible_p(), gimple_call_arg(), gimple_call_fn(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_num_args(), gimple_call_return_type(), gimple_location(), gimple_simplified_result_is_gimple_val(), gimple_simplify(), GIMPLE_SINGLE_RHS, GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, i, integer_onep(), integer_zerop(), is_gimple_min_invariant(), known_eq, mprts_hook, NULL, NULL_TREE, OBJ_TYPE_REF_EXPR, offset, operand_equal_p(), gimple_match_op::ops, print_generic_expr(), print_gimple_expr(), ptr_type_node, STRIP_NOPS, tcc_declaration, tcc_reference, TDF_DETAILS, TDF_SLIM, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_OVERFLOW, TREE_TYPE, TYPE_VECTOR_SUBPARTS(), unshare_expr(), and useless_type_conversion_p().

Referenced by back_propagate_equivalences(), ccp_fold(), copy_prop_visit_assignment(), gimple_fold_stmt_to_constant(), jt_state::register_equivs_stmt(), try_to_simplify(), pointer_equiv_analyzer::visit_stmt(), and visit_stmt().

◆ gimple_get_virt_method_for_binfo()

tree gimple_get_virt_method_for_binfo ( HOST_WIDE_INT token,
tree known_binfo,
bool * can_refer )
extern
Return a declaration of a function which an OBJ_TYPE_REF references. TOKEN
is integer form of OBJ_TYPE_REF_TOKEN of the reference expression.
KNOWN_BINFO carries the binfo describing the true type of
OBJ_TYPE_REF_OBJECT(REF).
Set CAN_REFER if non-NULL to false if method
is not referable or if the virtual table is ill-formed (such as rewriten
by non-C++ produced symbol). Otherwise just return NULL in that calse.   

References BINFO_VTABLE, gimple_get_virt_method_for_vtable(), NULL_TREE, offset, and vtable_pointer_value_to_vtable().

Referenced by possible_polymorphic_call_targets(), record_target_from_binfo(), and record_targets_from_bases().

◆ gimple_get_virt_method_for_vtable()

tree gimple_get_virt_method_for_vtable ( HOST_WIDE_INT token,
tree v,
unsigned HOST_WIDE_INT offset,
bool * can_refer )
extern
Lookup virtual method with index TOKEN in a virtual table V
at OFFSET.  
Set CAN_REFER if non-NULL to false if method
is not referable or if the virtual table is ill-formed (such as rewriten
by non-C++ produced symbol). Otherwise just return NULL in that calse.   

References builtin_decl_unreachable(), can_refer_decl_in_current_unit_p(), CONSTRUCTOR_ELT, CONSTRUCTOR_NELTS, ctor_for_folding(), DECL_VIRTUAL_P, error_mark_node, gcc_assert, gcc_checking_assert, cgraph_node::get_create(), integer_zerop(), NULL, NULL_TREE, offset, STRIP_NOPS, TREE_CODE, TREE_OPERAND, tree_to_uhwi(), TREE_TYPE, TYPE_DOMAIN, TYPE_MIN_VALUE, TYPE_SIZE, TYPE_SIZE_UNIT, and VAR_P.

Referenced by gimple_get_virt_method_for_binfo(), ipa_get_indirect_edge_target_1(), and try_make_edge_direct_virtual_call().

◆ gimple_simplify() [1/6]

tree gimple_simplify ( combined_fn fn,
tree type,
tree arg0,
gimple_seq * seq,
tree(* valueize )(tree) )
extern
Builtin or internal function with one argument.   

References CONSTANT_CLASS_P, constant_for_folding(), fold_const_call(), gimple_simplify(), maybe_push_res_to_seq(), and NULL_TREE.

◆ gimple_simplify() [2/6]

tree gimple_simplify ( combined_fn fn,
tree type,
tree arg0,
tree arg1,
gimple_seq * seq,
tree(* valueize )(tree) )
extern
Builtin or internal function with two arguments.   

References CONSTANT_CLASS_P, constant_for_folding(), fold_const_call(), gimple_simplify(), maybe_push_res_to_seq(), and NULL_TREE.

◆ gimple_simplify() [3/6]

tree gimple_simplify ( combined_fn fn,
tree type,
tree arg0,
tree arg1,
tree arg2,
gimple_seq * seq,
tree(* valueize )(tree) )
extern
Builtin or internal function with three arguments.   

References CONSTANT_CLASS_P, constant_for_folding(), fold_const_call(), gimple_simplify(), maybe_push_res_to_seq(), and NULL_TREE.

◆ gimple_simplify() [4/6]

tree gimple_simplify ( enum tree_code,
tree type,
tree op0,
gimple_seq * seq,
tree(* valueize )(tree) )
extern
In gimple-match.cc.   
Public API overloads follow for operation being tree_code or
built_in_function and for one to three operands or arguments.
They return NULL_TREE if nothing could be simplified or
the resulting simplified value with parts pushed to SEQ.
If SEQ is NULL then if the simplification needs to create
new stmts it will fail.  If VALUEIZE is non-NULL then all
SSA names will be valueized using that hook prior to
applying simplifications.   
Unary ops.   
Functions that are needed by gimple-match but that are exported and used in
other places in the compiler.   
Public API overloads follow for operation being tree_code or
built_in_function and for one to three operands or arguments.
They return NULL_TREE if nothing could be simplified or
the resulting simplified value with parts pushed to SEQ.
If SEQ is NULL then if the simplification needs to create
new stmts it will fail.  If VALUEIZE is non-NULL then all
SSA names will be valueized using that hook prior to
applying simplifications.   
Unary ops.   

References const_unop(), CONSTANT_CLASS_P, constant_for_folding(), gimple_simplify(), maybe_push_res_to_seq(), and NULL_TREE.

Referenced by cleanup_control_expr_graph(), fold_stmt_1(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_fold_stmt_to_constant_1(), and process_bb().

◆ gimple_simplify() [5/6]

◆ gimple_simplify() [6/6]

tree gimple_simplify ( enum tree_code,
tree type,
tree op0,
tree op1,
tree op2,
gimple_seq * seq,
tree(* valueize )(tree) )
extern

◆ gimple_stmt_integer_valued_real_p()

bool gimple_stmt_integer_valued_real_p ( gimple * stmt,
int depth )
extern
Return true if the floating-point value computed by STMT is known
to have an integer value.  We also allow +Inf, -Inf and NaN to be
considered integer values. Return false for signaling NaN.

DEPTH is the current nesting depth of the query.   

References gimple_assign_integer_valued_real_p(), gimple_call_integer_valued_real_p(), and gimple_phi_integer_valued_real_p().

Referenced by integer_valued_real_single_p().

◆ gimple_stmt_nonnegative_warnv_p()

bool gimple_stmt_nonnegative_warnv_p ( gimple * stmt,
bool * strict_overflow_p,
int depth )
extern
Return true if STMT is known to compute a non-negative value.
If the return value is based on the assumption that signed overflow is
undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change
*STRICT_OVERFLOW_P.  DEPTH is the current nesting depth of the query.   

References get_global_range_query(), gimple_assign_nonnegative_warnv_p(), gimple_call_nonnegative_warnv_p(), gimple_phi_nonnegative_warnv_p(), gimple_range_type(), r, and frange::supports_p().

Referenced by fold_using_range::fold_stmt(), fold_using_range::range_of_call(), and tree_single_nonnegative_warnv_p().

◆ gimplify_and_update_call_from_tree()

void gimplify_and_update_call_from_tree ( gimple_stmt_iterator * si_p,
tree expr )
extern
Convert EXPR into a GIMPLE value suitable for substitution on the
RHS of an assignment.  Insert the necessary statements before
iterator *SI_P.  The statement at *SI_P, which must be a GIMPLE_CALL
is replaced.  If the call is expected to produces a result, then it
is replaced by an assignment of the new RHS to the result variable.
If the result is to be ignored, then the call is replaced by a
GIMPLE_NOP.  A proper VDEF chain is retained by making the first
VUSE and the last VDEF of the whole sequence be the same as the replaced
statement and using new SSA names for stores in between.   

References CALL_EXPR_ARG, CALL_EXPR_FN, call_expr_nargs, cfun, finish_update_gimple_call(), force_gimple_operand(), gcc_assert, gimple_build_assign(), gimple_build_call_vec(), gimple_build_nop(), gimple_call_lhs(), gimple_in_ssa_p(), gimple_seq_empty_p(), gimplify_and_add(), GSI_CONTINUE_LINKING, gsi_insert_after_without_update(), gsi_last(), gsi_replace(), gsi_replace_with_seq_vops(), gsi_stmt(), i, is_gimple_call(), NULL, NULL_TREE, pop_gimplify_context(), push_gimplify_context(), release_defs(), unlink_stmt_vdef(), valid_gimple_call_p(), and vNULL.

Referenced by dynamic_object_sizes_execute_one(), ccp_folder::fold_stmt(), gimple_fold_builtin(), gimple_fold_call(), strlen_pass::handle_builtin_memcmp(), strlen_pass::handle_builtin_strchr(), strlen_pass::handle_builtin_strlen(), maybe_optimize_arith_overflow(), and simplify_builtin_call().

◆ gsi_replace_with_seq_vops()

◆ maybe_fold_and_comparisons()

tree maybe_fold_and_comparisons ( tree type,
enum tree_code code1,
tree op1a,
tree op1b,
enum tree_code code2,
tree op2a,
tree op2b,
basic_block outer_cond_bb )
extern
Try to simplify the AND of two comparisons, specified by
(OP1A CODE1 OP1B) and (OP2B CODE2 OP2B), respectively.
If this can be simplified to a single expression (without requiring
introducing more SSA variables to hold intermediate values),
return the resulting tree.  Otherwise return NULL_TREE.
If the result expression is non-null, it has boolean type.   

References and_comparisons_1(), maybe_fold_comparisons_from_match_pd(), and NULL_TREE.

Referenced by and_var_with_comparison_1(), eliminate_redundant_comparison(), ifcombine_ifandif(), optimize_vec_cond_expr(), and simplify_1b().

◆ maybe_fold_or_comparisons()

tree maybe_fold_or_comparisons ( tree type,
enum tree_code code1,
tree op1a,
tree op1b,
enum tree_code code2,
tree op2a,
tree op2b,
basic_block outer_cond_bb )
extern
Try to simplify the OR of two comparisons, specified by
(OP1A CODE1 OP1B) and (OP2B CODE2 OP2B), respectively.
If this can be simplified to a single expression (without requiring
introducing more SSA variables to hold intermediate values),
return the resulting tree.  Otherwise return NULL_TREE.
If the result expression is non-null, it has boolean type.   

References maybe_fold_comparisons_from_match_pd(), NULL_TREE, and or_comparisons_1().

Referenced by eliminate_redundant_comparison(), fold_or_predicates(), optimize_vec_cond_expr(), and or_var_with_comparison_1().

◆ no_follow_ssa_edges()

tree no_follow_ssa_edges ( tree )
extern
Valueziation callback that ends up not following SSA edges.   

References NULL_TREE.

Referenced by back_propagate_equivalences(), cleanup_control_expr_graph(), fold_stmt(), and fold_stmt_inplace().

◆ optimize_atomic_compare_exchange_p()

◆ replace_call_with_value()

◆ rewrite_to_defined_overflow() [1/2]

gimple_seq rewrite_to_defined_overflow ( gimple * stmt)
extern

◆ rewrite_to_defined_overflow() [2/2]

void rewrite_to_defined_overflow ( gimple_stmt_iterator * gsi)
extern

◆ tree_vec_extract()

◆ update_gimple_call()

bool update_gimple_call ( gimple_stmt_iterator * si_p,
tree fn,
int nargs,
... )
extern
Update a GIMPLE_CALL statement at iterator *SI_P to call to FN
with number of arguments NARGS, where the arguments in GIMPLE form
follow NARGS argument.   

References ap, as_a(), finish_update_gimple_call(), gcc_assert, gimple_build_call_valist(), gsi_stmt(), and is_gimple_call().

Referenced by strlen_pass::handle_builtin_memset(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_builtin_strcpy(), strlen_pass::handle_builtin_string_cmp(), and instrument_builtin_call().