aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2021-01-14 20:49:55 +0000
committerTamar Christina <tamar.christina@arm.com>2021-01-14 20:49:55 +0000
commitfe70119531395c8105b098bfa915c003c78be038 (patch)
tree4c2e6882ca761e3e002668ed7f794f68c26c1350 /gcc
parentdea4a32b24fb888532c47f3920f6910b3c94a8a0 (diff)
downloadgcc-fe70119531395c8105b098bfa915c003c78be038.zip
gcc-fe70119531395c8105b098bfa915c003c78be038.tar.gz
gcc-fe70119531395c8105b098bfa915c003c78be038.tar.bz2
slp: elide intermediate nodes for complex add and avoid truncate
This applies the same feedback received for MUL and the rest to ADD which was already committed. In short it elides the intermediate nodes vec and avoids the use of truncate on the SLP child. gcc/ChangeLog: * tree-vect-slp-patterns.c (complex_add_pattern::build): Elide nodes.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-slp-patterns.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/tree-vect-slp-patterns.c b/gcc/tree-vect-slp-patterns.c
index 3903cdb..c4fa269 100644
--- a/gcc/tree-vect-slp-patterns.c
+++ b/gcc/tree-vect-slp-patterns.c
@@ -627,23 +627,21 @@ class complex_add_pattern : public complex_pattern
void
complex_add_pattern::build (vec_info *vinfo)
{
- auto_vec<slp_tree> nodes;
+ SLP_TREE_CHILDREN (*this->m_node).reserve_exact (2);
+
slp_tree node = this->m_ops[0];
vec<slp_tree> children = SLP_TREE_CHILDREN (node);
/* First re-arrange the children. */
- nodes.create (children.length ());
- nodes.quick_push (children[0]);
- nodes.quick_push (vect_build_swap_evenodd_node (children[1]));
+ SLP_TREE_CHILDREN (*this->m_node)[0] = children[0];
+ SLP_TREE_CHILDREN (*this->m_node)[1] =
+ vect_build_swap_evenodd_node (children[1]);
- SLP_TREE_REF_COUNT (nodes[0])++;
- SLP_TREE_REF_COUNT (nodes[1])++;
+ SLP_TREE_REF_COUNT (SLP_TREE_CHILDREN (*this->m_node)[0])++;
+ SLP_TREE_REF_COUNT (SLP_TREE_CHILDREN (*this->m_node)[1])++;
vect_free_slp_tree (this->m_ops[0]);
vect_free_slp_tree (this->m_ops[1]);
- SLP_TREE_CHILDREN (*this->m_node).truncate (0);
- SLP_TREE_CHILDREN (*this->m_node).safe_splice (nodes);
-
complex_pattern::build (vinfo);
}