From patchwork Mon Jun 27 01:50:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 640774 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 3rdBkm3H40z9t19 for ; Mon, 27 Jun 2016 11:52:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=cf3Yj5HR; dkim-atps=neutral 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; q=dns; s= default; b=K1Z1DK8pAJvH0ZqQLjUVLWZ9VhnSN0C9fGguugW7qlBGaSbtRyPuu WP67dzy2keQglQdxy+gLGzJWsuNAiHJhwxq4YZoSD7gYP/te6Fu3JNDWXn66rjDH cOFcSjTkd+RxJzAmk8dowFv9Px+YbvQRag7ogHkMDhT3KNahM/7odQ= 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; s= default; bh=qJiNYocLW13zCTHjV4sNHDtnDfg=; b=cf3Yj5HRC4mddHQlOK/4 ek/8xDdmkm5UShTd4xAQUtMKT7accxCF1J8TyQ66hnmtu0DbV9ZfEx6LWlcTLkcP nIIZI6Y+QCmFy2vH2b2YtpGj4tJxBFm0ttzJea1Zx4zgU+vtvYx3bHcs4hQI+fjr PFnIBN26wST2udNBXHlJWog= Received: (qmail 11536 invoked by alias); 27 Jun 2016 01:51:20 -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 11284 invoked by uid 89); 27 Jun 2016 01:51:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=WHICH, 17147 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 27 Jun 2016 01:51:13 +0000 Received: from firstfloor.org (174-25-121-21.ptld.qwest.net [174.25.121.21]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by one.firstfloor.org (Postfix) with ESMTPSA id 0200E873F8; Mon, 27 Jun 2016 03:50:59 +0200 (CEST) Received: by firstfloor.org (Postfix, from userid 1000) id 2B069A0E69; Sun, 26 Jun 2016 18:50:28 -0700 (PDT) From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: hubicka@ucw.cz, law@redhat.com, Andi Kleen Subject: [PATCH 3/6] Add dg-final-scan-autofdo and dg-final-scan-not-autofdo Date: Sun, 26 Jun 2016 18:50:21 -0700 Message-Id: <20160627015024.23444-4-andi@firstfloor.org> In-Reply-To: <20160627015024.23444-3-andi@firstfloor.org> References: <20160627015024.23444-1-andi@firstfloor.org> <20160627015024.23444-2-andi@firstfloor.org> <20160627015024.23444-3-andi@firstfloor.org> From: Andi Kleen Autofdo outputs to different dump files and doesn't support some transformation that normal profiling. Add dg-final-scan-autofdo and dg-final-scan-not-autofdo statements to the test suite so that the test cases can hande those cases separately. gcc/testsuite/: 2016-06-26 Andi Kleen * lib/profopt.exp (dg-final-scan-autofdo, dg-final-scan-not-autofdo): New functions. --- gcc/testsuite/lib/profopt.exp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp index b3e2b2e..3cce2ee 100644 --- a/gcc/testsuite/lib/profopt.exp +++ b/gcc/testsuite/lib/profopt.exp @@ -171,6 +171,47 @@ proc dg-final-use { args } { } # +# dg-final-use-not-autofdo -- process code to run after the profile-use step +# but only if not running autofdo +# ARGS is the line number of the directive followed by the commands. +# +proc dg-final-use-not-autofdo { args } { + global use_final_code + global run_autofdo + + if { [llength $args] > 2 } { + error "[lindex $args 0]: too many arguments" + return + } + + if { $run_autofdo == 1 } { + return + } + append use_final_code "[lindex $args 1]\n" +} + +# +# dg-final-use-autofdo -- process code to run after the profile-use step +# but only if running autofdo +# ARGS is the line number of the directive followed by the commands. +# + +proc dg-final-use-autofdo { args } { + global use_final_code + global run_autofdo + + if { [llength $args] > 2 } { + error "[lindex $args 0]: too many arguments" + return + } + + if { $run_autofdo != 1 } { + return + } + append use_final_code "[lindex $args 1]\n" +} + +# # profopt-final-code -- run final code # # WHICH is "generate" or "use". @@ -210,6 +251,8 @@ proc profopt-get-options { src } { || ![string compare "dg-skip-if" $cmd] \ || ![string compare "dg-final-generate" $cmd] \ || ![string compare "dg-final-use" $cmd] \ + || ![string compare "dg-final-use-not-autofdo" $cmd] \ + || ![string compare "dg-final-use-autofdo" $cmd] \ || ![string compare "dg-additional-sources" $cmd] \ || [string match "dg-require-*" $cmd] } { set status [catch "$op" errmsg]