From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6578 invoked by alias); 20 May 2014 20:13:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 6567 invoked by uid 89); 20 May 2014 20:13:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f177.google.com Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 20 May 2014 20:13:31 +0000 Received: by mail-wi0-f177.google.com with SMTP id f8so1602430wiw.16 for ; Tue, 20 May 2014 13:13:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ZTE3Leb98y11ucUuQ8r4D+I2lOQv/VT5Ndc53s9nG64=; b=lR8toQ14OX1U3EfxjNA3k/S4FiFzRRDgxHJDwaXYUp0Ovv1mvb21Zmb6huYNVqSBOj ERGQ2a+VlDcLh7OkMQxK2zehSzMYvkiRSV8no8g1klUhYDmrytJ3WFnx3VFR6cEXWCco HCAXiRH9yJROUoTLTJjZ1aK8jTCrRPbtMM1tS0/m+6BQu/Fs7Vw5+011LVF3l9d747Q3 oDYGsNtFvF94OTLN2Ph0PqL2dTYXjjE4H9UgRwhITMduax2WHM03ZdbEiiRi/oeKGW2A E0zJXifd+HL1IsNsqrUfNHBojnw3LMsHuV9bnaIH1iUFjjVVWBFbrbeJRRSiqg1lQtNL 42yg== X-Gm-Message-State: ALoCoQlJLPfd93hKrl6vM83QUNTo2eD0fJ1FdXMwKvjILM3btwkJ0AEWbannPOxJAITdjx/Py5T/ MIME-Version: 1.0 X-Received: by 10.180.12.238 with SMTP id b14mr6293186wic.16.1400616808824; Tue, 20 May 2014 13:13:28 -0700 (PDT) Received: by 10.180.86.1 with HTTP; Tue, 20 May 2014 13:13:28 -0700 (PDT) In-Reply-To: References: <20140516160323.GE20755@kam.mff.cuni.cz> Date: Tue, 20 May 2014 20:13:00 -0000 Message-ID: Subject: Re: add dbgcnt and opt-info support for devirtualization From: Xinliang David Li To: Richard Biener Cc: Jan Hubicka , GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg01672.txt.bz2 On Tue, May 20, 2014 at 4:32 AM, Richard Biener wrote: > On Mon, May 19, 2014 at 5:24 PM, Xinliang David Li wrote: >> Sorry about it. Here is the patch. There is one remaining case where >> cgraph_dump_file and dump_enable_p are checked separately -- >> cgraph_dump_file is set up differently from 'dump_file'. > > But there you check with an else if, so if you do -fdump-ipa-cgraph > then suddenly -fopt-info will stop reporting? At least in the cgraphunit.c > part of the patch. Right. Fixed. > > I'm ok with the rest of the patch. I checked in the patch with the addition fix. thanks, David > > Thanks, > Richard. > >> David >> >> >> >> On Mon, May 19, 2014 at 2:21 AM, Richard Biener >> wrote: >>> On Fri, May 16, 2014 at 11:19 PM, Xinliang David Li wrote: >>>> Modified the patch according to yours and Richard's feedback. PTAL. >>> >>> ENOPATCH. >>> >>> Btw, I don't see any issue with leaking node order to opt-report. >>> >>> Richard. >>> >>>> thanks, >>>> >>>> David >>>> >>>> On Fri, May 16, 2014 at 9:03 AM, Jan Hubicka wrote: >>>>>> Hi, debugging runtime bugs due to devirtualization can be hard for >>>>>> very large C++ programs with complicated class hierarchy. This patch >>>>>> adds the support to report this high level transformation via >>>>>> -fopt-info (not hidden inside dump file) and the ability the do binary >>>>>> search with cutoff. >>>>>> >>>>>> Ok for trunk after build and test? >>>>> >>>>> Seems resonable to me. >>>>>> >>>>>> thanks, >>>>>> >>>>>> David >>>>> >>>>>> Index: ChangeLog >>>>>> =================================================================== >>>>>> --- ChangeLog (revision 210479) >>>>>> +++ ChangeLog (working copy) >>>>>> @@ -1,3 +1,18 @@ >>>>>> +2014-05-15 Xinliang David Li >>>>>> + >>>>>> + * cgraphunit.c (walk_polymorphic_call_targets): Add >>>>>> + dbgcnt and fopt-info support. >>>>>> + 2014-05-15 Xinliang David Li >>>>>> + >>>>>> + * cgraphunit.c (walk_polymorphic_call_targets): Add >>>>>> + dbgcnt and fopt-info support. >>>>>> + * ipa-prop.c (ipa_make_edge_direct_to_target): Ditto. >>>>>> + * ipa-devirt.c (ipa_devirt): Ditto. >>>>>> + * ipa.c (walk_polymorphic_call_targets): Ditto. >>>>>> + * gimple-fold.c (fold_gimple_assign): Ditto. >>>>>> + (gimple_fold_call): Ditto. >>>>>> + * dbgcnt.def: New counter. >>>>>> + >>>>>> 2014-05-15 Martin Jambor >>>>>> >>>>>> PR ipa/61085 >>>>>> Index: ipa-prop.c >>>>>> =================================================================== >>>>>> --- ipa-prop.c (revision 210479) >>>>>> +++ ipa-prop.c (working copy) >>>>>> @@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. >>>>>> #include "ipa-utils.h" >>>>>> #include "stringpool.h" >>>>>> #include "tree-ssanames.h" >>>>>> +#include "dbgcnt.h" >>>>>> >>>>>> /* Intermediate information about a parameter that is only useful during the >>>>>> run of ipa_analyze_node and is not kept afterwards. */ >>>>>> @@ -2494,6 +2495,13 @@ ipa_make_edge_direct_to_target (struct c >>>>>> fprintf (dump_file, "ipa-prop: Discovered direct call to non-function" >>>>>> " in %s/%i, making it unreachable.\n", >>>>>> ie->caller->name (), ie->caller->order); >>>>>> + else if (dump_enabled_p ()) >>>>>> + { >>>>>> + location_t loc = gimple_location (ie->call_stmt); >>>>>> + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, >>>>>> + "Discovered direct call to non-function in %s, " >>>>>> + "making it unreachable\n", ie->caller->name ()); >>>>> >>>>> Perhaps "turning it to __builtin_unreachable call" and similarly in the other cases >>>>> we introduce __builtin_unreachable? I think that could be easier for user to work >>>>> out. >>>>> >>>>> What king of problems in devirtualizatoin you are seeing? >>>>> >>>>> >>>>> Honza