Add gimple_build_vector* helpers
commit9ed1960bed86688e15599f8e690ee0f0901b4ef8
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Sep 2017 16:18:55 +0000 (14 16:18 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Sep 2017 16:18:55 +0000 (14 16:18 +0000)
treef07cb487b4874c0bff14e1e55b322fe455c59610
parent282dc861f9cab43205a931f3a573bb23cf15eb10
Add gimple_build_vector* helpers

This patch adds gimple-fold.h equivalents of build_vector and
build_vector_from_val.  Like the other gimple-fold.h routines
they always return a valid gimple value and add any new
statements to a given gimple_seq.  In combination with later
patches this reduces the number of force_gimple_operands.

2017-09-14  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* gimple-fold.h (gimple_build_vector_from_val): Declare, and provide
an inline wrapper that provides a location.
(gimple_build_vector): Likewise.
* gimple-fold.c (gimple_build_vector_from_val): New function.
(gimple_build_vector): Likewise.
* tree-vect-loop.c (get_initial_def_for_reduction): Use the new
functions to build the initial value.  Always return a gimple value.
(get_initial_defs_for_reduction): Likewise.  Only compute
neutral_vec once.
(vect_create_epilog_for_reduction): Don't call force_gimple_operand or
vect_init_vector on the results from get_initial_def(s)_for_reduction.
(vectorizable_induction): Use gimple_build_vector rather than
vect_init_vector.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252762 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/gimple-fold.c
gcc/gimple-fold.h
gcc/tree-vect-loop.c