public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60117] New: simd reduction clause suppresses simd auto-vectorization when -fopenmp is set
@ 2014-02-08 16:15 tprince at computer dot org
  2014-02-08 16:16 ` [Bug c/60117] " tprince at computer dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tprince at computer dot org @ 2014-02-08 16:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60117
           Summary: simd reduction clause suppresses simd
                    auto-vectorization when -fopenmp is set
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tprince at computer dot org

Created attachment 32082
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32082&action=edit
source code reproducer

gcc version 4.9.0 20140203
gcc -O2 -ftree-vectorize -std=c99 -march=core-avx2 -fopt-info -S -fopenmp
s314.c
This uses vmaxss instruction in the main loop body, in spite of the fairly
positive vectorization report.
-O3 makes no significant difference, so -O2 is used in practice for stability
elsewhere in gcc source code.
If the omp simd is disabled by removing -fopenmp, excellent code is produced
using vmaxps.  Performance test shows 10x speedup with max-unroll-times=2.


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

* [Bug c/60117] simd reduction clause suppresses simd auto-vectorization when -fopenmp is set
  2014-02-08 16:15 [Bug c/60117] New: simd reduction clause suppresses simd auto-vectorization when -fopenmp is set tprince at computer dot org
@ 2014-02-08 16:16 ` tprince at computer dot org
  2014-02-08 16:17 ` tprince at computer dot org
  2014-02-10  8:34 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: tprince at computer dot org @ 2014-02-08 16:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from tprince at computer dot org ---
Created attachment 32083
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32083&action=edit
f2c style include file


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

* [Bug c/60117] simd reduction clause suppresses simd auto-vectorization when -fopenmp is set
  2014-02-08 16:15 [Bug c/60117] New: simd reduction clause suppresses simd auto-vectorization when -fopenmp is set tprince at computer dot org
  2014-02-08 16:16 ` [Bug c/60117] " tprince at computer dot org
@ 2014-02-08 16:17 ` tprince at computer dot org
  2014-02-10  8:34 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: tprince at computer dot org @ 2014-02-08 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from tprince at computer dot org ---
Jakub Jelinek requested this PR filing


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

* [Bug c/60117] simd reduction clause suppresses simd auto-vectorization when -fopenmp is set
  2014-02-08 16:15 [Bug c/60117] New: simd reduction clause suppresses simd auto-vectorization when -fopenmp is set tprince at computer dot org
  2014-02-08 16:16 ` [Bug c/60117] " tprince at computer dot org
  2014-02-08 16:17 ` tprince at computer dot org
@ 2014-02-10  8:34 ` jakub at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-02-10  8:34 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If the inner loop body is written as
x = a[i__] > x ? a[i__] : x;
then we actually do vectorize with -Ofast -fopenmp-simd, but for some reason
the vectorized loop is optimized away as dead later on.
For vectorization of the original loop, not sure if we can safely transform omp
simd array conditional stores into unconditional read + conditional operation +
unconditional store, or if we should (and why don't we) transform those into
MASK_STORE.


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

end of thread, other threads:[~2014-02-10  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-08 16:15 [Bug c/60117] New: simd reduction clause suppresses simd auto-vectorization when -fopenmp is set tprince at computer dot org
2014-02-08 16:16 ` [Bug c/60117] " tprince at computer dot org
2014-02-08 16:17 ` tprince at computer dot org
2014-02-10  8:34 ` jakub 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).