public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vincenzo.innocente at cern dot ch" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/46032] New: openmp inhibits loop vectorization Date: Fri, 15 Oct 2010 07:23:00 -0000 [thread overview] Message-ID: <bug-46032-4@http.gcc.gnu.org/bugzilla/> (raw) 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.
next reply other threads:[~2010-10-15 7:23 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-10-15 7:23 vincenzo.innocente at cern dot ch [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-46032-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).