From patchwork Mon Jan 14 08:19:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 1024321 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-493981-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=firstfloor.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="QuthNqHL"; dkim=pass (1024-bit key; unprotected) header.d=firstfloor.org header.i=@firstfloor.org header.b="xjAbzGst"; dkim-atps=neutral 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 43dRHW5pdyz9s7T for ; Mon, 14 Jan 2019 19:20:39 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=qwe VXgJE9X+TWx/ujtaq8pIEcsg8bHsCa40OwGf0thUt9Qg7HidJEUkRZBX/lTYKX8Z eP/fRfo5RzXMpvNkozHjr65UmMKvvbzkSn2rq8aLGSA5FeEw+NYIQhqrPPNa6tx7 Ro9jcjU9HqXiOjXnhkyocJfHC+Vn8b+bitOWTt1g= 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:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=MEBHRauIo ppXwsbEh7Hg4kJ7i6c=; b=QuthNqHLd1v9L1Y8fPiGtwFo4a+KfMOfBQ9U2qj5u mGE+euPHMaxkt7rq5861BNR/6XVW4UXFsYREt8z+53UwtzbjDK6RSMsKy1Wu2JIL SWh7u0S0YI2YO0KNobo3foONDWYGIE59iKh6YxCVypKNOJKsvPvqGzmmZUim6UeB Ao= Received: (qmail 2473 invoked by alias); 14 Jan 2019 08:20:09 -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 2380 invoked by uid 89); 14 Jan 2019 08:20:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=2191, impact X-HELO: one.firstfloor.org Received: from one.firstfloor.org (HELO one.firstfloor.org) (193.170.194.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Jan 2019 08:20:05 +0000 Received: from firstfloor.org (c-71-238-43-142.hsd1.or.comcast.net [71.238.43.142]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by one.firstfloor.org (Postfix) with ESMTPSA id 9982586889; Mon, 14 Jan 2019 09:20:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=firstfloor.org; s=mail; t=1547454000; bh=kls6xEqzsQLRYbMd7f7WXziwdds7yp3xGO0bzCvTY3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xjAbzGstjfiQSDDtWLaEhFjsFmj1NUtpcDw1oPrp2TcNkNlJZvsYe++T92vI9RfKm wwZ9tSLn7+MA1sxCV2biPax+2c0I6BgtgnO5E1JBTOEwnvV1rQAsQIo7pSnvRiEjEe SMwr5nqnXJb3tg5WLbqui64ZZr3SW9sYqNTw+CkI= Received: by firstfloor.org (Postfix, from userid 1000) id A1A00A6E45; Mon, 14 Jan 2019 00:19:56 -0800 (PST) From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: amker.cheng@gmail.com, Andi Kleen Subject: [PATCH 3/3] Increase iterations for autofdo tests Date: Mon, 14 Jan 2019 00:19:42 -0800 Message-Id: <20190114081942.9088-3-andi@firstfloor.org> In-Reply-To: <20190114081942.9088-2-andi@firstfloor.org> References: <20190114081942.9088-1-andi@firstfloor.org> <20190114081942.9088-2-andi@firstfloor.org> MIME-Version: 1.0 From: Andi Kleen Bin cheng pointed out that the autofdo tests are unstable because they don't have enough iterations for the perf sampling to get enough data. Increase the iterations, but only for autofdo. This avoids any impact on targets that use a slow emulator, which will never run the host only autofdo tests. gcc/testsuite/: 2019-01-14 Andi Kleen * g++.dg/tree-prof/morefunc.C (ITER): Add. (test1): Use. (test2): Use. * gcc.dg/tree-prof/cold_partition_label.c (ITER): Add. (main): Use. * gcc.dg/tree-prof/crossmodule-indircall-1.c (ITER): Add. (main): Use * gcc.dg/tree-prof/indir-call-prof.c (ITER): Add. (main): Use. * gcc.dg/tree-prof/peel-1.c (ITER): Add. (t): Use. (main): Use. * gcc.dg/tree-prof/pr52027.c (ITER): Add. (main): Use. * gcc.dg/tree-prof/tracer-1.c (ITER): Add. (main): Use. * gcc.dg/tree-prof/unroll-1.c (ITER): Add. (t): Use. (main): Use. * gcc.dg/tree-prof/update-cunroll-2.c (ITER): Add. (main): Use. * lib/profopt.exp: Pass -DITER to autofdo compilations. --- gcc/testsuite/g++.dg/tree-prof/morefunc.C | 8 ++++++-- gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c | 6 +++++- .../gcc.dg/tree-prof/crossmodule-indircall-1.c | 10 +++++++--- gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c | 6 +++++- gcc/testsuite/gcc.dg/tree-prof/peel-1.c | 10 +++++++--- gcc/testsuite/gcc.dg/tree-prof/pr52027.c | 6 +++++- gcc/testsuite/gcc.dg/tree-prof/tracer-1.c | 7 ++++++- gcc/testsuite/gcc.dg/tree-prof/unroll-1.c | 10 +++++++--- gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c | 8 ++++++-- gcc/testsuite/lib/profopt.exp | 4 ++-- 10 files changed, 56 insertions(+), 19 deletions(-) diff --git a/gcc/testsuite/g++.dg/tree-prof/morefunc.C b/gcc/testsuite/g++.dg/tree-prof/morefunc.C index a9bdc167f45..02b01c073e9 100644 --- a/gcc/testsuite/g++.dg/tree-prof/morefunc.C +++ b/gcc/testsuite/g++.dg/tree-prof/morefunc.C @@ -2,6 +2,10 @@ #include "reorder_class1.h" #include "reorder_class2.h" +#ifndef ITER +#define ITER 1000 +#endif + int g; #ifdef _PROFILE_USE @@ -19,7 +23,7 @@ static __attribute__((always_inline)) void test1 (A *tc) { int i; - for (i = 0; i < 1000; i++) + for (i = 0; i < ITER; i++) g += tc->foo(); if (g<100) g++; } @@ -28,7 +32,7 @@ static __attribute__((always_inline)) void test2 (B *tc) { int i; - for (i = 0; i < 1000000; i++) + for (i = 0; i < ITER; i++) g += tc->foo(); } diff --git a/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c b/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c index 450308d6407..099069da6a7 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c +++ b/gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c @@ -9,6 +9,10 @@ const char *sarr[SIZE]; const char *buf_hot; const char *buf_cold; +#ifndef ITER +#define ITER 1000000 +#endif + __attribute__((noinline)) void foo (int path) @@ -32,7 +36,7 @@ main (int argc, char *argv[]) int i; buf_hot = "hello"; buf_cold = "world"; - for (i = 0; i < 1000000; i++) + for (i = 0; i < ITER; i++) foo (argc); return 0; } diff --git a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c index 58109d54dc7..32d22c69c6c 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1.c @@ -2,6 +2,10 @@ /* { dg-additional-sources "crossmodule-indircall-1a.c" } */ /* { dg-options "-O3 -flto -DDOJOB=1" } */ +#ifndef ITER +#define ITER 1000 +#endif + int a; extern void (*p[2])(int n); void abort (void); @@ -10,12 +14,12 @@ main() { int i; /* This call shall be converted. */ - for (i = 0;i<1000;i++) + for (i = 0;i