https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95309
Bug ID: 95309 Summary: [11 Regression] Many targets failing ssa-dom-cse-2.c after vectorizer changes Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: law at redhat dot com Target Milestone: --- Various ports have regressed the tree-ssa/ssa-dom-cse-2.c after this change: commit a4b48fc47c3406b6f41be093c4615879b7006710 Author: Richard Biener <rguent...@suse.de> Date: Mon May 18 16:05:00 2020 +0200 cost invariant nodes from vect_slp_analyze_node_operations SLP walk 2020-05-19 Richard Biener <rguent...@suse.de> * tree-vectorizer.h (_slp_tree::vectype): Add field. (SLP_TREE_VECTYPE): New. * tree-vect-slp.c (vect_create_new_slp_node): Initialize SLP_TREE_VECTYPE. (vect_create_new_slp_node): Likewise. (vect_prologue_cost_for_slp): Move here from tree-vect-stmts.c and simplify. (vect_slp_analyze_node_operations): Walk nodes children for invariant costing. (vect_get_constant_vectors): Use local scope op variable. * tree-vect-stmts.c (vect_prologue_cost_for_slp_op): Remove here. (vect_model_simple_cost): Adjust. (vect_model_store_cost): Likewise. (vectorizable_store): Likewise. You should be able to see this on the iq2000-elf port (and many others). I believe the test is supposed to verify that we're able to determine the return value statically after unrolling the loop. It's unclear if the stores get in the way of cse-ing the assignment to _22 and _29 in the dump or if there's something else going on: MEM[(int *)&a] = { 0 }; MEM[(int *)&a + 4B] = { 1 }; MEM[(int *)&a + 8B] = { 2 }; MEM[(int *)&a + 12B] = { 3 }; MEM[(int *)&a + 16B] = { 4 }; MEM[(int *)&a + 20B] = { 5 }; MEM[(int *)&a + 24B] = { 6 }; MEM[(int *)&a + 28B] = { 7 }; _22 = a[0]; _29 = a[1]; sum_30 = _22 + _29; _36 = a[2]; sum_37 = sum_30 + _36; _43 = a[3]; sum_44 = sum_37 + _43; _50 = a[4]; sum_51 = sum_44 + _50; _57 = a[5]; sum_58 = sum_51 + _57; _64 = a[6]; sum_65 = sum_58 + _64; _1 = a[7]; sum_16 = _1 + sum_65; a ={v} {CLOBBER}; return sum_16;