public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/46008] New: Floating point condexpr not vectorized
@ 2010-10-13 16:07 jakub at gcc dot gnu.org
  2010-10-13 16:19 ` [Bug tree-optimization/46008] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-13 16:07 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Floating point condexpr not vectorized
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: irar@gcc.gnu.org


void bar (double *);
void foo (double *a, double *b, double *c, double *d)
{
  double e[1024], f;
  int i;

  for (i = 0; i < 1024; i++)
    e[i] = (f = a[i] + b[i] + c[i] * d[i]) < 0.0 ? 3.0 : f;
  bar (e);
}

is not vectorized at -O3 (is at -O3 -ffast-math though).
One problem is in ifcvt, which creates bogus dead stmts with bool type, but
even with that fixed the vectorizer gives up.
I'll attach ifcvt fix, is there something that can be done about this on the
vectorizer side?


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

* [Bug tree-optimization/46008] Floating point condexpr not vectorized
  2010-10-13 16:07 [Bug tree-optimization/46008] New: Floating point condexpr not vectorized jakub at gcc dot gnu.org
@ 2010-10-13 16:19 ` jakub at gcc dot gnu.org
  2010-10-14 19:34 ` jakub at gcc dot gnu.org
  2012-03-13 23:27 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-13 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-10-13 16:19:27 UTC ---
Created attachment 22031
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22031
gcc46-pr46008.patch

The ifcvt fix (untested).  Still the vectorizer gives up, because the floating
point comparison is first computed into a _Bool/bool variable which is then
(with a single immediate use) immediately used in the following COND_EXPR.


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

* [Bug tree-optimization/46008] Floating point condexpr not vectorized
  2010-10-13 16:07 [Bug tree-optimization/46008] New: Floating point condexpr not vectorized jakub at gcc dot gnu.org
  2010-10-13 16:19 ` [Bug tree-optimization/46008] " jakub at gcc dot gnu.org
@ 2010-10-14 19:34 ` jakub at gcc dot gnu.org
  2012-03-13 23:27 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-14 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-10-14 19:34:20 UTC ---
Author: jakub
Date: Thu Oct 14 19:34:16 2010
New Revision: 165476

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165476
Log:
    PR tree-optimization/46008
    * tree-if-conv.c (predicate_bbs): Try to canonicalize c2
    if possible.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-if-conv.c


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

* [Bug tree-optimization/46008] Floating point condexpr not vectorized
  2010-10-13 16:07 [Bug tree-optimization/46008] New: Floating point condexpr not vectorized jakub at gcc dot gnu.org
  2010-10-13 16:19 ` [Bug tree-optimization/46008] " jakub at gcc dot gnu.org
  2010-10-14 19:34 ` jakub at gcc dot gnu.org
@ 2012-03-13 23:27 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-03-13 23:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-03-13
     Ever Confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-03-13 23:16:29 UTC ---
I think there was some talk about changing COND_EXPR not to have a comparison
as the first operand.


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

end of thread, other threads:[~2012-03-13 23:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-13 16:07 [Bug tree-optimization/46008] New: Floating point condexpr not vectorized jakub at gcc dot gnu.org
2010-10-13 16:19 ` [Bug tree-optimization/46008] " jakub at gcc dot gnu.org
2010-10-14 19:34 ` jakub at gcc dot gnu.org
2012-03-13 23:27 ` 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).