public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/46032] New: openmp inhibits loop vectorization
@ 2010-10-15  7:23 vincenzo.innocente at cern dot ch
  2010-10-15 10:09 ` [Bug tree-optimization/46032] " rguenth at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2010-10-15  7:23 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: openmp inhibits loop vectorization
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch


The use of openmp to parallelize loop inhibits auto-vectorization.
This defeats all benefits of parallelization making the parallel code slower
than the "sequential one".
Is it foreseen a version of openmp that preserve auto-vectorization?

Example
on
Linux  2.6.18-194.11.3.el5.cve20103081 #1 SMP Thu Sep 16 15:17:10 CEST 2010
x86_64 x86_64 x86_64 GNU/Linux
using
GNU C++ (GCC) version 4.6.0 20100408 (experimental) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.6.0 20100408 (experimental), GMP version 4.3.2,
MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
compiling this simple example
cat openmpvector.cpp
int main()
{

 const unsigned int nEvents = 1000;
 double results[nEvents] = {0};
 double pData[nEvents] = {0};
 double coeff = 12.2;

#pragma omp parallel for
 for (int idx = 0; idx<(int)nEvents; idx++) {
   results[idx] = coeff*pData[idx];
 }

 return resultsCPU[0]; // avoid optimization of "dead" code

}

gives
g++  -O2 -fopenmp -ftree-vectorize -ftree-vectorizer-verbose=7 openmpvector.cpp

openmpvector.cpp:11: note: not vectorized: loop contains function calls or data
references that cannot be analyzed
openmpvector.cpp:9: note: vectorized 0 loops in function.


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

end of thread, other threads:[~2015-05-27  8:43 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-15  7:23 [Bug tree-optimization/46032] New: openmp inhibits loop vectorization vincenzo.innocente at cern dot ch
2010-10-15 10:09 ` [Bug tree-optimization/46032] " rguenth at gcc dot gnu.org
2010-10-15 10:31 ` rguenth at gcc dot gnu.org
2010-10-15 11:52 ` rguenth at gcc dot gnu.org
2010-10-15 12:09 ` rguenth at gcc dot gnu.org
2011-07-26 13:00 ` vincenzo.innocente at cern dot ch
2011-07-26 13:48 ` paolo.carlini at oracle dot com
2012-07-06 16:18 ` fchen0000 at gmail dot com
2014-04-29 13:39 ` dominiq at lps dot ens.fr
2014-08-18 13:56 ` vries at gcc dot gnu.org
2015-05-24  9:33 ` vries at gcc dot gnu.org
2015-05-26 12:25 ` rguenth at gcc dot gnu.org
2015-05-26 12:29 ` rguenth at gcc dot gnu.org
2015-05-26 13:54 ` jakub at gcc dot gnu.org
2015-05-26 13:59 ` jakub at gcc dot gnu.org
2015-05-26 16:39 ` vries at gcc dot gnu.org
2015-05-27  8:12 ` rguenth at gcc dot gnu.org
2015-05-27  8:20 ` jakub at gcc dot gnu.org
2015-05-27  8:43 ` rguenther at suse dot de

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).