aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2020-11-20 13:32:32 +0000
committerTamar Christina <tamar.christina@arm.com>2020-11-20 13:32:32 +0000
commitad318e3f1d372c4e720979d1eb13bebb8fb852d8 (patch)
tree00f745e505d815e658f4bae250258f30a26fec10
parent640ebeb336050887cb57417b7568279c588088f0 (diff)
downloadgcc-ad318e3f1d372c4e720979d1eb13bebb8fb852d8.zip
gcc-ad318e3f1d372c4e720979d1eb13bebb8fb852d8.tar.gz
gcc-ad318e3f1d372c4e720979d1eb13bebb8fb852d8.tar.bz2
SLP: Have vectorizable_slp_permutation set type on invariants
This modifies vectorizable_slp_permutation to update the type of the children of a perm node before trying to permute them. This allows us to be able to permute invariant nodes. This will be covered by test from the SLP pattern matcher. gcc/ChangeLog: * tree-vect-slp.c (vectorizable_slp_permutation): Update types on nodes when needed.
-rw-r--r--gcc/tree-vect-slp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 3735685..59a8630 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -5187,7 +5187,8 @@ vectorizable_slp_permutation (vec_info *vinfo, gimple_stmt_iterator *gsi,
slp_tree child;
unsigned i;
FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- if (!types_compatible_p (SLP_TREE_VECTYPE (child), vectype))
+ if (!vect_maybe_update_slp_op_vectype (child, vectype)
+ || !types_compatible_p (SLP_TREE_VECTYPE (child), vectype))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,