This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [RFC, vectorizer] Allow single element vector types for vector reduction operations
- From: "Jon Beniston" <jon at beniston dot com>
- To: "'Richard Biener'" <rguenther at suse dot de>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 28 Aug 2017 09:28:56 +0100
- Subject: RE: [RFC, vectorizer] Allow single element vector types for vector reduction operations
- Authentication-results: sourceware.org; auth=none
- References: <015b01d31f6b$c3651620$4a2f4260$@beniston.com> <alpine.LSU.2.20.1708280914330.14191@zhemvz.fhfr.qr>
Hi Richard,
>- if (nunits < 1) /* Support V1SI. */
>+ if (nunits < 1 || (nunits == 1 && !reduct_p))
> return NULL_TREE;
>
>doesn't seem to be against trunk which has
>
> if (nunits <= 1)
> return NULL_TREE;
>
>so what happens if you just change that to
>
> if (nunits < 1)
> return NULL_TREE;
Ah, that's what I first tried, and mistakenly sent the patch against that.
That did help the initial problem, but then I needed to add a lot of support
for the V1SI type in the backend (which just duplicated SI patterns) and
there are a few places where GCC seems to have sanity checks against vectors
that are only one element wide. A dot product producing a scalar result
seems natural.
Also, as well as ARC benefitting from this, I think the TI c6x port would
too. That currently has a sdot_prodv2hi pattern that uses SI and V2HI types.
Cheers,
Jon