]> git.ipfire.org Git - thirdparty/gcc.git/commit
Allow SLP store of mixed external and constant
authorRichard Biener <rguenther@suse.de>
Wed, 9 Oct 2024 13:31:59 +0000 (15:31 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 10 Oct 2024 07:00:07 +0000 (09:00 +0200)
commitbcccc3221b838ee7ae7848e7194603acb18294b3
treeaccc367571f627cdd2b3c8bf12302ccf80a8acdf
parent9eaecce3d8c1d9349adbf8c2cdaf8d87672ed29c
Allow SLP store of mixed external and constant

vect_build_slp_tree_1 rejected this during SLP discovery because it
ran into the rhs code comparison code for stores.  The following
skips that completely for loads and stores as those are handled
later anyway.

This needs a heuristic adjustment in vect_get_and_check_slp_defs
to avoid fallout with regard to BB vectorization and splitting
of a store group vs. demoting one operand to external.

gcc.dg/Wstringop-overflow-47.c needs adjustment given we now have
vast improvements for code generation.  gcc.dg/strlenopt-32.c
needs adjustment because the strlen pass doesn't handle

  _11 = {0, b_6(D)};
  __builtin_memcpy (&a, "foo.bar", 8);
  MEM <vector(2) char> [(char *)&a + 3B] = _11;
  _9 = strlen (&a);

I have opened PR117057 for this.

* tree-vect-slp.cc (vect_build_slp_tree_1): Do not compare
RHS codes for loads or stores.
(vect_get_and_check_slp_defs): Only demote operand to external
in case there is more than one operand.

* gcc.dg/vect/slp-57.c: New testcase.
* gcc.dg/Wstringop-overflow-47.c: Adjust.
* gcc.dg/strlenopt-32.c: XFAIL parts.
gcc/testsuite/gcc.dg/Wstringop-overflow-47.c
gcc/testsuite/gcc.dg/strlenopt-32.c
gcc/testsuite/gcc.dg/vect/slp-57.c [new file with mode: 0644]
gcc/tree-vect-slp.cc