Code generate externals/invariants during the SLP graph walk
authorRichard Biener <rguenther@suse.de>
Wed, 27 May 2020 13:38:20 +0000 (15:38 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 28 May 2020 10:25:15 +0000 (12:25 +0200)
commite31cd607e999ca6ab47b7e65a7045b1594e4fba4
tree7b6da4b9226701de481deca383dee0d735609aca
parentb0aae85bd689cf581ac85d02a7e84eae0015dbe5
Code generate externals/invariants during the SLP graph walk

This generates vector defs for externals and invariants during the SLP
walk rather than as part of getting vectorized defs when vectorizing
the users.  This is a requirement to make sharing of external/invariant
nodes be reflected in actual code generation.

This temporarily adds a SLP_TREE_VEC_DEFS vector alongside the
SLP_TREE_VEC_STMTS one.  Eventually the latter can go away.

2020-05-27  Richard Biener  <rguenther@suse.de>

* tree-vectorizer.h (_slp_tree::vec_defs): Add.
(SLP_TREE_VEC_DEFS): Likewise.
* tree-vect-slp.c (_slp_tree::_slp_tree): Adjust.
(_slp_tree::~_slp_tree): Likewise.
(vect_mask_constant_operand_p): Remove unused function.
(vect_get_constant_vectors): Rename to...
(vect_create_constant_vectors): ... this.  Take the
invariant node as argument and code generate it.  Remove
dead code, remove temporary asserts.  Pass a NULL stmt_info
to vect_init_vector.
(vect_get_slp_defs): Simplify.
(vect_schedule_slp_instance): Code-generate externals and
invariants using vect_create_constant_vectors.
gcc/tree-vect-slp.c
gcc/tree-vectorizer.h