GCC Middle and Back End API Reference
|
#include <poly-int.h>
Public Member Functions | |
poly_int ()=default | |
poly_int (const poly_int &)=default | |
template<typename Ca > | |
poly_int (const poly_int< N, Ca > &) | |
template<typename ... Cs> | |
constexpr | poly_int (const Cs &...) |
poly_int & | operator= (const poly_int &)=default |
template<typename Ca > | |
poly_int & | operator= (const poly_int< N, Ca > &) |
template<typename Ca > | |
if_nonpoly< Ca, poly_int >::type & | operator= (const Ca &) |
template<typename Ca > | |
poly_int & | operator+= (const poly_int< N, Ca > &) |
template<typename Ca > | |
if_nonpoly< Ca, poly_int >::type & | operator+= (const Ca &) |
template<typename Ca > | |
poly_int & | operator-= (const poly_int< N, Ca > &) |
template<typename Ca > | |
if_nonpoly< Ca, poly_int >::type & | operator-= (const Ca &) |
template<typename Ca > | |
if_nonpoly< Ca, poly_int >::type & | operator*= (const Ca &) |
poly_int & | operator<<= (unsigned int) |
bool | is_constant () const |
template<typename T > | |
if_lossless< T, C, bool >::type | is_constant (T *) const |
C | to_constant () const |
bool | to_shwi (poly_int< N, HOST_WIDE_INT > *) const |
bool | to_uhwi (poly_int< N, unsigned HOST_WIDE_INT > *) const |
poly_int< N, HOST_WIDE_INT > | force_shwi () const |
poly_int< N, unsigned HOST_WIDE_INT > | force_uhwi () const |
template<typename ... Cs> | |
constexpr | poly_int (const Cs &... cs) |
template<typename C0 , typename ... Cs> | |
constexpr | poly_int (poly_int_hungry, const C0 &c0, const Cs &... cs) |
template<typename ... Cs> | |
constexpr | poly_int (poly_int_full, const Cs &... cs) |
template<typename Ca > | |
poly_int< N, C > & | operator= (const poly_int< N, Ca > &a) |
template<typename Ca > | |
poly_int< N, C > & | operator+= (const poly_int< N, Ca > &a) |
template<typename Ca > | |
poly_int< N, C > & | operator-= (const poly_int< N, Ca > &a) |
Static Public Member Functions | |
template<typename Ca > | |
static poly_int< N, C > | from (const poly_int< N, Ca > &, unsigned int, signop) |
template<typename Ca > | |
static poly_int< N, C > | from (const poly_int< N, Ca > &, signop) |
Data Fields | |
C | coeffs [N] |
Private Member Functions | |
template<typename ... Cs> | |
constexpr | poly_int (poly_int_full, const Cs &...) |
template<typename C0 , typename ... Cs> | |
constexpr | poly_int (poly_int_hungry, const C0 &, const Cs &...) |
Polynomial integer classes. Copyright (C) 2014-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 provides a representation of sizes and offsets whose exact values depend on certain runtime properties. The motivating example is the Arm SVE ISA, in which the number of vector elements is only known at runtime. See doc/poly-int.texi for more details. Tests for poly-int.h are located in testsuite/gcc.dg/plugin, since they are too expensive (in terms of binary size) to be included as selftests.
A class containing polynomial integers. The polynomial has N coefficients of type C, and N - 1 indeterminates.
|
default |
|
default |
|
inline |
References a, i, N, and POLY_SET_COEFF.
|
constexpr |
|
constexprprivate |
|
constexprprivate |
|
inlineconstexpr |
|
inlineconstexpr |
Initialize with c0, cs..., and some trailing zeros.
|
inlineconstexpr |
Initialize with cs... directly, casting where necessary.
|
inline |
Force a generic_wide_int-based constant to HOST_WIDE_INT precision, truncating if necessary.
References poly_int< N, C >::coeffs, i, N, and r.
Referenced by address_compare(), build_simple_mem_ref_loc(), decode_addr_const(), dr_analyze_innermost(), expand_expr_real_1(), get_addr_base_and_unit_offset_1(), get_inner_reference(), get_object_alignment_2(), isra_get_ref_base_and_offset(), and vect_compute_data_ref_alignment().
|
inline |
Force a generic_wide_int-based constant to unsigned HOST_WIDE_INT precision, truncating if necessary.
References poly_int< N, C >::coeffs, i, N, and r.
|
inlinestatic |
Convert X to a fixed_wide_int-based polynomial, extending according to SGN.
References a, i, N, POLY_SET_COEFF, and r.
|
inlinestatic |
Convert X to a wide_int-based polynomial in which each coefficient has BITSIZE bits. If X's coefficients are smaller than BITSIZE, extend them according to SGN.
References a, i, N, POLY_SET_COEFF, and r.
Referenced by addr_for_mem_ref(), bits_from_bytes(), build_poly_int_cst(), fold_convert_const(), force_fit_type(), gen_int_mode(), immed_wide_int_const(), mem_ref_offset(), fold_using_range::range_of_address(), simplify_context::simplify_subreg(), vn_reference_fold_indirect(), vn_reference_lookup_3(), and vn_reference_maybe_forwprop_address().
Return true if the polynomial value is a compile-time constant.
Referenced by addr_stridxptr(), address_compare(), aff_combination_add_product(), aff_combination_mult(), vec_perm_indices::all_in_range_p(), all_positions_needed_p(), any_positions_needed_p(), ao_ref_alignment(), vector_costs::better_epilogue_loop_than_p(), vector_builder< T, Shape, Derived >::binary_encoded_nelts(), check_sibcall_argument_overlap(), compute_trims(), constant_byte_string(), constant_multiple_of(), create_access(), decode_field_reference(), def_cfa_0(), dse_step5(), expand_stack_vars(), expand_vector_ubsan_overflow(), extract_bit_field(), extract_bit_field_1(), fold_const_aggregate_ref_1(), fold_ctor_reference(), fold_read_from_vector(), fold_vec_perm(), force_fit_type(), fortran_common(), frame_offset_overflow(), fully_constant_vn_reference_p(), gather_mem_refs_stmt(), gen_int_mode(), get_access_for_expr(), get_addr_stridx(), get_constraint_for_component_ref(), get_group_load_store_type(), get_load_store_type(), get_range_strlen_dynamic(), get_ref_base_and_extent_hwi(), get_stored_val(), pair_fusion::get_viable_bases(), immed_wide_int_const(), fixed_size_mode::includes_p(), int_loc_descriptor(), isra_get_ref_base_and_offset(), loc_descr_plus_const(), loc_list_for_address_of_addr_expr_of_indirect_ref(), loc_list_from_tree_1(), make_item_for_dump_dec(), mark_stack_region_used(), maybe_optimize_ubsan_ptr_ifn(), native_interpret_aggregate(), vector_builder< T, Shape, Derived >::new_binary_operation(), vector_builder< T, Shape, Derived >::new_unary_operation(), vec_perm_indices::new_vector(), optimize_bit_field_compare(), optimize_bitfield_assignment_op(), pp_wide_integer(), print_poly_int(), pseudo_reg_slot_compare(), record_operand_costs(), record_store(), scan_stores(), set_all_positions_unneeded(), set_usage_bits(), slsr_process_ref(), stack_region_maybe_used_p(), store_bit_field(), store_constructor(), store_field(), valid_mask_for_fold_vec_perm_cst_p(), vect_build_slp_instance(), vect_build_slp_tree_2(), vect_compute_data_ref_alignment(), vect_create_epilog_for_reduction(), vect_create_nonlinear_iv_init(), vect_create_nonlinear_iv_step(), vect_do_peeling(), vect_gen_prolog_loop_niters(), vect_gen_vector_loop_niters(), vect_transform_loop(), vect_transform_loops(), vect_transform_slp_perm_load_1(), vectorizable_induction(), vectorizable_load(), vectorizable_nonlinear_induction(), vectorizable_reduction(), vectorizable_slp_permutation_1(), vectorizable_store(), verify_sra_access_forest(), vn_reference_lookup_2(), vn_reference_lookup_3(), and wide_int_to_tree().
|
inline |
Return true if the polynomial value is a compile-time constant, storing its value in CONST_VALUE if so.
|
inline |
References a.
poly_int & poly_int< N, C >::operator+= | ( | const poly_int< N, Ca > & | ) |
|
inline |
References a, poly_int< N, C >::coeffs, i, and N.
|
inline |
References a.
poly_int & poly_int< N, C >::operator-= | ( | const poly_int< N, Ca > & | ) |
|
inline |
References a, poly_int< N, C >::coeffs, i, and N.
|
inline |
|
inline |
References a, i, N, and POLY_SET_COEFF.
|
default |
poly_int & poly_int< N, C >::operator= | ( | const poly_int< N, Ca > & | ) |
|
inline |
References a, i, N, and POLY_SET_COEFF.
Return the value of a polynomial that is already known to be a compile-time constant. NOTE: When using this function, please add a comment above the call explaining why we know the value is constant in that context.
References gcc_checking_assert.
Referenced by add_cfi_args_size(), add_mask_else_and_len_args(), build_common_tree_nodes(), calculate_table_based_CRC(), carry_backpropagate(), clear_padding_type(), default_class_max_nregs(), default_function_arg_padding(), do_compare_rtx_and_jump(), dwf_cfa_reg(), emit_move_multi_word(), emit_push_insn(), expand_fn_using_insn(), expand_used_vars(), ext_dce_process_sets(), ext_dce_process_uses(), extract_bit_field_1(), extract_integral_bit_field(), get_cfa_from_loc_descr(), pair_fusion::get_viable_bases(), gimple_build_vector(), group_limit(), immune_p(), lto_input_mode_table(), native_decode_rtx(), native_encode_rtx(), native_interpret_vector(), vector_builder< T, Shape, Derived >::new_binary_operation(), vector_builder< T, Shape, Derived >::new_unary_operation(), nunits_for_known_piecewise_op(), predicate_statements(), simd_clone_adjust(), simd_clone_mangle(), simplify_context::simplify_binary_operation_1(), simplify_const_binary_operation(), simplify_immed_subreg(), simplify_subreg_concatn(), simplify_vector_constructor(), store_bit_field_1(), store_constructor(), store_field(), subreg_get_info(), pair_fusion_bb_info::track_access(), pair_fusion_bb_info::track_via_mem_expr(), pair_fusion::try_promote_writeback(), undistribute_bitref_for_vector(), vect_create_epilog_for_reduction(), vect_create_nonlinear_iv_step(), vect_create_partial_epilog(), vect_do_peeling(), vect_permute_load_chain(), vect_permute_store_chain(), vect_recog_bitfield_ref_pattern(), vect_set_loop_condition_partial_vectors_avx512(), vect_slp_check_for_roots(), vect_transform_slp_perm_load_1(), vectorizable_load(), vectorizable_slp_permutation_1(), and vectorizable_store().
|
inline |
Return true if the coefficients of this generic_wide_int-based polynomial can be represented as signed HOST_WIDE_INTs without loss of precision. Store the HOST_WIDE_INT representation in *R if so.
References poly_int< N, C >::coeffs, wi::fits_shwi_p(), i, N, and r.
Referenced by adjust_offset_for_component_ref(), ao_ref_init_from_vn_reference(), copy_reference_ops_from_ref(), fold_comparison(), fold_const_aggregate_ref_1(), modref_access_node::get_ao_ref(), get_base_constructor(), get_constraint_for_component_ref(), get_inner_reference(), get_ref_base_and_extent(), split_address_to_core_and_offset(), store_kills_ref_p(), modref_access_node::update2(), and valueize_refs_1().
|
inline |
Return true if the coefficients of this generic_wide_int-based polynomial can be represented as unsigned HOST_WIDE_INTs without loss of precision. Store the unsigned HOST_WIDE_INT representation in *R if so.
References wi::fits_uhwi_p(), i, N, and r.
Referenced by constant_byte_string(), and pointer_may_wrap_p().
Referenced by inchash::hash::add_poly_hwi(), inchash::hash::add_poly_int(), aff_combination_add_product(), aff_combination_mult(), bp_pack_poly_value(), build_poly_int_cst(), const_hash_1(), const_poly_int_value(), default_estimated_poly_value(), estimated_poly_value(), force_fit_type(), poly_int< N, C >::force_shwi(), poly_int< N, C >::force_uhwi(), gen_int_mode(), GET_MODE_BITSIZE(), GET_MODE_NUNITS(), GET_MODE_PRECISION(), GET_MODE_SIZE(), get_object_alignment_2(), immed_wide_int_const(), int_loc_descriptor(), make_item_for_dump_dec(), poly_int< N, C >::operator+=(), poly_int< N, C >::operator-=(), poly_int_cst_value(), poly_int_read_common(), poly_int_rtx_p(), pp_wide_integer(), print_poly_int(), ptrdiff_tree_p(), rtx_to_poly_int64(), SET_TYPE_VECTOR_SUBPARTS(), streamer_write_poly_int64(), streamer_write_poly_uint64(), wi::to_poly_offset(), wi::to_poly_widest(), poly_int< N, C >::to_shwi(), trunc_int_for_mode(), TYPE_VECTOR_SUBPARTS(), subreg_shape::unique_id(), valid_vector_subparts_p(), vn_reference_insert(), vn_reference_lookup(), and wide_int_to_tree().