From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22670 invoked by alias); 21 Oct 2013 07:44:25 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22626 invoked by uid 48); 21 Oct 2013 07:44:20 -0000 From: "vincenzo.innocente at cern dot ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/58821] New: conditional reduction does not vectorize Date: Mon, 21 Oct 2013 07:44:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincenzo.innocente at cern dot ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-10/txt/msg01442.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58821 Bug ID: 58821 Summary: conditional reduction does not vectorize Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vincenzo.innocente at cern dot ch in the following foo vectorize bar does not (bar does not vectorize even for if (x[i]>0) s+=x[i]; ) compiled as c++ -Ofast -fopt-info-loop -S condRed.cc -fopenmp -ftree-loop-if-convert-stores -march=core-avx2 gcc version 4.9.0 20131011 (experimental) [trunk revision 203426] (GCC) neither #pragma omp simd reduction(+:s) nor #pragma ivdep helps const int N=1024; float x[N], y[N]; float bar() { float s=0; for (int i=0; i0) s+=y[i]; return s; } float foo() { float s=0; for (int i=0; i0) ?y[i] : 0; return s; } float barOMP() { float s=0; #pragma omp simd reduction(+:s) for (int i=0; i0) s+=y[i]; return s; } float fooOMP() { float s=0; #pragma omp simd reduction(+:s) for (int i=0; i0) ?y[i] : 0; return s; } float barIVDEP() { float s=0; #pragma ivdep for (int i=0; i0) s+=y[i]; return s; }