From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50592 invoked by alias); 13 Dec 2018 18:48:46 -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 50462 invoked by uid 89); 13 Dec 2018 18:48:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=HTo:D*alibaba.com, bin.cheng, bincheng, UD:cheng X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Dec 2018 18:48:31 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7E7D02F3D; Thu, 13 Dec 2018 18:48:30 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-24.rdu2.redhat.com [10.10.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49E9761475; Thu, 13 Dec 2018 18:48:29 +0000 (UTC) Subject: Re: [PATCH AutoFDO]Restoring indirect call value profile transformation To: "bin.cheng" , GCC Patches References: From: Jeff Law Openpgp: preference=signencrypt Message-ID: <32bc6803-2d8a-2006-1f6f-221eef7dd18d@redhat.com> Date: Thu, 13 Dec 2018 18:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00963.txt.bz2 On 12/12/18 8:50 PM, bin.cheng wrote: > Hi, > > Due to ICE and mal-functional bugs, indirect call value profile transformation > is disabled on GCC-7/8/trunk. This patch restores the transformation. The > main issue is AutoFDO should store cgraph_node's profile_id of callee func in > the first histogram value's counter, rather than pointer to callee's name string > as it is now. > With the patch, some "Indirect call -> direct call" tests pass with autofdo, while > others are unstable. I think the instability is caused by poor perf data collected > during regrets run, and can confirm these tests pass if good perf data could be > collected in manual experiments. > > Bootstrap and test along with previous patches. Is it OK? > > FYI, an update about AutoFDO status: > All AutoFDO ICEs in regtest are fixed, while several tests still failing fall in below > three categories: > > Unstable indirect call value profile transformation: > FAIL: g++.dg/tree-prof/indir-call-prof.C scan-ipa-dump afdo "Indirect call -> direct call.* AA transformation on insn" > FAIL: g++.dg/tree-prof/morefunc.C scan-ipa-dump-times afdo "Indirect call -> direct call" 2 > FAIL: g++.dg/tree-prof/pr35545.C scan-ipa-dump profile_estimate "Indirect call -> direct call" > > loop peeling case because we don't honor autofdo profile count as reliable: > FAIL: gcc.dg/tree-prof/peel-1.c scan-tree-dump cunroll "Peeled loop ., 1 times" > > cold/hot partition cases: > FAIL: gcc.dg/tree-prof/cold_partition_label.c scan-assembler foo[._]+cold > FAIL: gcc.dg/tree-prof/cold_partition_label.c scan-assembler size[ \ta-zA-Z0-0]+foo[._]+cold > FAIL: gcc.dg/tree-prof/section-attr-1.c scan-assembler .section[\t ]*.text.unlikely[\\n\\r]+[\t ]*.size[\t ]*foo.cold > FAIL: gcc.dg/tree-prof/section-attr-2.c scan-assembler .section[\t ]*.text.unlikely[\\n\\r]+[\t ]*.size[\t ]*foo.cold > FAIL: gcc.dg/tree-prof/section-attr-3.c scan-assembler .section[\t ]*.text.unlikely[\\n\\r]+[\t ]*.size[\t ]*foo.cold > These are more difficult to enable because we can't simply treat autofdo::zero > count as cold, it's just too many. > > Besides regtest, I run autofdo with kernel/mysql-server, the build and performance > match expectations now, but I haven't run autofdo with any spec yet. > > Thanks, > bin > > 2018-12-13 Bin Cheng > > * auto-profile.c (afdo_indirect_call): Skip generating histogram > value if we can't find cgraph_node for then indirected callee. Save > profile_id of the cgraph_node in histogram value's first counter. > * value-prof.c (gimple_value_profile_transformations): Don't skip > for flag_auto_profile. OK jeff