public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110289] New: Phiprop may be good idea in early opts
@ 2023-06-16 14:50 hubicka at gcc dot gnu.org
  2023-06-16 14:59 ` [Bug tree-optimization/110289] " hubicka at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hubicka at gcc dot gnu.org @ 2023-06-16 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110289
           Summary: Phiprop may be good idea in early opts
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
  Target Milestone: ---

libstdc++ in push_back operation does equivalent of the following:

int max(int a, int b)
{
        int *ptr;
        if (a > b)
          ptr = &a;
        else
          ptr = &b;
        return *ptr;
}

this is a sily implementation of max operation that sadly is not optimized
until late phiprop pass and confuses inlining heuristics: memory load is
considered to be expensive.

I think this is win-win pass and not very expensive, so perhaps adding it to
early opts is possible?

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

end of thread, other threads:[~2023-06-23 16:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16 14:50 [Bug tree-optimization/110289] New: Phiprop may be good idea in early opts hubicka at gcc dot gnu.org
2023-06-16 14:59 ` [Bug tree-optimization/110289] " hubicka at gcc dot gnu.org
2023-06-16 15:32 ` hubicka at gcc dot gnu.org
2023-06-16 18:01 ` pinskia at gcc dot gnu.org
2023-06-19  6:52 ` rguenth at gcc dot gnu.org
2023-06-23 16:09 ` hubicka 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).