public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: prem paulson <prempaulson@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Function reorder with -fprofile-reorder-functions
Date: Tue, 25 Jan 2022 16:48:39 -0800	[thread overview]
Message-ID: <CALr15XJehwcotYDT+x7hudox3pKD43zjUykxiuY2jHpEC-wXXQ@mail.gmail.com> (raw)

Hello,

I am experimenting with function reordering using PGO. I am looking at
ordering functions based on the Last time of execution. For example, if the
sequence of calls from profile feedback is:

func1() -> func2() -> func3() -> func1()->func4()

I would like the reordering in the binary as follows:

func2
func3
func1
func4

The closest option I see is -fprofile-reorder-functions but it reorders
based on the first time of execution.

-fprofile-reorder-functions
Function reordering based on profile instrumentation collects first time of
execution of a function and orders these functions in ascending order.

Is there any similar option that can help me achieve this?

Thanks in advance.

             reply	other threads:[~2022-01-26  0:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  0:48 prem paulson [this message]
2022-02-01  5:59 ` prem paulson

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=CALr15XJehwcotYDT+x7hudox3pKD43zjUykxiuY2jHpEC-wXXQ@mail.gmail.com \
    --to=prempaulson@gmail.com \
    --cc=gcc-help@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).