r243749 - in /branches/ARM/sve-branch/gcc: conf...

rsandifo@gcc.gnu.org rsandifo@gcc.gnu.org
Fri Dec 16 15:13:00 GMT 2016


Author: rsandifo
Date: Fri Dec 16 15:13:45 2016
New Revision: 243749

URL: https://gcc.gnu.org/viewcvs?rev=243749&root=gcc&view=rev
Log:
[sve-branch] Fix choice of mask for reductions in speculative loops

Previously arithmetic reductions in a masked, speculatively-vectorised
loop would use the same mask as the speculative loads, and so could
include elements beyond the termination point.  They should instead
wait until the terminating comparison has determined the exact set
of active elements and use that instead.

Calculating the set of active elements requires a predicated
form of BREAK_AFTER, so that we only mark elements as active
if we tried to load them.

The patch adds a new mask array for the non-speculative masks.
It also adds the masked reduction statements to a new sequence
that is inserted after the termination condition is known.
(This should be safe because no later statements in the loop
should use the reduction accumulator result.)

Having two gconds (one scalar and one vector) made the insertion
awkward and might not be valid even as an intermediate state.
The patch therefore updates the original scalar gcond instead
of creating a new one.

After those changes, a first-faulting loop would only use the loop
mask for the IFN_FIRSTFAULT_LOADs themselves.  Such loops should
always try to load a full vector, so the patch removes the mask
argument from IFN_FIRSTFAULT_LOAD and also avoids populating the
mask array.  If we want to use masked first-faulting loads in
future, it would probably be better to add them as a separate
IFN_MASK_FIRSTFAULT_LOAD.

Added:
    branches/ARM/sve-branch/gcc/testsuite/gcc.target/aarch64/sve_speculative_24_run.c
    branches/ARM/sve-branch/gcc/testsuite/gcc.target/aarch64/sve_speculative_25.c
    branches/ARM/sve-branch/gcc/testsuite/gcc.target/aarch64/sve_speculative_25_run.c
    branches/ARM/sve-branch/gcc/testsuite/gcc.target/aarch64/sve_speculative_26.c
    branches/ARM/sve-branch/gcc/testsuite/gcc.target/aarch64/sve_speculative_26_run.c
Modified:
    branches/ARM/sve-branch/gcc/config/aarch64/aarch64-sve.md
    branches/ARM/sve-branch/gcc/gimple-iterator.h
    branches/ARM/sve-branch/gcc/internal-fn.c
    branches/ARM/sve-branch/gcc/internal-fn.def
    branches/ARM/sve-branch/gcc/testsuite/gcc.target/aarch64/sve_speculative_24.c
    branches/ARM/sve-branch/gcc/tree-vect-loop-manip.c
    branches/ARM/sve-branch/gcc/tree-vect-loop.c
    branches/ARM/sve-branch/gcc/tree-vect-stmts.c
    branches/ARM/sve-branch/gcc/tree-vectorizer.h



More information about the Gcc-cvs mailing list