r255740 - in /trunk/gcc: ChangeLog cfgexpand.c ...

rsandifo@gcc.gnu.org rsandifo@gcc.gnu.org
Sat Dec 16 14:03:00 GMT 2017


Author: rsandifo
Date: Sat Dec 16 14:03:30 2017
New Revision: 255740

URL: https://gcc.gnu.org/viewcvs?rev=255740&root=gcc&view=rev
Log:
Add VEC_DUPLICATE_EXPR and associated optab

SVE needs a way of broadcasting a scalar to a variable-length vector.
This patch adds VEC_DUPLICATE_EXPR for when CONSTRUCTOR would be used
for fixed-length vectors; this is the tree equivalent of the existing
rtl code VEC_DUPLICATE.

The patch also adds a vec_duplicate_optab to go with VEC_DUPLICATE_EXPR.

2017-12-16  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hawyard@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* doc/generic.texi (VEC_DUPLICATE_EXPR): Document.
	(VEC_COND_EXPR): Add missing @tindex.
	* doc/md.texi (vec_duplicate@var{m}): Document.
	* tree.def (VEC_DUPLICATE_EXPR): New tree codes.
	* tree.c (build_vector_from_val): Add stubbed-out handling of
	variable-length vectors, using VEC_DUPLICATE_EXPR.
	(uniform_vector_p): Handle VEC_DUPLICATE_EXPR.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* tree-cfg.c (verify_gimple_assign_unary): Likewise.
	* tree-inline.c (estimate_operator_cost): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree-vect-generic.c (ssa_uniform_vector_p): Likewise.
	* fold-const.c (const_unop): Fold VEC_DUPLICATE_EXPRs of a constant.
	(test_vec_duplicate_folding): New function.
	(fold_const_c_tests): Call it.
	* optabs.def (vec_duplicate_optab): New optab.
	* optabs-tree.c (optab_for_tree_code): Handle VEC_DUPLICATE_EXPR.
	* optabs.h (expand_vector_broadcast): Declare.
	* optabs.c (expand_vector_broadcast): Make non-static.  Try using
	vec_duplicate_optab.
	* expr.c (store_constructor): Try using vec_duplicate_optab for
	uniform vectors.
	(expand_expr_real_2): Handle VEC_DUPLICATE_EXPR.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgexpand.c
    trunk/gcc/doc/generic.texi
    trunk/gcc/doc/md.texi
    trunk/gcc/expr.c
    trunk/gcc/fold-const.c
    trunk/gcc/optabs-tree.c
    trunk/gcc/optabs.c
    trunk/gcc/optabs.def
    trunk/gcc/optabs.h
    trunk/gcc/tree-cfg.c
    trunk/gcc/tree-inline.c
    trunk/gcc/tree-pretty-print.c
    trunk/gcc/tree-vect-generic.c
    trunk/gcc/tree.c
    trunk/gcc/tree.def



More information about the Gcc-cvs mailing list