GCC Middle and Back End API Reference
|
#include <tree-vector-builder.h>
Static Public Member Functions | |
static unsigned int | binary_encoded_nelts (tree, tree) |
static unsigned int | binary_encoded_nelts (tree, tree) |
Protected Member Functions | |
void | new_vector (poly_uint64, unsigned int, unsigned int) |
void | reshape (unsigned int, unsigned int) |
void | reshape (unsigned int, unsigned int) |
bool | repeating_sequence_p (unsigned int, unsigned int, unsigned int) |
bool | repeating_sequence_p (unsigned int, unsigned int, unsigned int) |
bool | stepped_sequence_p (unsigned int, unsigned int, unsigned int) |
bool | stepped_sequence_p (unsigned int, unsigned int, unsigned int) |
bool | try_npatterns (unsigned int) |
bool | try_npatterns (unsigned int) |
Private Types | |
typedef vector_builder< tree, tree, tree_vector_builder > | parent |
Private Member Functions | |
bool | equal_p (const_tree, const_tree) const |
bool | allow_steps_p () const |
bool | integral_p (const_tree) const |
wide_int | step (const_tree, const_tree) const |
tree | apply_step (tree, unsigned int, const wide_int &) const |
bool | can_elide_p (const_tree) const |
void | note_representative (tree *, tree) |
tree_vector_builder * | derived () |
const tree_vector_builder * | derived () const |
tree_vector_builder * | derived () |
const tree_vector_builder * | derived () const |
Static Private Member Functions | |
static poly_uint64 | shape_nelts (const_tree t) |
static poly_uint64 | nelts_of (const_tree t) |
static unsigned int | npatterns_of (const_tree t) |
static unsigned int | nelts_per_pattern_of (const_tree t) |
Private Attributes | |
tree | m_type |
poly_uint64 | m_full_nelts |
poly_uint64 | m_full_nelts |
unsigned int | m_npatterns |
unsigned int | m_npatterns |
unsigned int | m_nelts_per_pattern |
unsigned int | m_nelts_per_pattern |
vec< tree, va_heap, vl_embed > | m_auto |
unsigned char | m_data [sizeof(tree) *N] |
Friends | |
class | vector_builder< tree, tree, tree_vector_builder > |
A class for building vector tree constants. Copyright (C) 2017-2025 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 class is used to build VECTOR_CSTs from a sequence of elements. See vector_builder for more details.
|
private |
|
inline |
References m_type.
|
inline |
Create a new builder for a vector of type TYPE. Initially encode the value as NPATTERNS interleaved patterns with NELTS_PER_PATTERN elements each.
References vector_builder< tree, tree, tree_vector_builder >::nelts_per_pattern(), new_vector(), vector_builder< tree, tree, tree_vector_builder >::npatterns(), and type().
|
inlineprivate |
Return true if a stepped representation is OK. We don't allow linear series for anything other than integers, to avoid problems with rounding.
References INTEGRAL_TYPE_P, m_type, and TREE_TYPE.
|
private |
A class for building vector tree constants. Copyright (C) 2017-2025 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/>.
Return a vector element with the value BASE + FACTOR * STEP.
References step(), wi::to_wide(), TREE_TYPE, and wide_int_to_tree().
|
staticinherited |
Return the number of elements that the caller needs to operate on in order to handle a binary operation on vector constants VEC1 and VEC2. This static function is used instead of new_binary_operation if the result of the operation is not a constant vector.
Referenced by ipa_icf::sem_variable::equals(), and valid_lattice_transition().
|
staticinherited |
Return the number of elements that the caller needs to operate on in order to handle a binary operation on vector constants VEC1 and VEC2. This static function is used instead of new_binary_operation if the result of the operation is not a constant vector.
tree tree_vector_builder::build | ( | ) |
Return a VECTOR_CST for the current constant.
References vector_builder< tree, tree, tree_vector_builder >::encoded_nelts(), exact_log2(), vector_builder< tree, tree, tree_vector_builder >::finalize(), gcc_assert, m_type, make_vector(), vector_builder< tree, tree, tree_vector_builder >::nelts_per_pattern(), vector_builder< tree, tree, tree_vector_builder >::npatterns(), pow2p_hwi(), TREE_TYPE, and VECTOR_CST_ENCODED_ELTS.
Referenced by bitmask_inv_cst_vector_p(), build_index_vector(), build_vec_series(), build_vector_a_then_b(), build_vector_from_val(), const_binop(), const_unop(), drop_tree_overflow(), exact_inverse(), expand_vector_divmod(), fold_const_vec_convert(), fold_convert_const(), fold_negate_expr_1(), fold_relational_const(), fold_ternary_loc(), fold_vec_perm_cst(), gimple_build_vector(), make_tree(), native_interpret_vector_part(), optimize_vector_constructor(), vec_perm_indices_to_tree(), vect_set_loop_condition_partial_vectors_avx512(), vector_const_binop(), and vectorizable_scan_store().
|
inlineprivate |
Return true if we can drop element ELT, even if the retained elements are different. Return false if this would mean losing overflow information.
References CONSTANT_CLASS_P, vector_builder< tree, tree, tree_vector_builder >::elt(), and TREE_OVERFLOW.
|
inherited |
Return the number of leading duplicate elements in the range [START:END:STEP]. The value is always at least 1.
|
inherited |
Return the number of leading duplicate elements in the range [START:END:STEP]. The value is always at least 1.
|
inlineprivateinherited |
|
inlineprivateinherited |
|
privateinherited |
|
inlineprivateinherited |
|
inherited |
Return the value of vector element I, which might or might not be encoded explicitly.
Referenced by tree_vector_builder::can_elide_p(), and tree_vector_builder::integral_p().
|
inherited |
Return the value of vector element I, which might or might not be encoded explicitly.
|
inherited |
Return true if every element of the vector is explicitly encoded.
|
inlineinherited |
Return true if every element of the vector is explicitly encoded.
|
inherited |
Return the number of elements that are explicitly encoded. The vec starts with these explicitly-encoded elements and may contain additional elided elements.
Referenced by tree_vector_builder::build().
|
inlineinherited |
Return the number of elements that are explicitly encoded. The vec starts with these explicitly-encoded elements and may contain additional elided elements.
|
inlineprivate |
Return true if elements I1 and I2 are equal.
References OEP_BITWISE, and operand_equal_p().
|
inherited |
Replace the current encoding with the canonical form.
Referenced by tree_vector_builder::build().
|
inherited |
Replace the current encoding with the canonical form.
|
inlineinherited |
|
inlineinherited |
|
inlineprivate |
Return true if ELT can be interpreted as an integer.
References vector_builder< tree, tree, tree_vector_builder >::elt(), and TREE_CODE.
|
inlinestaticprivate |
References VECTOR_CST_NELTS.
|
inlineinherited |
|
inlineinherited |
|
inlinestaticprivate |
References VECTOR_CST_NELTS_PER_PATTERN.
|
inherited |
Try to start building a new vector of shape SHAPE that holds the result of a binary operation on vector constants VEC1 and VEC2. ALLOW_STEPPED_P is true if the operation can handle stepped encodings directly, without having to expand the full sequence. Return true if the operation is possible. Leave the builder unchanged otherwise.
|
inherited |
Try to start building a new vector of shape SHAPE that holds the result of a binary operation on vector constants VEC1 and VEC2. ALLOW_STEPPED_P is true if the operation can handle stepped encodings directly, without having to expand the full sequence. Return true if the operation is possible. Leave the builder unchanged otherwise.
|
inherited |
Try to start building a new vector of shape SHAPE that holds the result of a unary operation on vector constant VEC. ALLOW_STEPPED_P is true if the operation can handle stepped encodings directly, without having to expand the full sequence. Return true if the operation is possible, which it always is when ALLOW_STEPPED_P is true. Leave the builder unchanged otherwise.
|
inherited |
Try to start building a new vector of shape SHAPE that holds the result of a unary operation on vector constant VEC. ALLOW_STEPPED_P is true if the operation can handle stepped encodings directly, without having to expand the full sequence. Return true if the operation is possible, which it always is when ALLOW_STEPPED_P is true. Leave the builder unchanged otherwise.
|
inline |
Start building a new vector of type TYPE. Initially encode the value as NPATTERNS interleaved patterns with NELTS_PER_PATTERN elements each.
References m_type, vector_builder< tree, tree, tree_vector_builder >::nelts_per_pattern(), vector_builder< tree, tree, tree_vector_builder >::new_vector(), vector_builder< tree, tree, tree_vector_builder >::npatterns(), type(), and TYPE_VECTOR_SUBPARTS().
Referenced by bitmask_inv_cst_vector_p(), duplicate_and_interleave(), get_initial_defs_for_reduction(), tree_vector_builder(), and vect_create_constant_vectors().
|
protectedinherited |
Start building a vector that has FULL_NELTS elements. Initially encode it using NPATTERNS patterns with NELTS_PER_PATTERN each.
Referenced by tree_vector_builder::new_vector().
Record that ELT2 is being elided, given that ELT1_PTR points to the last encoded element for the containing pattern.
References gcc_assert, operand_equal_p(), TREE_OVERFLOW, and TREE_OVERFLOW_P.
|
inlineinherited |
|
inlineinherited |
|
inlinestaticprivate |
References VECTOR_CST_NPATTERNS.
|
inlineinherited |
|
inlineinherited |
|
inherited |
Return true if this vector and OTHER have the same elements and are encoded in the same way.
|
inherited |
Return true if this vector and OTHER have the same elements and are encoded in the same way.
|
protectedinherited |
Return true if elements [START, END) contain a repeating sequence of STEP elements.
|
protectedinherited |
Return true if elements [START, END) contain a repeating sequence of STEP elements.
|
protectedinherited |
Change the encoding to NPATTERNS patterns of NELTS_PER_PATTERN each, but without changing the underlying vector.
|
protectedinherited |
Change the encoding to NPATTERNS patterns of NELTS_PER_PATTERN each, but without changing the underlying vector.
|
inlinestaticprivate |
References TYPE_VECTOR_SUBPARTS().
|
inlineprivate |
Return the value of element ELT2 minus the value of element ELT1. Both elements are known to be INTEGER_CSTs.
References wi::to_wide().
Referenced by apply_step().
|
protectedinherited |
Return true if elements [START, END) contain STEP interleaved linear series.
|
protectedinherited |
Return true if elements [START, END) contain STEP interleaved linear series.
|
protectedinherited |
Try to change the number of encoded patterns to NPATTERNS, returning true on success.
|
protectedinherited |
Try to change the number of encoded patterns to NPATTERNS, returning true on success.
|
inline |
References m_type.
Referenced by gimple_build_vector(), new_vector(), and tree_vector_builder().
|
friend |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
private |
Referenced by allow_steps_p(), build(), new_vector(), tree_vector_builder(), and type().