public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/66051] can't vectorize reductions inside an SLP group
  2015-05-07 14:16 [Bug tree-optimization/66051] New: can't vectorize reductions inside an SLP group rguenth at gcc dot gnu.org
@ 2015-05-07 14:16 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-07 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-05-07
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.


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

* [Bug tree-optimization/66051] New: can't vectorize reductions inside an SLP group
@ 2015-05-07 14:16 rguenth at gcc dot gnu.org
  2015-05-07 14:16 ` [Bug tree-optimization/66051] " rguenth at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-05-07 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66051
           Summary: can't vectorize reductions inside an SLP group
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
            Blocks: 53947
  Target Milestone: ---

void foo (int *p, short *q, int n)
{
  int i;
  for (i = 0; i < n; ++i)
    {
      p[i*4+0] = q[i*8+0] + q[i*8+4];
      p[i*4+1] = q[i*8+1] + q[i*8+5];
      p[i*4+2] = q[i*8+2] + q[i*8+6];
      p[i*4+3] = q[i*8+3] + q[i*8+7];
    }
}

is vectorized by unrolling the loop 4 times instead of using SLP because

t3.c:4:3: note: Build SLP for _15 = *_14;

t3.c:4:3: note: Build SLP failed: grouped loads have gaps _15 = *_14;

which isn't the whole story (I don't think we support this kind of
"reductions").  The SLP build runs into two load children, one loading
[0, 3] and one loading [4, 7] of a single group (and thus producing gaps).
Ideally we vectorize this with a single load of [0, 7], shuffle, add
and only unpack the low part.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-07 14:16 [Bug tree-optimization/66051] New: can't vectorize reductions inside an SLP group rguenth at gcc dot gnu.org
2015-05-07 14:16 ` [Bug tree-optimization/66051] " 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).