From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123780 invoked by alias); 18 Dec 2018 11:16:05 -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 123584 invoked by uid 89); 18 Dec 2018 11:15:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Due, instability, H*Ad:D*alibaba.com, categories X-HELO: mail-it1-f196.google.com Received: from mail-it1-f196.google.com (HELO mail-it1-f196.google.com) (209.85.166.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Dec 2018 11:15:53 +0000 Received: by mail-it1-f196.google.com with SMTP id w18so3208545ite.1 for ; Tue, 18 Dec 2018 03:15:53 -0800 (PST) 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; bh=cYf+sqTSXXkMKDUMXZjITcGhPj8turnjMbWPOybojqY=; b=Q6A3BGmiUzkzqmQoD7XHx64iJK8U84FaAzhIIgVjtInUxRX7R25ispfbBHrh6rcwHt NtkfHzwXEGntVBdpyTu1sydvngHsZ6s9aYG8Hqe5bCZEHLxmGwy0sGqyShnobGNoMKjj FJvbCLnpI4683v+V9bQe/dW/boZtwEgVbc4w7vEIfNAWbC+Hkexu2H+CBZxDnUXwMocj Dr9R4OwpEP1nG+Roy/J/hklVp7HrG2/90JBmDhL41Y70/yE79CJdZ8mFtth8DkI4AkxM 8V1ZDGuANusOVxwFo0ikowCazYF2z2t4krbf6gi7ql5YWTQcBjOwCpRGYYFPTS5kAj1W TiDA== MIME-Version: 1.0 References: <87wooai8cs.fsf@linux.intel.com> In-Reply-To: <87wooai8cs.fsf@linux.intel.com> From: "Bin.Cheng" Date: Tue, 18 Dec 2018 11:16:00 -0000 Message-ID: Subject: Re: [PATCH AutoFDO]Restoring indirect call value profile transformation To: ak@linux.intel.com Cc: bin.cheng@linux.alibaba.com, gcc-patches List Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg01289.txt.bz2 On Sun, Dec 16, 2018 at 9:11 AM Andi Kleen wrote: > > "bin.cheng" writes: > > > 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. > > Would be good to make the tests stable, otherwise we'll just have > regressions in the future again. > > The problem is that the tests don't run long enough and don't get enough samples? Yes, take g++.dg/tree-prof/morefunc.C as an example: - int i; - for (i = 0; i < 1000; i++) + int i, j; + for (i = 0; i < 1000000; i++) + for (j = 0; j < 50; j++) g += tc->foo(); if (g<100) g++; } @@ -27,8 +28,9 @@ void test1 (A *tc) static __attribute__((always_inline)) void test2 (B *tc) { - int i; + int i, j; for (i = 0; i < 1000000; i++) + for (j = 0; j < 50; j++) I have to increase loop count like this to get stable pass on my machine. The original count (1000) is too small to be sampled. > > Could add some loop? > Or possibly increase the sampling frequency in perf (-F or -c)? Maybe, I will have a try. > Or run them multiple times and use gcov_merge to merge the files? Without changing loop count or sampling frequency, this is not likely to be helpful, since perf doesn't hit the small loop in most cases. Thanks, bin > > > > FYI, an update about AutoFDO status: > > All AutoFDO ICEs in regtest are fixed, while several tests still failing fall in below > > three categories: > > Great! > > Of course it still ICEs with LTO? > > Right now there is no test case for this I think. Probably one should be added. > > -Andi