Commit 6aa904c4 by Ira Rosen Committed by Ira Rosen

tree-vect-stmts.c (vectorizable_load): For SLP without permutation treat the…

tree-vect-stmts.c (vectorizable_load): For SLP without permutation treat the first load of the node as the first...


        * tree-vect-stmts.c (vectorizable_load): For SLP without
        permutation treat the first load of the node as the first
        element in its interleaving chain.
        * tree-vect-slp.c (vect_get_and_check_slp_defs): Swap the
        operands if necessary and possible.
        (vect_build_slp_tree): Add new argument.  Allow load groups of
        any size in basic blocks.  Keep all the loads for further
        permutation check.  Use the new argument to determine if there
        is a permutation.  Update the recursive calls.
        (vect_supported_load_permutation_p): Allow subchains of
        interleaving chains in basic block vectorization.
        (vect_analyze_slp_instance): Update the call to
        vect_build_slp_tree.  Check load permutation based on the new
        parameter.
        (vect_schedule_slp_instance): Don't start from the first element
        in interleaving chain unless the loads are permuted.

From-SVN: r180055
parent 1bb7e8f8
2011-10-16 Ira Rosen <ira.rosen@linaro.org>
* tree-vect-stmts.c (vectorizable_load): For SLP without permutation
treat the first load of the node as the first element in its
interleaving chain.
* tree-vect-slp.c (vect_get_and_check_slp_defs): Swap the operands if
necessary and possible.
(vect_build_slp_tree): Add new argument. Allow load groups of any size
in basic blocks. Keep all the loads for further permutation check.
Use the new argument to determine if there is a permutation. Update
the recursive calls.
(vect_supported_load_permutation_p): Allow subchains of interleaving
chains in basic block vectorization.
(vect_analyze_slp_instance): Update the call to vect_build_slp_tree.
Check load permutation based on the new parameter.
(vect_schedule_slp_instance): Don't start from the first element in
interleaving chain unless the loads are permuted.
2011-10-15 Jan Hubicka <jh@suse.cz>
PR target/48668
2011-10-16 Ira Rosen <ira.rosen@linaro.org>
* gcc.dg/vect/bb-slp-29.c: New test.
2011-10-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50732
......
/* { dg-require-effective-target vect_int } */
#include <stdarg.h>
#include "tree-vect.h"
#define A 3
#define B 4
#define N 256
short src[N], dst[N];
void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy)
{
int i;
h /= 16;
for (i = 0; i < h; i++)
{
dst[0] = A*src[0] + B*src[1];
dst[1] = A*src[1] + B*src[2];
dst[2] = A*src[2] + B*src[3];
dst[3] = A*src[3] + B*src[4];
dst[4] = A*src[4] + B*src[5];
dst[5] = A*src[5] + B*src[6];
dst[6] = A*src[6] + B*src[7];
dst[7] = A*src[7] + B*src[8];
dst += stride;
src += stride;
if (dummy == 32)
abort ();
}
}
int main (void)
{
int i;
check_vect ();
for (i = 0; i < N; i++)
{
dst[i] = 0;
src[i] = i;
}
foo (dst, src, N, 8, 0);
for (i = 0; i < N/2; i++)
{
if (dst[i] != A * src[i] + B * src[i+1])
abort ();
}
return 0;
}
/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target { vect_int_mult && vect_element_align } } } } */
/* { dg-final { cleanup-tree-dump "slp" } } */
......@@ -4241,6 +4241,11 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
if (strided_load)
{
first_stmt = GROUP_FIRST_ELEMENT (stmt_info);
if (slp
&& !SLP_INSTANCE_LOAD_PERMUTATION (slp_node_instance)
&& first_stmt != VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0))
first_stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0);
/* Check if the chain of loads is already vectorized. */
if (STMT_VINFO_VEC_STMT (vinfo_for_stmt (first_stmt)))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment