From patchwork Wed Jan 11 10:25:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 713674 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 3tz4mK1Qrbz9s2G for ; Wed, 11 Jan 2017 21:25:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="VhFV5FJ5"; 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:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=H3OKn9M/vUAakS639KQZj4QS2ubcI2 TsFwx9pQ7tGTQweElC7FgSfoFDNaQ/uhVFGjMD4yDaMGrLqfgo6zOzcOwnMQ6YYl KtS+22g3rfN+zfh7sYKR3PklhfZV9Yi4Q0GOr0HeaRQ8/+1Zx0uqteEaJaI/6HoC r0eBQN/jMb5iI= 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:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=5+bsoDsbGQbSAgxHgYyQ2g62ufM=; b=VhFV 5FJ5htYZ542bY+sGNRQLYlZSafjfJ2dxMNTk1QgQC5oj0H3qBuZew56IOcvQa6N4 rmHJXjuejPEfwAt7xbBzMlF5C/p0LRYNwldXGghc/RwZncIkK/gD/ywxflFn35jC HiqSWoUJUG45z7cmSbFhrQ/+CiNUVRqKHQT28ho= Received: (qmail 24180 invoked by alias); 11 Jan 2017 10:25:45 -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 24159 invoked by uid 89); 11 Jan 2017 10:25:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=moments, decorated, callable, 2017-01-11 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Jan 2017 10:25:33 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 91746AAC8 for ; Wed, 11 Jan 2017 10:25:31 +0000 (UTC) Date: Wed, 11 Jan 2017 11:25:31 +0100 From: Martin Jambor To: GCC Patches Subject: Re: [hsa] Exclude parallel outlines from hsa_callable_functions_p Message-ID: <20170111102530.uca7h6sd64i4dt3y@virgil.suse.cz> Mail-Followup-To: GCC Patches References: <20161202135546.thd5qiepimc4gvou@virgil.suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161202135546.thd5qiepimc4gvou@virgil.suse.cz> User-Agent: Mutt/1.6.2 (2016-07-01) X-IsSubscribed: yes Hi, On Fri, Dec 02, 2016 at 02:55:46PM +0100, Martin Jambor wrote: > Hi, > > after the merge of nvidia OpenMP implementation, the normal parallel > outline functions were also marked as "omp declare target" which lead > to them being cloned and compiled to HSA which is not only unnecessary > but often leads to a lot of useless HSA warning noise. The following > patch deal with this issue by making sure they are not considered > callable from HSA. > > > 2016-11-29 Martin Jambor > > * hsa.c (hsa_callable_function_p): Return false for artificial > functions. This actually broke a few HSA tests in libgomp suite when compiling with -O0 and I apparently somehow did not inspected the test results properly. The artificial test must only apply to cloning decisions, because later our own function (as opposed to kernel) decls have that bit set too. I will commit the following (bootstrapped and hsa-tested) fix in a few moments. Thanks, Martin 2017-01-11 Martin Jambor * hsa.c (hsa_callable_function_p): Revert addition of DECL_ARTIFICIAL test. * ipa-hsa.c (process_hsa_functions): Only duplicate non-artificial decorated functions. --- gcc/hsa.c | 5 +---- gcc/ipa-hsa.c | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/hsa.c b/gcc/hsa.c index c0ed9f82bf3..2035ce446a1 100644 --- a/gcc/hsa.c +++ b/gcc/hsa.c @@ -90,10 +90,7 @@ bool hsa_callable_function_p (tree fndecl) { return (lookup_attribute ("omp declare target", DECL_ATTRIBUTES (fndecl)) - && !lookup_attribute ("oacc function", DECL_ATTRIBUTES (fndecl)) - /* At this point, this is enough to identify clones for - parallel, which for HSA would need to be kernels anyway. */ - && !DECL_ARTIFICIAL (fndecl)); + && !lookup_attribute ("oacc function", DECL_ATTRIBUTES (fndecl))); } /* Allocate HSA structures that are are used when dealing with different diff --git a/gcc/ipa-hsa.c b/gcc/ipa-hsa.c index 4391b580566..6a3f660672e 100644 --- a/gcc/ipa-hsa.c +++ b/gcc/ipa-hsa.c @@ -100,7 +100,10 @@ process_hsa_functions (void) clone->name (), s->m_kind == HSA_KERNEL ? "kernel" : "function"); } - else if (hsa_callable_function_p (node->decl)) + else if (hsa_callable_function_p (node->decl) + /* At this point, this is enough to identify clones for + parallel, which for HSA would need to be kernels anyway. */ + && !DECL_ARTIFICIAL (node->decl)) { if (!check_warn_node_versionable (node)) continue;