From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27888 invoked by uid 1002); 17 May 2003 12:30:57 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 24681 invoked from network); 17 May 2003 12:30:56 -0000 Date: Sat, 17 May 2003 05:30:55 -0700 From: Matt Tucker To: Sven Vermeulen , gentoo-dev@gentoo.org Message-ID: <124540000.1053174655@nareau.whistlingfish.net> In-Reply-To: <20030517114304.GD2599@Daikan.pandora.be> References: <20030517024911.GA6515@vaughan.foofalicious.com> <20030517114304.GD2599@Daikan.pandora.be> X-Mailer: Mulberry/3.0.1 (Linux/x86) Mail-Copies-To: nobody MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: [gentoo-dev] -fbranch-probabilities optimisation X-Archives-Salt: 1df812d9-1d75-4230-b1e2-f0cbb10a9c77 X-Archives-Hash: 7a6f554c204c54e9565daf96b9d2a2a7 -- Sven Vermeulen 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