From patchwork Fri Dec 2 13:55:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 701968 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 3tVbKT5bQtz9tB1 for ; Sat, 3 Dec 2016 00:56:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ImqXSd4o"; 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:mime-version:content-type; q=dns; s= default; b=wUkN7Ec+GYqzS9gxPMcyb3lLOg+ZdG6K415Cu46o+D39oazd72Wy1 KpNkpXoWbWDh5VQqfgpy7spjEeYU+vTm+jOAwidJUlxR8slzZ9GGMJS2KA6hv/MU NurToZli8vmogYCqt23PkJ12gXNyBgiGC8xkBQjac0LVbsNzPDQKFc= 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:mime-version:content-type; s= default; bh=xLEs3PrrpiE+vIm2KMyZIxNBe+w=; b=ImqXSd4oO+sKggQy5FOq hSqY3/ZWgovS568wRICwoGkc31XrboRy8oCEyDu+2qvVELrj1nQ602of0nqrPeZ8 bn1yeNB9+rVto8xovuJtmk/ncdMlUUQ59325EuwBb29zPCTxenMjH8ff0GNLCu05 GVEeAU+LSBe11EEeHc8MJGo= Received: (qmail 5303 invoked by alias); 2 Dec 2016 13:56:00 -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 5281 invoked by uid 89); 2 Dec 2016 13:55:59 -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=Hx-languages-length:1468, moments, artificial 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; Fri, 02 Dec 2016 13:55:49 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 93BD8ADB8 for ; Fri, 2 Dec 2016 13:55:47 +0000 (UTC) Date: Fri, 2 Dec 2016 14:55:46 +0100 From: Martin Jambor To: GCC Patches Subject: [hsa] Exclude parallel outlines from hsa_callable_functions_p Message-ID: <20161202135546.thd5qiepimc4gvou@virgil.suse.cz> Mail-Followup-To: GCC Patches MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.2 (2016-07-01) X-IsSubscribed: yes 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. Bootstrapped and tested on x86_64-linux. I will commit it to trunk in a few moments (it is already part of my most recent merge from trunk to the hsa branch. Thanks, Martin Exclude parallel outlines from hsa_callable_functions_p 2016-11-29 Martin Jambor * hsa.c (hsa_callable_function_p): Return false for artificial functions. --- gcc/hsa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/hsa.c b/gcc/hsa.c index f881e78..31e3252 100644 --- a/gcc/hsa.c +++ b/gcc/hsa.c @@ -90,7 +90,10 @@ bool hsa_callable_function_p (tree fndecl) { return (lookup_attribute ("omp declare target", DECL_ATTRIBUTES (fndecl)) - && !lookup_attribute ("oacc function", 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)); } /* Allocate HSA structures that are are used when dealing with different