public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/60012] New: Vectorizer generates unnecessary loop versioning for alias
@ 2014-01-31 17:18 bmei at broadcom dot com
  2014-02-03 14:44 ` [Bug tree-optimization/60012] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bmei at broadcom dot com @ 2014-01-31 17:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60012
           Summary: Vectorizer generates unnecessary loop versioning for
                    alias
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bmei at broadcom dot com

typedef struct
{
   short real;
   short imag;
} complex16_t;

void
libvector_AccSquareNorm_ref (unsigned long long  *acc,
                             const complex16_t *x, unsigned len)
{
    for (unsigned i = 0; i < len; i++)
    {
        acc[i] +=
            ((unsigned long long)((int)x[i].real * x[i].real)) +
            ((unsigned long long)((int)x[i].imag * x[i].imag));
    }
}

Compiler the code with 
~/scratch/install-x86/bin/gcc tst.c -O2 -S -ftree-vectorize
-fdump-tree-vect-details -std=c99

GCC generates unnecessary loop versioning because it cannot disambiguate mem
accesses. 

tst.c:12:5: note: versioning for alias required: can't determine dependence
between *_8 and _12->real
tst.c:12:5: note: mark for run-time aliasing test between *_8 and _12->real

This should be handled by TBAA info as acc & x clearly point to different data
types. But unfortunately, TBAA doesn't handle Anti- & Output- dependencies.


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

* [Bug tree-optimization/60012] Vectorizer generates unnecessary loop versioning for alias
  2014-01-31 17:18 [Bug tree-optimization/60012] New: Vectorizer generates unnecessary loop versioning for alias bmei at broadcom dot com
@ 2014-02-03 14:44 ` rguenth at gcc dot gnu.org
  2014-02-04  9:35 ` rguenth at gcc dot gnu.org
  2014-02-04  9:35 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-02-03 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-02-03
           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] 4+ messages in thread

* [Bug tree-optimization/60012] Vectorizer generates unnecessary loop versioning for alias
  2014-01-31 17:18 [Bug tree-optimization/60012] New: Vectorizer generates unnecessary loop versioning for alias bmei at broadcom dot com
  2014-02-03 14:44 ` [Bug tree-optimization/60012] " rguenth at gcc dot gnu.org
@ 2014-02-04  9:35 ` rguenth at gcc dot gnu.org
  2014-02-04  9:35 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-02-04  9:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Feb  4 09:34:58 2014
New Revision: 207455

URL: http://gcc.gnu.org/viewcvs?rev=207455&root=gcc&view=rev
Log:
2014-02-04  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/60012
    * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Apply
    TBAA disambiguation to all DDRs.

    * gcc.dg/vect/pr60012.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr60012.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-data-refs.c


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

* [Bug tree-optimization/60012] Vectorizer generates unnecessary loop versioning for alias
  2014-01-31 17:18 [Bug tree-optimization/60012] New: Vectorizer generates unnecessary loop versioning for alias bmei at broadcom dot com
  2014-02-03 14:44 ` [Bug tree-optimization/60012] " rguenth at gcc dot gnu.org
  2014-02-04  9:35 ` rguenth at gcc dot gnu.org
@ 2014-02-04  9:35 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-02-04  9:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |4.9.0
         Resolution|---                         |FIXED

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed for 4.9.


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

end of thread, other threads:[~2014-02-04  9:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-31 17:18 [Bug tree-optimization/60012] New: Vectorizer generates unnecessary loop versioning for alias bmei at broadcom dot com
2014-02-03 14:44 ` [Bug tree-optimization/60012] " rguenth at gcc dot gnu.org
2014-02-04  9:35 ` rguenth at gcc dot gnu.org
2014-02-04  9:35 ` 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).