From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15825 invoked by alias); 25 Nov 2004 23:15:38 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 15750 invoked from network); 25 Nov 2004 23:15:34 -0000 Received: from unknown (HELO main.gmane.org) (80.91.229.2) by sourceware.org with SMTP; 25 Nov 2004 23:15:34 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CXSpq-0002XG-00 for ; Fri, 26 Nov 2004 00:15:34 +0100 Received: from pcusersgroup-link.cbr.comindico.com.au ([203.220.47.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 26 Nov 2004 00:15:34 +0100 Received: from bje by pcusersgroup-link.cbr.comindico.com.au with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 26 Nov 2004 00:15:34 +0100 To: gcc@gcc.gnu.org From: Ben Elliston Subject: Re: profile-driven optimization and the linker? Date: Fri, 26 Nov 2004 00:01:00 -0000 Message-ID: <87llcp4izg.fsf@au.ibm.com> References: <41A620F5.5040209@kegel.com> <1101412168.13475.19.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: pcusersgroup-link.cbr.comindico.com.au User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-SW-Source: 2004-11/txt/msg01004.txt.bz2 Jeffrey A Law writes: > We had some hacks to gprof which would take profile data and build a > linker map. That's the code that really needs to be improved. I > never understood the gprof code well enough to do it right. A year or two ago, I wrote a Python program that could compile and link a program (with -fdata-sections), run it under a simulator, collect memory traffic stats and re-run the linker with a custom linker script that would rearrange global variables so that they were allocated to faster memory regions (on systems where this was the case). The idea was that this could be used as a wrapper around the compiler driver. It never got quite that refined, but the idea seemed sound. Ben