From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 932 invoked by alias); 29 Nov 2007 11:00:09 -0000 Received: (qmail 920 invoked by uid 22791); 29 Nov 2007 11:00:08 -0000 X-Spam-Check-By: sourceware.org Received: from nz-out-0506.google.com (HELO nz-out-0506.google.com) (64.233.162.226) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 29 Nov 2007 10:59:59 +0000 Received: by nz-out-0506.google.com with SMTP id i11so1551608nzh for ; Thu, 29 Nov 2007 02:59:57 -0800 (PST) Received: by 10.65.151.7 with SMTP id d7mr420932qbo.1196333996887; Thu, 29 Nov 2007 02:59:56 -0800 (PST) Received: by 10.64.210.9 with HTTP; Thu, 29 Nov 2007 02:59:56 -0800 (PST) Message-ID: Date: Thu, 29 Nov 2007 15:19:00 -0000 From: "Karthik Kumar" To: "GCC@GCC" Subject: Fwd: Function specific optimizations call for discussion In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071128205737.GA28277@mmeissner-gold.amd.com> <67ea2eb0711290039t3acc1b30ydf33313531b8e2f8@mail.gmail.com> X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg00826.txt.bz2 On Nov 29, 2007 2:09 PM, Ramana Radhakrishnan wrote: > Hi Michael, > > I had a comment / query regarding Stage 2 where you talk about > Function cloning for different targets. > > I understand that the mechanism is to have a hidden function pointer > that actually gets initialized based on the cpuid. > > I don't know if it is worth the effort to have debug info also > enhanced to be such that a breakpoint put on the function my_min > actually sets the breakpoint on any of the clones since the logic > would be similar to the same. This sounds logically similar to the > way that gdb currently handles breakpoints to multiple constructors. > If the user has written the clone (for manual dispatch), then the debug info would point to his code version. If it were generated automatically (stage 2), the information would pertain to the function cloned multiple times.The disassembly on those breakpoints might be different, of course. > The other option ofcourse is to fake debug information for such to > actually set a breakpoint on the value of the function pointer that > you so set up. I am no DWARF expert but there might be other folks on > the list who might have better ideas about how to implement this. > There is an idea to modify the dynamic linker to take advantage of the detection; If in such case, setting a breakpoint would be easier. Then we wouldn't require indirect calls either. The breakpoints can be set in each of the clones, and they will be processed only after setting up the pointer and their subsequent execution. The idea is to make use of the debugging information as provided by the inline-cloner. > cheers > Ramana Karthik -- Karthik http://guilt.bafsoft.net