public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/50730] New: SLP vectorization confused by unrelated DRs
@ 2011-10-14 13:54 rguenth at gcc dot gnu.org
  2011-10-16  9:42 ` [Bug tree-optimization/50730] " irar at il dot ibm.com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-14 13:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50730

             Bug #: 50730
           Summary: SLP vectorization confused by unrelated DRs
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
                CC: irar@gcc.gnu.org


The SLP vectorizer is confused by the aggregate store in

typedef __complex__ float Value;
struct A {
  Value a[16 / sizeof (Value)];
} __attribute__ ((aligned(16)));

A sum(A a, A b)
{
  a.a[0]+=b.a[0];
  a.a[1]+=b.a[1];
  return a;
}

when built with -O3 -fno-tree-sra:

<bb 2>:
  D.2130_11 = REALPART_EXPR <a.a[0]>;
  D.2131_12 = IMAGPART_EXPR <a.a[0]>;
  D.2132_13 = REALPART_EXPR <b.a[0]>;
  D.2133_14 = IMAGPART_EXPR <b.a[0]>;
  D.2134_15 = D.2130_11 + D.2132_13;
  D.2135_16 = D.2131_12 + D.2133_14;
  REALPART_EXPR <a.a[0]> = D.2134_15;
  IMAGPART_EXPR <a.a[0]> = D.2135_16;
  D.2136_17 = REALPART_EXPR <a.a[1]>;
  D.2137_18 = IMAGPART_EXPR <a.a[1]>;
  D.2138_19 = REALPART_EXPR <b.a[1]>;
  D.2139_20 = IMAGPART_EXPR <b.a[1]>;
  D.2140_21 = D.2136_17 + D.2138_19;
  D.2141_22 = D.2137_18 + D.2139_20;
  REALPART_EXPR <a.a[1]> = D.2140_21;
  IMAGPART_EXPR <a.a[1]> = D.2141_22;
  D.2119 = a;
  return D.2119;

but I don't see why SLP couldn't simply stop analyzing the BB when
it encounters a DR that it cannot build or handle.  The
previous instructions can be still vectorized.

If you put an unrelated volatile store at the end of any sequence
in a bb-slp testcase this reproduces as well.  The above testcase
will probably fail due to unsupported strided stores.


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

end of thread, other threads:[~2011-11-04 12:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-14 13:54 [Bug tree-optimization/50730] New: SLP vectorization confused by unrelated DRs rguenth at gcc dot gnu.org
2011-10-16  9:42 ` [Bug tree-optimization/50730] " irar at il dot ibm.com
2011-10-16 12:24 ` paolo.carlini at oracle dot com
2011-10-22 12:10 ` irar at il dot ibm.com
2011-10-24  9:17 ` irar at gcc dot gnu.org
2011-11-03  8:50 ` irar at il dot ibm.com
2011-11-04 12:56 ` irar 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).