public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/66036] New: strided group loads are not vectorized
@ 2015-05-06 12:41 rguenth at gcc dot gnu.org
  2015-05-06 12:41 ` [Bug tree-optimization/66036] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-06 12:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66036

            Bug ID: 66036
           Summary: strided group loads are not vectorized
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

For example

struct Xd {
    double x;
    double y;
};
double testd (struct Xd *x, int stride, int n)
{
  int i;
  double sum = 0.;
  for (i = 0; i < n; ++i)
    { 
      sum += x[i*stride].x;
      sum += x[i*stride].y;
    }
  return sum;
}

or similar cases without reduction (simple case)

int testi (int *p, short *q, int stride, int n)
{
  int i;
  for (i = 0; i < n; ++i)
    {
      q[i*4+0] = p[i*stride+0];
      q[i*4+1] = p[i*stride+1];
      q[i*4+2] = p[i*stride+2];
      q[i*4+3] = p[i*stride+3];
    }
}

or the more complex case

int testi2 (int *q, short *p, int stride, int n)
{
  int i;
  for (i = 0; i < n; ++i)
    {
      q[i*4+0] = p[i*stride+0];
      q[i*4+1] = p[i*stride+1];
      q[i*4+2] = p[i*stride+2];
      q[i*4+3] = p[i*stride+3];
    }
}

because here the SLP group has smaller-than-vector size and thus requires
two "scalar" loads and a vector build from them (x86_64 movhlps/movulps).
The more complex form happens in SPEC CPUv6.


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

end of thread, other threads:[~2015-05-08 15:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06 12:41 [Bug tree-optimization/66036] New: strided group loads are not vectorized rguenth at gcc dot gnu.org
2015-05-06 12:41 ` [Bug tree-optimization/66036] " rguenth at gcc dot gnu.org
2015-05-06 12:42 ` rguenth at gcc dot gnu.org
2015-05-08 15:14 ` rguenth at gcc dot gnu.org
2015-05-08 15:14 ` rguenth 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).