Commit 51312233 by Ira Rosen Committed by Ira Rosen

tree-vectorizer.h (vect_recog_func_ptr): Change the first argument to be a VEC of statements.


        * tree-vectorizer.h (vect_recog_func_ptr): Change the first
        argument to be a VEC of statements.
        * tree-vect-loop.c (vect_determine_vectorization_factor):
        Remove the assert that pattern statements have to have their
        vector type set.
        * tree-vect-patterns.c (vect_recog_widen_sum_pattern):
        Change the first argument to be a VEC of statements.  Update
        documentation.
        (vect_recog_dot_prod_pattern, vect_recog_pow_pattern): Likewise.
        (vect_handle_widen_mult_by_const): New function.
        (vect_recog_widen_mult_pattern):  Change the first argument to
        be a VEC of statements.  Update documentation.  Check that the
        constant is INTEGER_CST.  Support multiplication by a constant
        that fits an intermediate type - call
        vect_handle_widen_mult_by_const.
        (vect_pattern_recog_1): Update vect_recog_func_ptr and its
        call.  Handle additional pattern statements if necessary.

From-SVN: r175102
parent 9c9eacb9
2011-06-16 Ira Rosen <ira.rosen@linaro.org>
* tree-vectorizer.h (vect_recog_func_ptr): Change the first
argument to be a VEC of statements.
* tree-vect-loop.c (vect_determine_vectorization_factor):
Remove the assert that pattern statements have to have their
vector type set.
* tree-vect-patterns.c (vect_recog_widen_sum_pattern):
Change the first argument to be a VEC of statements. Update
documentation.
(vect_recog_dot_prod_pattern, vect_recog_pow_pattern): Likewise.
(vect_handle_widen_mult_by_const): New function.
(vect_recog_widen_mult_pattern): Change the first argument to
be a VEC of statements. Update documentation. Check that the
constant is INTEGER_CST. Support multiplication by a constant
that fits an intermediate type - call
vect_handle_widen_mult_by_const.
(vect_pattern_recog_1): Update vect_recog_func_ptr and its
call. Handle additional pattern statements if necessary.
2011-06-16 Nick Clifton <nickc@redhat.com>
PR target/49427
......
2011-06-16 Ira Rosen <ira.rosen@linaro.org>
* gcc.dg/vect/vect-widen-mult-half-u8.c: New test.
2011-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/49417
......
/* { dg-require-effective-target vect_int } */
#include "tree-vect.h"
#include <stdlib.h>
#define N 32
#define COEF 32470
unsigned char in[N];
int out[N];
__attribute__ ((noinline)) void
foo ()
{
int i;
for (i = 0; i < N; i++)
out[i] = in[i] * COEF;
}
__attribute__ ((noinline)) void
bar ()
{
int i;
for (i = 0; i < N; i++)
out[i] = COEF * in[i];
}
int main (void)
{
int i;
for (i = 0; i < N; i++)
{
in[i] = i;
__asm__ volatile ("");
}
foo ();
for (i = 0; i < N; i++)
if (out[i] != in[i] * COEF)
abort ();
bar ();
for (i = 0; i < N; i++)
if (out[i] != in[i] * COEF)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_widen_mult_hi_to_si } } } */
/* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
/* { dg-final { scan-tree-dump-times "pattern recognized" 2 "vect" { target vect_widen_mult_hi_to_si_pattern } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
......@@ -311,9 +311,7 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
}
else
{
gcc_assert (!STMT_VINFO_DATA_REF (stmt_info)
&& !is_pattern_stmt_p (stmt_info));
gcc_assert (!STMT_VINFO_DATA_REF (stmt_info));
scalar_type = TREE_TYPE (gimple_get_lhs (stmt));
if (vect_print_dump_info (REPORT_DETAILS))
{
......
......@@ -896,7 +896,7 @@ extern void vect_slp_transform_bb (basic_block);
/* Pattern recognition functions.
Additional pattern recognition functions can (and will) be added
in the future. */
typedef gimple (* vect_recog_func_ptr) (gimple *, tree *, tree *);
typedef gimple (* vect_recog_func_ptr) (VEC (gimple, heap) **, tree *, tree *);
#define NUM_PATTERNS 4
void vect_pattern_recog (loop_vec_info);
......
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