From patchwork Thu Mar 20 19:40:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 332372 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BEBF42C00AB for ; Fri, 21 Mar 2014 06:41:09 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=J9rNcAjBGTwglPmBfK Ah2RwM7OGHUZmSN47u+/61CeNh7Bnep8EuzhvrBIv4dO3ogiLKFOpRyJIw2fgCdx Pg2TSOY49ogOObV1XXNI8DFysK3hClxfafPKFjf7ABGxmPUcVoHpnpfAhrIrE92r /bmjg76TiGoi6jITAy1IkzTaY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=hkqLXUxiZvNQG1iD0snY0V5M XuM=; b=s0IrwZvTZQAjtjdTnUf1vdsL5S9Yp1McT0bVq8FQ7jf3q25IoaeWLPr/ E51byJmWp1fb9ViD7NoCfWTjdmBACmyVbAUC2wmAIn9mTGFgaSreuW/jZSccDiur G/5jwt68MSrzqCCBcnUVKNqRngp4RhjYiKKplTlokWqZyNKI5NU= Received: (qmail 17105 invoked by alias); 20 Mar 2014 19:41:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 17092 invoked by uid 89); 20 Mar 2014 19:41:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ie0-f174.google.com Received: from mail-ie0-f174.google.com (HELO mail-ie0-f174.google.com) (209.85.223.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 20 Mar 2014 19:40:59 +0000 Received: by mail-ie0-f174.google.com with SMTP id rp18so1398614iec.5 for ; Thu, 20 Mar 2014 12:40:58 -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=imL8/FxodMEXmIrMAzbYisWsuwEFsDmh048Dub3TGAw=; b=MvTf9Dt17BKV54t0VX0Pw+2oQe9l/++OnV2x2IHqjSXRvMUa+nqjmcRu6/5HL9Ron1 pEUW7wl0cCc73uHudmgmaxYQVmtlokz712tAU0x5nOwTCvvniGcRla3ULJ2GPdWUEE9Q Lvzg5+XKrOJSrrIlz66HYoJBiE/LOG/krUNQNv1QxlddGeGwhP0ebeZ+yQO/I0hyI02A blF+XiBSu9bjwY95zjSfIOKVNkMcJNuzN41rnFYhVfAe6OIn/dj0NwhhB8qGbtmGY0b3 LonDYWUzYvaZ/j3oMbZxWS071l+JLlv+kqoKFX9QcmPHxKkB6jGo2wxiDTqsyu1isfMu vwKQ== X-Gm-Message-State: ALoCoQkhAKRL4Uv0YxOQKhOxizXH44bbPsjUZvZ6vvcECZmKiDF7zb2gcTwCCfrmuTTKy/Du5X0AKF0mKmJDxNtUjceLVtDMHwZ1JFo8UyjvaOcZRZTxo25L2Q9qYqA5s5MqLZ7T7tSc+IuCBPRq3vAJLOfdpEUPj2+EVphBGxPO9jW418cqM99ykmLe3tv3AH/M/XX8KnklgvUcFANKmcynEbWThWKV7Q== MIME-Version: 1.0 X-Received: by 10.42.92.194 with SMTP id u2mr34999556icm.19.1395344457921; Thu, 20 Mar 2014 12:40:57 -0700 (PDT) Received: by 10.64.18.207 with HTTP; Thu, 20 Mar 2014 12:40:57 -0700 (PDT) In-Reply-To: References: Date: Thu, 20 Mar 2014 12:40:57 -0700 Message-ID: Subject: Re: [GOOGLE] update ssa before compute_inline_parameters From: Dehao Chen To: Xinliang David Li Cc: GCC Patches X-IsSubscribed: yes Patch updated to add a wrapper early_inline function else @@ -1516,6 +1514,14 @@ afdo_annotate_cfg (const stmt_set &promoted_stmts) } } /* namespace autofdo. */ +static void early_inline () +{ + compute_inline_parameters (cgraph_get_node (current_function_decl), true); + unsigned todo = early_inliner (); + if (todo & TODO_update_ssa_any) + update_ssa (TODO_update_ssa); +} + /* Use AutoFDO profile to annoate the control flow graph. Return the todo flag. */ @@ -1610,11 +1616,10 @@ auto_profile (void) if (!flag_value_profile_transformations || !autofdo::afdo_vpt_for_early_inline (&promoted_stmts)) break; - early_inliner (); + early_inline (); } - compute_inline_parameters (cgraph_get_node (current_function_decl), true); - early_inliner (); + early_inline (); autofdo::afdo_annotate_cfg (promoted_stmts); compute_function_frequency (); update_ssa (TODO_update_ssa); On Thu, Mar 20, 2014 at 11:36 AM, Xinliang David Li wrote: > I think the right way to fix this is to wrap the call to early_inliner > and check the TODO flags. See execute_function_todo: > > if (flags & TODO_cleanup_cfg) > { > cleanup_tree_cfg (); > > if (!(flags & TODO_update_ssa_any) && need_ssa_update_p (cfun)) > flags |= TODO_update_ssa; > } > > if (flags & TODO_update_ssa_any) > { > unsigned update_flags = flags & TODO_update_ssa_any; > update_ssa (update_flags); > cfun->last_verified &= ~TODO_verify_ssa; > } > > David > > On Thu, Mar 20, 2014 at 10:39 AM, Dehao Chen wrote: >> This patch calls update_ssa before compute_inline_paramters. >> >> Bootstrapped and perf test on-going. >> >> OK for google-4_8? >> >> Thanks, >> Dehao >> >> Index: gcc/auto-profile.c >> =================================================================== >> --- gcc/auto-profile.c (revision 208726) >> +++ gcc/auto-profile.c (working copy) >> @@ -1613,6 +1613,7 @@ auto_profile (void) >> early_inliner (); >> } >> >> + update_ssa (TODO_update_ssa); >> compute_inline_parameters (cgraph_get_node (current_function_decl), >> true); >> early_inliner (); >> autofdo::afdo_annotate_cfg (promoted_stmts); >> Index: gcc/auto-profile.c =================================================================== --- gcc/auto-profile.c (revision 208726) +++ gcc/auto-profile.c (working copy) @@ -1449,8 +1449,6 @@ afdo_vpt_for_early_inline (stmt_set *promoted_stmt calculate_dominance_info (CDI_POST_DOMINATORS); calculate_dominance_info (CDI_DOMINATORS); rebuild_cgraph_edges (); - update_ssa (TODO_update_ssa); - compute_inline_parameters (cgraph_get_node (current_function_decl), true); return true; }