https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83202
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- Author: rguenth Date: Wed Nov 29 14:38:06 2017 New Revision: 255233 URL: https://gcc.gnu.org/viewcvs?rev=255233&root=gcc&view=rev Log: 2017-11-29 Richard Biener <rguent...@suse.de> PR tree-optimization/83202 * tree-vect-slp.c (scalar_stmts_set_t): New typedef. (bst_fail): Use it. (vect_analyze_slp_cost_1): Add visited set, do not account SLP nodes vectorized to the same stmts multiple times. (vect_analyze_slp_cost): Allocate a visited set and pass it down. (vect_analyze_slp_instance): Adjust. (scalar_stmts_to_slp_tree_map_t): New typedef. (vect_schedule_slp_instance): Add a map recording the SLP node representing the vectorized stmts for a set of scalar stmts. Avoid code-generating redundancies. (vect_schedule_slp): Allocate map and pass it down. * gcc.dg/vect/costmodel/x86_64/costmodel-pr83202.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr83202.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-slp.c