This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Allow the number of iterations to be smaller than VF
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "richard dot sandiford at linaro dot org" <richard dot sandiford at linaro dot org>, <nd at arm dot com>
- Date: Sun, 7 Jan 2018 20:51:56 +0000
- Subject: Re: Allow the number of iterations to be smaller than VF
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=bestguesspass action=none header.from=arm.com;
- Nodisclaimer: True
- References: <87d14hym7l.fsf@linaro.org> <be1423d9-cbc9-460d-a028-06045903f3c7@redhat.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Mon, Nov 20, 2017 at 12:12:38AM +0000, Jeff Law wrote:
> On 11/17/2017 08:11 AM, Richard Sandiford wrote:
> > Fully-masked loops can be profitable even if the iteration
> > count is smaller than the vectorisation factor. In this case
> > we're effectively doing a complete unroll followed by SLP.
> >
> > The documentation for min-vect-loop-bound says that the
> > default value is 0, but actually the default and minimum
> > were 1. We need it to be 0 for this case since the parameter
> > counts a whole number of vector iterations.
> >
> > Tested on aarch64-linux-gnu (with and without SVE), x86_64-linux-gnu
> > and powerpc64le-linux-gnu. OK to install?
> >
> > Richard
> >
> >
> > 2017-11-17 Richard Sandiford <richard.sandiford@linaro.org>
> > Alan Hayward <alan.hayward@arm.com>
> > David Sherwood <david.sherwood@arm.com>
> >
> > gcc/
> > * doc/sourcebuild.texi (vect_fully_masked): Document.
> > * params.def (PARAM_MIN_VECT_LOOP_BOUND): Change minimum and
> > default value to 0.
> > * tree-vect-loop.c (vect_analyze_loop_costing): New function,
> > split out from...
> > (vect_analyze_loop_2): ...here. Don't check the vectorization
> > factor against the number of loop iterations if the loop is
> > fully-masked.
> >
> > gcc/testsuite/
> > * lib/target-supports.exp (check_effective_target_vect_fully_masked):
> > New proc.
> > * gcc.dg/vect/slp-3.c: Expect all loops to be vectorized if
> > vect_fully_masked.
> > * gcc.target/aarch64/sve_loop_add_4.c: New test.
> > * gcc.target/aarch64/sve_loop_add_4_run.c: Likewise.
> > * gcc.target/aarch64/sve_loop_add_5.c: Likewise.
> > * gcc.target/aarch64/sve_loop_add_5_run.c: Likewise.
> > * gcc.target/aarch64/sve_miniloop_1.c: Likewise.
> > * gcc.target/aarch64/sve_miniloop_2.c: Likewise.
> OK.
> Jeff
The AArch64 tests are OK.
James