Simplify SLP code wrt SLP_TREE_DEF_TYPE
authorRichard Biener <rguenther@suse.de>
Thu, 4 Jun 2020 12:17:21 +0000 (14:17 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 4 Jun 2020 12:38:09 +0000 (14:38 +0200)
commita3a70bf6690e310fb1d4afa4b3dd1b19ddd0e2f4
treed8d99bdbe301c1007e5e81b3285f9f83ddc77cfb
parent43088bb4dadd3d14b6b594c5f9363fe879f3d7f7
Simplify SLP code wrt SLP_TREE_DEF_TYPE

The following removes the ugly pushing of SLP_TREE_DEF_TYPE to
stmt_infos and instead makes sure to handle invariants fully
in vect_is_simple_use plus adjusting a few places I refrained
from touching when enforcing vector types for them.

It also simplifies building SLP nodes with all external operands
from scalars by not doing that in the parent but instead not
building those from the start.  That also gets rid of
vect_update_all_shared_vectypes.

2020-06-04  Richard Biener  <rguenther@suse.de>

* tree-vect-slp.c (vect_update_all_shared_vectypes): Remove.
(vect_build_slp_tree_2): Simplify building all external op
nodes from scalars.
(vect_slp_analyze_node_operations): Remove push/pop of
STMT_VINFO_DEF_TYPE.
(vect_schedule_slp_instance): Likewise.
* tree-vect-stmts.c (ect_check_store_rhs): Pass in the
stmt_info, use the vect_is_simple_use overload combining
SLP and stmt_info analysis.
(vect_is_simple_cond): Likewise.
(vectorizable_store): Adjust.
(vectorizable_condition): Likewise.
(vect_is_simple_use): Fully handle invariant SLP nodes
here.  Amend stmt_info operand extraction with COND_EXPR
and masked stores.
* tree-vect-loop.c (vectorizable_reduction): Deal with
COND_EXPR representation ugliness.
gcc/tree-vect-loop.c
gcc/tree-vect-slp.c
gcc/tree-vect-stmts.c