From patchwork Thu Jun 4 14:42:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 480756 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 B8CCC1401F6 for ; Fri, 5 Jun 2015 00:43:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=PD4qwuW1; 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=W8IE4hL2ECw1BtwxL sEkAKTWHJuVoJtTebS9N/zsWhLVGzDqpxPGXkhF6l0DpwLmVRkpyS67bqT22qZaX dvMo/q/1VgiZhMXfXTAWXguEoxG5CweXXXJfty1ocJX5brz03g0dytj0J6owY0K+ ZFT73qcDjXIJ0+WAFG3tQ0UktM= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=F3BbnZbcAlSRdcZCt/ncrnZ DVzs=; b=PD4qwuW1hjr2m16OON3YUkb6stxU0MiRNy14j1a8bHr+/RosaBykVMJ CSNf2BqOD135PGJn0SV2DWKcrV6yD4AI0FgM4FWFK1RhACYyxBj9vrmhr6BlmS7e uKr5lQxnNvjR2LsNjMdcZ/TsMTB9P1CqAtkhUTpDZ5SUvWCZzTVk= Received: (qmail 26369 invoked by alias); 4 Jun 2015 14:43:08 -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 26354 invoked by uid 89); 4 Jun 2015 14:43:07 -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, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 04 Jun 2015 14:43:06 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57092) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Z0WMK-00048x-72 for gcc-patches@gnu.org; Thu, 04 Jun 2015 10:43:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0WMF-0000Dv-MQ for gcc-patches@gnu.org; Thu, 04 Jun 2015 10:43:03 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:33186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0WMF-0000DL-G1 for gcc-patches@gnu.org; Thu, 04 Jun 2015 10:42:59 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Z0WMD-0005M4-RM from Tom_deVries@mentor.com ; Thu, 04 Jun 2015 07:42:58 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Thu, 4 Jun 2015 15:42:56 +0100 Message-ID: <557063EB.5050109@mentor.com> Date: Thu, 4 Jun 2015 16:42:51 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Richard Biener CC: Subject: Re: [PATCH] Add debug msg to dump_file in add_new_function References: <55705090.1000705@mentor.com> In-Reply-To: <55705090.1000705@mentor.com> X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 On 04/06/15 15:20, Tom de Vries wrote: > Hi, > > [ posted earlier as part of "Don't dump low gimple functions in gimple > dump", https://gcc.gnu.org/ml/gcc-patches/2014-05/msg01586.html, > currently discussed at: > https://gcc.gnu.org/ml/gcc-patches/2015-05/msg02076.html ] > > This patch adds a debug msg to dump_file in cgraph_node::add_new_function. > Added "ssa gimple" case for ompexpssa, and corresponding test-case. > OK for trunk (after retesting)? > Thanks, - Tom Add debug msg to dump_file in add_new_function 2014-06-04 Tom de Vries * cgraphunit.c (cgraph_node::add_new_function): Dump message on new function. * gcc.dg/gomp/notify-new-function-2.c: New test. * gcc.dg/gomp/notify-new-function-3.c: Same. * gcc.dg/gomp/notify-new-function.c: Same. --- gcc/cgraphunit.c | 17 +++++++++++++++++ gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c | 20 ++++++++++++++++++++ gcc/testsuite/gcc.dg/gomp/notify-new-function-3.c | 14 ++++++++++++++ gcc/testsuite/gcc.dg/gomp/notify-new-function.c | 17 +++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c create mode 100644 gcc/testsuite/gcc.dg/gomp/notify-new-function-3.c create mode 100644 gcc/testsuite/gcc.dg/gomp/notify-new-function.c diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 8d97163..5a62223 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -503,6 +503,23 @@ cgraph_node::add_new_function (tree fndecl, bool lowered) { gcc::pass_manager *passes = g->get_passes (); cgraph_node *node; + + if (dump_file) + { + struct function *fn = DECL_STRUCT_FUNCTION (fndecl); + const char *function_type = ((gimple_has_body_p (fndecl)) + ? (lowered + ? (gimple_in_ssa_p (fn) + ? "ssa gimple" + : "low gimple") + : "high gimple") + : "to-be-gimplified"); + fprintf (dump_file, + "Added new %s function %s to callgraph\n", + function_type, + fndecl_name (fndecl)); + } + switch (symtab->state) { case PARSING: diff --git a/gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c b/gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c new file mode 100644 index 0000000..e9c8939 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -fdump-tree-omplower" } */ + +void __attribute__((noinline)) +baz (int *p) +{ +} + +void +foo (void) +{ + int p[2]; + p[0] = 1; + p[1] = 3; + #pragma omp task firstprivate (p) + baz (p); +} + +/* Check for new function notification in omplower dump. */ +/* { dg-final { scan-tree-dump-times "Added new high gimple function foo\\._omp_cpyfn\\.1 to callgraph" 1 "omplower" } } */ diff --git a/gcc/testsuite/gcc.dg/gomp/notify-new-function-3.c b/gcc/testsuite/gcc.dg/gomp/notify-new-function-3.c new file mode 100644 index 0000000..f173b8e --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/notify-new-function-3.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-ompexpssa" } */ + +void +foo (int *__restrict a, int *__restrict b, int *__restrict c) +{ + int i; + for (i = 0; i < 1000; ++i) + c[i] = a[i] + b[i]; +} + + +/* Check for new function notification in ompexpssa dump. */ +/* { dg-final { scan-tree-dump-times "Added new ssa gimple function foo\\._loopfn\\.0 to callgraph" 1 "ompexpssa" } } */ diff --git a/gcc/testsuite/gcc.dg/gomp/notify-new-function.c b/gcc/testsuite/gcc.dg/gomp/notify-new-function.c new file mode 100644 index 0000000..4770a6b --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/notify-new-function.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -fdump-tree-ompexp" } */ + +int +main (void) +{ +#pragma omp parallel + { + extern void foo (void); + foo (); + } + return 0; +} + + +/* Check for new function notification in ompexp dump. */ +/* { dg-final { scan-tree-dump-times "Added new low gimple function main\\._omp_fn\\.0 to callgraph" 1 "ompexp" } } */ -- 1.9.1