From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78184 invoked by alias); 8 Apr 2019 09:11:29 -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 78098 invoked by uid 89); 8 Apr 2019 09:11:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=sk:gimple-, sk:gimple, quality, our X-HELO: mail-lj1-f195.google.com Received: from mail-lj1-f195.google.com (HELO mail-lj1-f195.google.com) (209.85.208.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Apr 2019 09:11:26 +0000 Received: by mail-lj1-f195.google.com with SMTP id r24so10518468ljg.3 for ; Mon, 08 Apr 2019 02:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GOz/xFAdhkNGP4nYFV75fXHKr0nAbFOFAOCcl7YuslE=; b=RiOwUpXAOAN+D5SxPR3l3X7GpzNjp9qHV5tqN/kVPXgHLeqxkRAlS2T1rdCk6LwCny KQaleEUW20Ta4xIbxb5uJf0qjoXKF1I5LUWEEfzXEbXuh86lUDIhWZfh5U6wZeBmeTtJ TDol8HDKmfD54qAkEsVqHmG5IjAo1gaun2pio8iPcfANGJHFB87q9r3S8gE+L8mRPZUS dniVMMzdKfypj06gDA8+MEfqTOKHslg4HCAv0UJl+8ubc21nte6Iltxs0BrzuuSrTtej KNt3tGSRXBy9ZnN5qxH9LLUSA3HYxWbHWxvqsSMIHrmgptxSctOqGZK1y330HJhBzdTo 1G6A== MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Mon, 08 Apr 2019 09:11:00 -0000 Message-ID: Subject: Re: [PATCH][stage1] Support profile (BB counts and edge probabilities) in GIMPLE FE. To: =?UTF-8?Q?Martin_Li=C5=A1ka?= , Jan Hubicka Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00269.txt.bz2 On Fri, Apr 5, 2019 at 2:32 PM Martin Li=C5=A1ka wrote: > > Hi. > > The patch adds support for profile for GIMPLE FE. That can be useful > in the future. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed after stage1 opens? Hmm, I guess to be useful we need the profile quality indicators as well (and think about a proper syntax here since it seems related). Btw, do BB counts and edge probabilities not have a relation? If so why do we need both? In predict.c we also look at ENTRY_BLOCK->count so we need a place to set that as well. We should probably set edge probabilities of fallthru edges properly during our "CFG build". + goto __BB3(44739243); since we eventually want to add other flags this syntactically should maybe be goto __BB3(guessed(44739243)); and similar for the __BB count case (just s/count/quality/). The entry block count could be sticked to __GIMPLE (ssa,guessed(N)) for example. There's also the exit block, not sure if we ever look at its count, so __GIMPLE (ssa,guessed(N[,M])) might be a possibility if we always have the same quality here (probably not...). Otherwise thanks for trying ;) Richard. > Thanks, > Martin > > gcc/ChangeLog: > > 2019-04-05 Martin Liska > > * gimple-pretty-print.c (dump_gimple_bb_header): > Dump BB count. > (pp_cfg_jump): Dump edge probability. > * profile-count.h (get_raw_value): New function. > (from_raw_value): Likewise. > > gcc/c/ChangeLog: > > 2019-04-05 Martin Liska > > * gimple-parser.c (struct gimple_parser): Add frequency > for gimple_parser_edge. > (gimple_parser::push_edge): Add new argument frequency. > (c_parser_gimple_parse_bb_spec): Parse also frequency > if present. > (c_parser_parse_gimple_body): Set edge probability. > (c_parser_gimple_compound_statement): Consume token > before calling c_parser_gimple_goto_stmt. > Parse BB counts. > (c_parser_gimple_statement): Pass new argument. > (c_parser_gimple_goto_stmt): Likewise. > (c_parser_gimple_if_stmt): Likewise. > > gcc/testsuite/ChangeLog: > > 2019-04-05 Martin Liska > > * gcc.dg/gimplefe-37.c: New test. > --- > gcc/c/gimple-parser.c | 116 +++++++++++++++++++++++------ > gcc/gimple-pretty-print.c | 8 ++ > gcc/profile-count.h | 15 ++++ > gcc/testsuite/gcc.dg/gimplefe-37.c | 27 +++++++ > 4 files changed, 144 insertions(+), 22 deletions(-) > create mode 100644 gcc/testsuite/gcc.dg/gimplefe-37.c > >