https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126099
--- Comment #6 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:adc20f13b60f90c6a55d46fc6be37dfb9f4b86a0 commit r17-3222-gadc20f13b60f90c6a55d46fc6be37dfb9f4b86a0 Author: Richard Biener <[email protected]> Date: Mon Aug 3 19:54:47 2026 +0200 tree-optimization/126099 - SLP subgraph merging with low/highpart extracts The following implements merging of SLP subgraphs that overlap in their vectors low or highparts or in full vector copies using VEC_PERM SLP nodes which know how to perform these extractions, but not more in general. The operation is to build a reverse mapping of scalar stmt to SLP node for possible extraction starts - without knowing the extraction vector type that's even lanes of SLP nodes with an even number of lanes. And then for each SLP node lane zero checking whether it's fully contained in one of the candidates with the restrictions implied by vectorizable_slp_permutation. The motivating testcase is in PR126053 coming from 508.namd_r. The testcases gcc.dg/vect/bb-slp-pr126099-{4,5}.c are cases where schedule verification strips one of the graph entries as subgraph merging otherwise causes SSA verification failures. PR tree-optimization/126099 PR tree-optimization/126053 * tree-vect-slp.cc (vect_cse_gather_part_starts): New function. (vect_cse_slp_node_parts): Likewise. (vect_optimize_slp): For BB SLP CSE to low/highparts of other nodes. * gcc.dg/vect/bb-slp-pr126099-1.c: New testcase. * gcc.dg/vect/bb-slp-pr126099-2.c: Likewise. * gcc.dg/vect/bb-slp-pr126099-3.c: Likewise. * gcc.dg/vect/bb-slp-pr126099-4.c: Likewise. * gcc.dg/vect/bb-slp-pr126099-5.c: Likewise. * gcc.dg/vect/costmodel/x86_64/costmodel-pr126053.c: Likewise.
