public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/49773] New: use of class data members prevent vectorization
@ 2011-07-18  7:19 vincenzo.innocente at cern dot ch
  2011-07-18 14:11 ` [Bug tree-optimization/49773] " vincenzo.innocente at cern dot ch
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2011-07-18  7:19 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: use of class data members prevent vectorization
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch


in this example below the loop in the first method does not vectorize, the
second does.


struct Foo {
  float a;
  float b;

  void compute1(float * __restrict__ x, float const * __restrict__ y, int N)
const;
  void compute2(float * __restrict__ x, float const * __restrict__ y, int N)
const;

};

void Foo::compute1(float * __restrict__ x, float const * __restrict__ y, int N)
const {
  for (int i=0; i!=N; ++i)
    x[i] = a + b*y[i];
}

void Foo::compute2(float * __restrict__ x, float const * __restrict__ y, int N)
const {
  float la=a, lb=b;
  for (int i=0; i!=N; ++i)
    x[i] = la + lb*y[i];
}


test/vectClass.cpp:11: note: not vectorized: loop contains function calls or
data references that cannot be analyzed
test/vectClass.cpp:10: note: vectorized 0 loops in function.
vs

test/vectClass.cpp:17: note: Profitability threshold is 5 loop iterations.
test/vectClass.cpp:17: note: LOOP VECTORIZED.
test/vectClass.cpp:15: note: vectorized 1 loops in function.


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

* [Bug tree-optimization/49773] use of class data members prevent vectorization
  2011-07-18  7:19 [Bug tree-optimization/49773] New: use of class data members prevent vectorization vincenzo.innocente at cern dot ch
@ 2011-07-18 14:11 ` vincenzo.innocente at cern dot ch
  2021-07-21  2:45 ` pinskia at gcc dot gnu.org
  2023-08-05  1:40 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2011-07-18 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2011-07-18 14:11:11 UTC ---
I just upgraded to

c++ -v
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin10.8.0/4.7.0/lto-wrapper
Target: x86_64-apple-darwin10.8.0
Configured with: ./configure --enable-languages=c,c++,fortran --enable-lto
--with-build-config=bootstrap-lto CFLAGS='-O2 -ftree-vectorize -fPIC'
CXXFLAGS='-O2 -fPIC -ftree-vectorize -fvisibility-inlines-hidden'
Thread model: posix
gcc version 4.7.0 20110716 (experimental) (GCC) 

and it seem to vectorize fine…
was stil not ok in gcc version 4.7.0 20110702 (experimental) (GCC) 


it still pretends to check for
test/vectClass.cpp:11: note: Detected interleaving this_9(D)->a and
this_9(D)->b
test/vectClass.cpp:11: note: versioning for alias required: can't determine
dependence between this_9(D)->a and *D.1537_8
test/vectClass.cpp:11: note: mark for run-time aliasing test between
this_9(D)->a and *D.1537_8
test/vectClass.cpp:11: note: versioning for alias required: can't determine
dependence between this_9(D)->b and *D.1537_8
test/vectClass.cpp:11: note: mark for run-time aliasing test between
this_9(D)->b and *D.1537_8

I hope it will be addressed in PR49774


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

* [Bug tree-optimization/49773] use of class data members prevent vectorization
  2011-07-18  7:19 [Bug tree-optimization/49773] New: use of class data members prevent vectorization vincenzo.innocente at cern dot ch
  2011-07-18 14:11 ` [Bug tree-optimization/49773] " vincenzo.innocente at cern dot ch
@ 2021-07-21  2:45 ` pinskia at gcc dot gnu.org
  2023-08-05  1:40 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21  2:45 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Blocks|                            |53947
           Keywords|                            |missed-optimization


Referenced Bugs:

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

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

* [Bug tree-optimization/49773] use of class data members prevent vectorization
  2011-07-18  7:19 [Bug tree-optimization/49773] New: use of class data members prevent vectorization vincenzo.innocente at cern dot ch
  2011-07-18 14:11 ` [Bug tree-optimization/49773] " vincenzo.innocente at cern dot ch
  2021-07-21  2:45 ` pinskia at gcc dot gnu.org
@ 2023-08-05  1:40 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-05  1:40 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |6.0
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
starting in GCC 6 can do it without aliasing checks.
Starting in GCC 8, the prologue code has improved.

So we can close this as fixed in GCC 6 really.

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

end of thread, other threads:[~2023-08-05  1:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-18  7:19 [Bug tree-optimization/49773] New: use of class data members prevent vectorization vincenzo.innocente at cern dot ch
2011-07-18 14:11 ` [Bug tree-optimization/49773] " vincenzo.innocente at cern dot ch
2021-07-21  2:45 ` pinskia at gcc dot gnu.org
2023-08-05  1:40 ` pinskia 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).