public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/65492] New: Bad optimization in -O3 on SSE intrinsics
@ 2015-03-20 12:32 linux at carewolf dot com
  2015-03-20 12:40 ` [Bug tree-optimization/65492] " linux at carewolf dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: linux at carewolf dot com @ 2015-03-20 12:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65492

            Bug ID: 65492
           Summary: Bad optimization in -O3 on SSE intrinsics
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: linux at carewolf dot com

After investigating a loop using SSE intrinsics that was significantly faster
in clang than in gcc, I discovered gcc had the same performance as clang in
-O2, and only performed signficantly worse in -O3.

Disabling all the switches mentioned in the documentation as activates by -O3
(or enabling them for -O2), doesn't fully account for the difference, but the
switch -f(no-)tree-loop-vectorize accounts for roughly half of it.

I have attached the files I used to test it. Using gcc -O2 or clang -O2 or -O3,
it times in at 1.8s on my machine. Using g++ (4.9 or 5.0) -O3 it times in at
2.5s. Using -O3 -fno-tree-loop-vectorize it runs in 2.3s, and -O2
-ftree-vectorize at 2.25s.

Using callgrind, it seems the performance difference is mainly spend on the
accessing integers in the vector union.


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

end of thread, other threads:[~2021-08-14 23:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20 12:32 [Bug tree-optimization/65492] New: Bad optimization in -O3 on SSE intrinsics linux at carewolf dot com
2015-03-20 12:40 ` [Bug tree-optimization/65492] " linux at carewolf dot com
2015-03-20 12:41 ` linux at carewolf dot com
2015-03-20 12:49 ` linux at carewolf dot com
2015-03-20 14:31 ` rguenth at gcc dot gnu.org
2015-03-20 14:35 ` rguenth at gcc dot gnu.org
2015-03-20 14:59 ` rguenth at gcc dot gnu.org
2015-03-20 20:40 ` [Bug tree-optimization/65492] Bad optimization in -O3 due to if-conversion and/or unrolling linux at carewolf dot com
2015-03-21  2:09 ` linux at carewolf dot com
2015-03-21 14:05 ` linux at carewolf dot com
2015-03-24 13:08 ` linux at carewolf dot com
2015-03-31 11:25 ` linux at carewolf dot com
2021-08-14 23:12 ` 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).