public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99728] New: code pessimization when using wrapper classes around SIMD types
@ 2021-03-23 13:22 martin@mpa-garching.mpg.de
  2021-03-23 13:23 ` [Bug c++/99728] " martin@mpa-garching.mpg.de
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: martin@mpa-garching.mpg.de @ 2021-03-23 13:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99728
           Summary: code pessimization when using wrapper classes around
                    SIMD types
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: martin@mpa-garching.mpg.de
  Target Milestone: ---

Created attachment 50456
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50456&action=edit
test case

I originally reported this at
https://gcc.gnu.org/pipermail/gcc-help/2021-March/139976.html, but I'm now
fairly confident that this warrants a PR.

The test case needs to be processed on x86_64 with the command

g++ -mfma -O3 -std=c++17 -ffast-math -S testcase.cc

Code for two functions will be generated, and I would expect that the generated
assembler for both should be identical. However, for the version using the
wrapper class around __m256d, g++ does not seem to recognize the dead stores at
the end of the loop and leaves them inside the loop body instead of moving them
after the final jump instruction of the loop, which reduces performance
considerably.

clang++ generates nearly identical code for both functions and manages to
remove the dead stores, so I think that g++ might be able to do better here and
is not pessimizing the code due to some C++ intricacies.

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

end of thread, other threads:[~2021-07-14 13:04 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 13:22 [Bug c++/99728] New: code pessimization when using wrapper classes around SIMD types martin@mpa-garching.mpg.de
2021-03-23 13:23 ` [Bug c++/99728] " martin@mpa-garching.mpg.de
2021-03-23 13:50 ` martin@mpa-garching.mpg.de
2021-03-23 13:56 ` amonakov at gcc dot gnu.org
2021-03-23 14:08 ` kretz at kde dot org
2021-03-23 14:28 ` martin@mpa-garching.mpg.de
2021-03-23 14:32 ` kretz at kde dot org
2021-03-23 14:36 ` martin@mpa-garching.mpg.de
2021-03-23 15:00 ` redi at gcc dot gnu.org
2021-03-24  8:52 ` [Bug tree-optimization/99728] " rguenth at gcc dot gnu.org
2021-03-24  9:15 ` kretz at kde dot org
2021-03-24  9:26 ` rguenther at suse dot de
2021-07-02  8:27 ` martin@mpa-garching.mpg.de
2021-07-02  9:52 ` rguenth at gcc dot gnu.org
2021-07-02  9:52 ` rguenth at gcc dot gnu.org
2021-07-02 10:53 ` rguenth at gcc dot gnu.org
2021-07-02 11:55 ` rguenth at gcc dot gnu.org
2021-07-07 11:49 ` cvs-commit at gcc dot gnu.org
2021-07-07 12:09 ` rguenth at gcc dot gnu.org
2021-07-07 13:59 ` rguenth at gcc dot gnu.org
2021-07-14 11:37 ` rguenth at gcc dot gnu.org
2021-07-14 13:04 ` rguenth 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).