public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dartdart26 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/101923] std::function's move ctor is slower than the copy one for empty source objects
Date: Tue, 17 Aug 2021 06:09:36 +0000	[thread overview]
Message-ID: <bug-101923-4-pJ0mNg1wgX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101923-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Petar Ivanov <dartdart26 at gmail dot com> ---
(In reply to Andrew Pinski from comment #4)
> Hmm
> 
>   __tmp = MEM[(union _Any_data & {ref-all})&f];
>   MEM[(union _Any_data * {ref-all})&f] = MEM[(union _Any_data &
> {ref-all})&moved];
>   MEM[(union _Any_data * {ref-all})&moved] = __tmp;
>   __tmp ={v} {CLOBBER};
>   _13 = MEM[(void (*type) (const union _Any_data & {ref-all}, const struct
> Car &) &)&f + 24];
>   _14 = MEM[(void (*type) (const union _Any_data & {ref-all}, const struct
> Car &) &)&moved + 24];
>   MEM[(void (*<Te9f8>) (const union _Any_data & {ref-all}, const struct Car
> &) &)&f + 24] = _14;
>   MEM[(void (*<Te9f8>) (const union _Any_data & {ref-all}, const struct Car
> &) &)&moved + 24] = _13;
> 
> So a missed optimization at the gimple level.
> But note the arm64 compiler on godbolt is a few months old, 20210528.  There
> might have been some fixes which improve this already.

I see, thank you.

Do you think the x86 results on quick bench are something worth improving? From
a user's perspective, I assume the expectation is that moves are at least as
fast as copies.

Could you please advise on how I can proceed with this report? Can a change be
made in libstdc++ or should it be considered a compiler issue?

Thank you!

  parent reply	other threads:[~2021-08-17  6:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-15 13:17 [Bug libstdc++/101923] New: " dartdart26 at gmail dot com
2021-08-15 13:38 ` [Bug libstdc++/101923] " dartdart26 at gmail dot com
2021-08-15 17:54 ` nok.raven at gmail dot com
2021-08-16  7:18 ` dartdart26 at gmail dot com
2021-08-16  7:30 ` [Bug tree-optimization/101923] " pinskia at gcc dot gnu.org
2021-08-17  6:09 ` dartdart26 at gmail dot com [this message]
2021-08-17 10:00 ` redi at gcc dot gnu.org
2021-08-17 10:25 ` redi at gcc dot gnu.org
2021-08-17 13:24 ` cvs-commit at gcc dot gnu.org
2021-08-18  6:02 ` dartdart26 at gmail dot com
2021-10-12 10:59 ` cvs-commit at gcc dot gnu.org
2022-12-29 22:14 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101923-4-pJ0mNg1wgX@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).