public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/107412] New: Miss to fold LEN_{LOAD,STORE} when the specified length equal to vector length
@ 2022-10-26  9:13 linkw at gcc dot gnu.org
  2022-10-26  9:15 ` [Bug tree-optimization/107412] " linkw at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: linkw at gcc dot gnu.org @ 2022-10-26  9:13 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-05  5:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26  9:13 [Bug tree-optimization/107412] New: Miss to fold LEN_{LOAD,STORE} when the specified length equal to vector length linkw at gcc dot gnu.org
2022-10-26  9:15 ` [Bug tree-optimization/107412] " linkw at gcc dot gnu.org
2022-10-27 22:03 ` segher at gcc dot gnu.org
2022-10-31  6:39 ` linkw at gcc dot gnu.org
2022-11-07  8:17 ` cvs-commit at gcc dot gnu.org
2022-11-07  8:25 ` linkw at gcc dot gnu.org
2022-11-07  8:25 ` linkw at gcc dot gnu.org
2022-12-05  5:28 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).