diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-09-14 16:18:55 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-09-14 16:18:55 +0000 |
commit | e7c45b6600acfdc0930b980a45a364f77844139a (patch) | |
tree | f07cb487b4874c0bff14e1e55b322fe455c59610 /gcc/gimple-fold.h | |
parent | 908a1a166dccefa24ae8b3606f4ce1da944eecb0 (diff) | |
download | gcc-e7c45b6600acfdc0930b980a45a364f77844139a.zip gcc-e7c45b6600acfdc0930b980a45a364f77844139a.tar.gz gcc-e7c45b6600acfdc0930b980a45a364f77844139a.tar.bz2 |
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.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r252762
Diffstat (limited to 'gcc/gimple-fold.h')
-rw-r--r-- | gcc/gimple-fold.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/gimple-fold.h b/gcc/gimple-fold.h index 2cee385..ddbc4f0 100644 --- a/gcc/gimple-fold.h +++ b/gcc/gimple-fold.h @@ -127,6 +127,21 @@ gimple_convert_to_ptrofftype (gimple_seq *seq, tree op) return gimple_convert_to_ptrofftype (seq, UNKNOWN_LOCATION, op); } +extern tree gimple_build_vector_from_val (gimple_seq *, location_t, tree, + tree); +inline tree +gimple_build_vector_from_val (gimple_seq *seq, tree type, tree op) +{ + return gimple_build_vector_from_val (seq, UNKNOWN_LOCATION, type, op); +} + +extern tree gimple_build_vector (gimple_seq *, location_t, tree, vec<tree>); +inline tree +gimple_build_vector (gimple_seq *seq, tree type, vec<tree> elts) +{ + return gimple_build_vector (seq, UNKNOWN_LOCATION, type, elts); +} + extern bool gimple_stmt_nonnegative_warnv_p (gimple *, bool *, int = 0); extern bool gimple_stmt_integer_valued_real_p (gimple *, int = 0); |