r255477 - in /trunk/gcc: ChangeLog fold-const.c...

rsandifo@gcc.gnu.org rsandifo@gcc.gnu.org
Thu Dec 7 18:41:00 GMT 2017


Author: rsandifo
Date: Thu Dec  7 18:41:35 2017
New Revision: 255477

URL: https://gcc.gnu.org/viewcvs?rev=255477&root=gcc&view=rev
Log:
Use tree_vector_builder::new_binary_operation for folding

This patch makes fold-const.c operate directly on the VECTOR_CST
encoding when folding an operation that has two VECTOR_CST inputs.

2017-12-07  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-vector-builder.h
	(tree_vector_builder::new_binary_operation): Declare.
	* tree-vector-builder.c
	(tree_vector_builder::new_binary_operation): New function.
	* fold-const.c (fold_relational_const): Use it.
	(const_binop): Likewise.  Check that both input vectors have
	the same number of elements, thus excluding things like WIDEN_SUM.
	Check whether it is possible to operate directly on the encodings
	of stepped inputs.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/tree-vector-builder.c
    trunk/gcc/tree-vector-builder.h



More information about the Gcc-cvs mailing list