slp: reject non-multiple of 2 laned SLP trees (PR99825)

TWO_OPERANDS allows any order or number of combinations of + and - operations
but the pattern matcher only supports pairs of operations.

This patch has the pattern matcher for complex numbers reject SLP trees where
the lanes are not a multiple of 2.

gcc/ChangeLog:

	PR tree-optimization/99825
	* tree-vect-slp-patterns.c (vect_check_evenodd_blend):
	Reject non-mult 2 lanes.

gcc/testsuite/ChangeLog:

	PR tree-optimization/99825
	* gfortran.dg/vect/pr99825.f90: New test.
This commit is contained in:
Tamar Christina 2021-03-30 14:16:03 +01:00
parent 6f93a7c7fc
commit 9c68e2abe2
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,15 @@
! { dg-do compile }
! { dg-additional-options "-march=armv8.3-a -O3" { target { aarch64*-*-* } } }
program main
complex, dimension(3, 2) :: a
complex, dimension(2, 4) :: b
complex, dimension(3, 4) :: c, res1
data a /0, (-5., -7.), (11., -13.), 0, 0, 0/
data b /0, 0, 0, 0, 0, 0, 0, 0/
data res1 /0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0/
c = matmul(a, conjg(b))
if (any(res1 /= c)) stop 2
end program main

View File

@ -332,7 +332,8 @@ static inline bool
vect_check_evenodd_blend (lane_permutation_t &permutes,
unsigned even, unsigned odd)
{
if (permutes.length () == 0)
if (permutes.length () == 0
|| permutes.length () % 2 != 0)
return false;
unsigned val[2] = {even, odd};