https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126383
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:d20adcae36e31cb96a9869566a243e3d6f21ab8d commit r17-2684-gd20adcae36e31cb96a9869566a243e3d6f21ab8d Author: Richard Biener <[email protected]> Date: Tue Jul 21 15:10:24 2026 +0200 target/126328 - [x86] insn_cost of *sse3_h{add,sub}v2df3[_low] I run into issues with gcc.target/i386/pr54400.c when SLP vectorizing a horizontal reduction of a V2DF vector. The following plugs the remaining hole in costing which prevents combine from doing its work to recover the single hadd instruction for { p[0] + p[1], q[0] + q[1] } The patch avoids the pattern cost special-casing of vec_concat by costing the insn based on a new cost_special attribute which I placed on all of the haddsub patterns. PR target/126328 PR target/126383 * config/i386/i386.md (cost_special): New attribute. * config/i386/sse.md (avx_h<insn>v4df3): Add cost_special attribute with value haddsub. (*sse3_haddv2df3): Likewise. (sse3_hsubv2df3): Likewise. (*sse3_haddv2df3_low): Likewise. (*sse3_hsubv2df3_low): Likewise. (avx_h<insn>v8sf3): Likewise. (sse3_h<insn>v4sf3): Likewise. * config/i386/i386.cc (ix86_insn_cost): Cost insns with the cost_special attribute value of haddsub like an add.
