https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107412
Bug ID: 107412 Summary: Miss to fold LEN_{LOAD,STORE} when the specified length equal to vector length Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: linkw at gcc dot gnu.org Target Milestone: --- test case: === #define N 16 int src[N]; int dest[N]; void foo (){ for (int i = 0; i < (N-1); i++) dest[i] = src[i]; } === Options: -mcpu=power10 -fno-tree-loop-distribute-patterns --param vect-partial-vector-usage=2 -O2 -ftree-vectorize -funroll-loops -fno-vect-cost-model optimized gimple output: void foo () { vector(16) unsigned char vect_2; vector(16) unsigned char vect_13; vector(16) unsigned char vect_34; vector(16) unsigned char vect_47; <bb 2> [local count: 67108864]: vect_2 = .LEN_LOAD (&src, 128B, 16, 0); .LEN_STORE (&dest, 128B, 16, vect_2, 0); vect_34 = .LEN_LOAD (&MEM <int[16]> [(void *)&src + 16B], 128B, 16, 0); .LEN_STORE (&MEM <int[16]> [(void *)&dest + 16B], 128B, 16, vect_34, 0); vect_47 = .LEN_LOAD (&MEM <int[16]> [(void *)&src + 32B], 128B, 16, 0); .LEN_STORE (&MEM <int[16]> [(void *)&dest + 32B], 128B, 16, vect_47, 0); vect_13 = .LEN_LOAD (&MEM <int[16]> [(void *)&src + 48B], 128B, 12, 0); .LEN_STORE (&MEM <int[16]> [(void *)&dest + 48B], 128B, 12, vect_13, 0); [tail call] return; } It's expected that we only have one separated .LEN_LOAD and .LEN_STORE with length 12, the others can adopt just normal vector load/store.