public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Matt Tucker <tuck@whistlingfish.net>
To: Sven Vermeulen <swift@gentoo.org>, gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] -fbranch-probabilities optimisation
Date: Sat, 17 May 2003 05:30:55 -0700	[thread overview]
Message-ID: <124540000.1053174655@nareau.whistlingfish.net> (raw)
In-Reply-To: <20030517114304.GD2599@Daikan.pandora.be>

-- Sven Vermeulen <swift@gentoo.org> spake thusly:

> On Sat, May 17, 2003 at 03:49:11AM +0100, Chris Davies wrote:
>> I had the idea to build -fbranch-probabilities optimisation into
>> portage. This is where a sample run of data is taken using the
>> program compiled with -fprofile-arcs, and that data then used to
>> reorganise the object code so conditional branches are layed out in
>> a more efficient manner.
> 
> Why implement it in Portage? Isn't it up to the user to define it in
> the CFLAGS or not? 

This isn't a simple matter of turning on a compiler flag.

>From 'man gcc':

	After running a program compiled with -fprofile-arcs, you can
	compile it a second time using -fbranch-probabilities, to
	improve optimizations based on the number of times each branch
	was taken.  When the program compiled with -fprofile-arcs exits
	it saves arc execution counts to a file called sourcename.da for
	each source file The information in this data file is very
	dependent on the structure of the generated code, so you must
	use the same source code and the same optimization options for
	both compilations.

However, the problem with trying to integrate this into portage is that
it must either:

 1) Compile programs on the user's machine, allow the user to run
    them, and then rebuild using the generated data. Quite a
    lengthy process, and fraught with issues.

or

 2) Distribute the profile data along with the source code. The
    trouble with this is that (as the man page says) it requires
    using the same source code and optimization options. So not only
    must the CFLAGS used be the same as with the profiled code, but
    the configure settings (which alter #define's and therefore the
    source) must be the same as well.


--
gentoo-dev@gentoo.org mailing list


      parent reply	other threads:[~2003-05-17 12:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-17  2:49 [gentoo-dev] -fbranch-probabilities optimisation Chris Davies
2003-05-17  0:52 ` Anupam Kapoor
2003-05-17 23:28   ` Evan Powers
2003-05-17  7:24 ` David Nielsen
2003-05-17 11:43 ` Sven Vermeulen
2003-05-17  6:33   ` Werner Van Belle
2003-05-17 13:57     ` Sven Vermeulen
2003-05-17 14:13       ` Werner Van Belle
2003-05-17 16:00         ` Paul de Vrieze
2003-05-17 16:47           ` Chris Davies
2003-05-17 18:16             ` Paul de Vrieze
2003-05-18  9:23             ` Sven Vermeulen
2003-05-18 14:45               ` Chris Davies
2003-05-17 12:30   ` Matt Tucker [this message]

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=124540000.1053174655@nareau.whistlingfish.net \
    --to=tuck@whistlingfish.net \
    --cc=gentoo-dev@gentoo.org \
    --cc=swift@gentoo.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