GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "ssa.h"
#include "optabs-tree.h"
#include "insn-config.h"
#include "recog.h"
#include "fold-const.h"
#include "stor-layout.h"
#include "gimple-iterator.h"
#include "cfgloop.h"
#include "tree-vectorizer.h"
#include "langhooks.h"
#include "gimple-walk.h"
#include "dbgcnt.h"
#include "tree-vector-builder.h"
#include "vec-perm-indices.h"
#include "gimple-fold.h"
#include "internal-fn.h"
Data Structures | |
class | complex_pattern |
class | complex_add_pattern |
class | complex_mul_pattern |
class | complex_fms_pattern |
class | complex_operations_pattern |
class | addsub_pattern |
Macros | |
#define | SLP_PATTERN(x) |
Typedefs | |
typedef enum _complex_operation | complex_operation_t |
Enumerations | |
enum | _complex_operation : unsigned { PLUS_PLUS , MINUS_PLUS , PLUS_MINUS , MULT_MULT , CMPLX_NONE } |
enum | _conj_status { CONJ_NONE , CONJ_FST , CONJ_SND } |
Variables | |
vect_pattern_decl_t | slp_patterns [] |
size_t | num__slp_patterns = ARRAY_SIZE (slp_patterns) |
#define SLP_PATTERN | ( | x | ) |
typedef enum _complex_operation complex_operation_t |
The COMPLEX_OPERATION enum denotes the possible pair of operations that can be matched when looking for expressions that we are interested matching for complex numbers addition and mla.
enum _complex_operation : unsigned |
enum _conj_status |
|
inlinestatic |
References a, b, compatible_calls_p(), compatible_complex_nodes_p(), dyn_cast(), hash_map< KeyId, Value, Traits >::get(), gimple_arg(), gimple_assign_rhs_code(), gimple_num_args(), i, is_gimple_assign(), is_gimple_call(), NULL, operand_equal_p(), hash_map< KeyId, Value, Traits >::put(), same_data_refs(), SLP_TREE_CHILDREN, SLP_TREE_DEF_TYPE, SLP_TREE_REPRESENTATIVE, SLP_TREE_SCALAR_OPS, STMT_VINFO_DATA_REF, STMT_VINFO_STMT, TREE_CODE, and vect_internal_def.
Referenced by compatible_complex_nodes_p(), and vect_validate_multiplication().
|
inlinestatic |
Helper function to check if PERM is KIND or PERM_TOP.
References linear_loads_p(), and PERM_TOP.
Referenced by vect_validate_multiplication().
|
inlinestatic |
Helper function of linear_loads_p that checks to see if the load permutation is sequential and in monotonically increasing order of loads with no gaps.
References candidates, FOR_EACH_VEC_ELT, i, PERM_EVENEVEN, PERM_EVENODD, PERM_ODDEVEN, PERM_ODDODD, and PERM_UNKNOWN.
Referenced by linear_loads_p().
|
static |
Check to see if all loads rooted in ROOT are linear. Linearity is defined as having no gaps between values loaded.
References DR_IS_READ, FOR_EACH_VEC_ELT, hash_map< KeyId, Value, Traits >::get(), i, is_linear_load_p(), linear_loads_p(), NULL, PERM_EVENODD, PERM_TOP, PERM_UNKNOWN, hash_map< KeyId, Value, Traits >::put(), SLP_TREE_CHILDREN, SLP_TREE_CODE, SLP_TREE_DEF_TYPE, SLP_TREE_LOAD_PERMUTATION, SLP_TREE_REPRESENTATIVE, STMT_VINFO_DATA_REF, vect_internal_def, and vect_merge_perms().
Referenced by is_eq_or_top(), linear_loads_p(), complex_add_pattern::matches(), complex_fms_pattern::matches(), complex_mul_pattern::matches(), and vect_validate_multiplication().
This function combines two nodes containing only even and only odd lanes together into a single node which contains the nodes in even/odd order by using a lane permute. The lanes in EVEN and ODD are duplicated 2 times inside the vectors. So for a lanes = 4 EVEN contains {EVEN1, EVEN1, EVEN2, EVEN2}. The tree REPRESENTATION is taken from the supplied REP along with the vectype which must be the same between all three nodes.
References gcc_assert, SLP_TREE_CHILDREN, SLP_TREE_CODE, SLP_TREE_LANE_PERMUTATION, SLP_TREE_LANES, SLP_TREE_REF_COUNT, SLP_TREE_REPRESENTATIVE, SLP_TREE_VECTYPE, and vect_create_new_slp_node().
Referenced by complex_fms_pattern::build(), and complex_mul_pattern::build().
This function attempts to make a node rooted in NODE is linear. If the node if already linear than the node itself is returned in RESULT. If the node is not linear then a new VEC_PERM_EXPR node is created with a lane permute that when applied will make the node linear. If such a permute cannot be created then FALSE is returned from the function. Here linearity is defined as having a sequential, monotically increasing load position inside the load permute generated by the loads reachable from NODE.
References SLP_TREE_CHILDREN, SLP_TREE_LANE_PERMUTATION, SLP_TREE_LANES, SLP_TREE_REF_COUNT, SLP_TREE_REPRESENTATIVE, SLP_TREE_VECTYPE, and vect_create_new_slp_node().
Referenced by complex_add_pattern::build().
|
inlinestatic |
Check if the given lane permute in PERMUTES matches an alternating sequence of {even odd even odd ...}. This to account for unrolled loops. Further mode there resulting permute must be linear.
References i.
Referenced by vect_detect_pair_op().
|
static |
Overload of vect_detect_pair_op that matches against the representative statements in the children of NODE. It is expected that NODE has exactly two children and when TWO_OPERANDS then NODE must be a VEC_PERM.
References CMPLX_NONE, NULL, SLP_TREE_CHILDREN, SLP_TREE_CODE, SLP_TREE_LANE_PERMUTATION, and vect_detect_pair_op().
|
static |
This function will match the two gimple expressions representing NODE1 and NODE2 in parallel and returns the pair operation that represents the two expressions in the two statements. If match is successful then the corresponding complex_operation is returned and the arguments to the two matched operations are returned in OPS. If TWO_OPERANDS it is expected that the LANES of the parent VEC_PERM select from the two nodes alternatingly. If unsuccessful then CMPLX_NONE is returned and OPS is untouched. e.g. the following gimple statements stmt 0 _39 = _37 + _12; stmt 1 _6 = _38 - _36; will return PLUS_MINUS along with OPS containing {_37, _12, _38, _36}.
References CMPLX_NONE, MINUS_PLUS, MULT_MULT, NULL, PLUS_MINUS, PLUS_PLUS, SLP_TREE_CHILDREN, vect_check_evenodd_blend(), and vect_match_expression_p().
Referenced by complex_fms_pattern::matches(), complex_add_pattern::recognize(), complex_fms_pattern::recognize(), complex_mul_pattern::recognize(), complex_operations_pattern::recognize(), and vect_detect_pair_op().
Checks to see of the expression represented by NODE is a gimple assign with code CODE.
References gimple_assign_rhs_code(), is_gimple_assign(), SLP_TREE_REPRESENTATIVE, and STMT_VINFO_STMT.
Referenced by complex_fms_pattern::matches(), complex_mul_pattern::matches(), addsub_pattern::recognize(), vect_detect_pair_op(), and vect_validate_multiplication().
|
inlinestatic |
Combine complex_perm_kinds A and B into a new permute kind that describes the resulting operation.
References a, b, PERM_TOP, and PERM_UNKNOWN.
Referenced by linear_loads_p().
|
static |
SLP - Pattern matcher on SLP trees Copyright (C) 2020-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/>.
SLP Pattern matching mechanism. This extension to the SLP vectorizer allows one to transform the generated SLP tree based on any pattern. The difference between this and the normal vect pattern matcher is that unlike the former, this matcher allows you to match with instructions that do not belong to the same SSA dominator graph. The only requirement that this pattern matcher has is that you are only only allowed to either match an entire group or none. The pattern matcher currently only allows you to perform replacements to internal functions. Once the patterns are matched it is one way, these cannot be undone. It is currently not supported to match patterns recursively. To add a new pattern, implement the vect_pattern class and add the type to slp_patterns.
Default implementation of recognize that performs matching, validation and replacement of nodes but that can be overriden if required.
References direct_internal_fn_supported_p(), dump_enabled_p(), dump_printf_loc(), internal_fn_name(), MSG_NOTE, OPTIMIZE_FOR_SPEED, SLP_TREE_REPRESENTATIVE, SLP_TREE_VECTYPE, STMT_VINFO_STMT, and vect_location.
Referenced by complex_add_pattern::matches(), complex_fms_pattern::matches(), complex_mul_pattern::matches(), and addsub_pattern::recognize().
|
inlinestatic |
References compatible_complex_nodes_p(), CONJ_FST, CONJ_NONE, CONJ_SND, is_eq_or_top(), linear_loads_p(), PERM_EVENEVEN, PERM_EVENODD, PERM_ODDEVEN, PERM_ODDODD, SLP_TREE_CHILDREN, and vect_match_expression_p().
Referenced by complex_fms_pattern::matches(), and complex_mul_pattern::matches().
size_t num__slp_patterns = ARRAY_SIZE (slp_patterns) |
Set the number of SLP pattern matchers available.
Referenced by vect_match_slp_patterns_2().
vect_pattern_decl_t slp_patterns[] |
List of supported pattern matchers.
Referenced by vect_match_slp_patterns_2().