From patchwork Mon Jan 25 15:21:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 572764 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 3FEFC140291 for ; Tue, 26 Jan 2016 02:22:09 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=GDjAxibV; 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=FZDq7Y8QfAvk0M/Jl D4OcceAPJt5mKBKQJWGbr5oREKWixNe0LJaF8nKdqDwqbV5mT+UiMPKhKx5ErMMf 86e6rMWQRABJkGPQ8WImY0BVsA+BiC6bEykBNjNFtqVKCB48N+S4UhYb/mFT+M68 yvzlMkMn8/eGy0ChJ1mRK4xsUc= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=omKY1TOPGP+6qKNuIIODm6H 8+S8=; b=GDjAxibV8DqUWr2GwXPtVOdVKV7M9N+c+GYep8GKdS2nUlxOdU7WA6m 1+lcZY9gSnNh7rdWTkudhirvcZgQ1uIyruPDimQ1ALR5aZtWn83ZnzOdwInZ8C3h 8Ewp6wgMYZVs7tQ9vTjsMHRgzvss75YZgcUuWf+fx3FGDqbkU4rw= Received: (qmail 97599 invoked by alias); 25 Jan 2016 15:22:02 -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 97579 invoked by uid 89); 25 Jan 2016 15:22:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=streaming, symtab_node, H*F:D*cz, Hx-languages-length:2723 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 (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 25 Jan 2016 15:21:55 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EA532ABB0; Mon, 25 Jan 2016 15:21:49 +0000 (UTC) Subject: Re: [hsa merge 07/10] IPA-HSA pass To: gcc-patches@gcc.gnu.org References: <20160113173925.220029649@virgil.suse.cz> <20160113173925.776317025@virgil.suse.cz> <20160115095235.GC46287@kam.mff.cuni.cz> <5698DC55.9090303@suse.cz> <20160116100025.GB66559@kam.mff.cuni.cz> Cc: Richard Biener , Jakub Jelinek , Jan Hubicka , Martin Jambor From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <56A63D8E.4070907@suse.cz> Date: Mon, 25 Jan 2016 16:21:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160116100025.GB66559@kam.mff.cuni.cz> X-IsSubscribed: yes On 01/16/2016 11:00 AM, Jan Hubicka wrote: > Can't it be represented via explicit REF_ADDR or something like that? > > Honza Hi. Sure, I've just done a patch that can do that. However, as we're currently in stage4, that change would probably require explicit permission of a release manager? Thanks, Martin From 9639fff94d043c55b55bfb12bb086032db565f0a Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 25 Jan 2016 16:11:00 +0100 Subject: [PATCH] HSA: simplify partitioning of HSA kernels and host impls. gcc/lto/ChangeLog: 2016-01-25 Martin Liska * lto-partition.c (add_symbol_to_partition_1): Remove usage of hsa_summaries. gcc/ChangeLog: 2016-01-25 Martin Liska * hsa.c (hsa_summary_t::link_functions): Create IPA_REF_ADDR reference for an HSA kernel and its host function. --- gcc/hsa.c | 5 +++++ gcc/lto/lto-partition.c | 19 ------------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/gcc/hsa.c b/gcc/hsa.c index ec23f81..f0b3205 100644 --- a/gcc/hsa.c +++ b/gcc/hsa.c @@ -781,6 +781,11 @@ hsa_summary_t::link_functions (cgraph_node *gpu, cgraph_node *host, TREE_OPTIMIZATION (fn_opts)->x_flag_tree_loop_vectorize = false; TREE_OPTIMIZATION (fn_opts)->x_flag_tree_slp_vectorize = false; DECL_FUNCTION_SPECIFIC_OPTIMIZATION (gdecl) = fn_opts; + + /* Create reference between a kernel and a corresponding host implementation + to quarantee LTO streaming to a same LTRANS. */ + if (kind == HSA_KERNEL) + gpu->create_reference (host, IPA_REF_ADDR); } /* Add a HOST function to HSA summaries. */ diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c index eb28fed..9eb63c2 100644 --- a/gcc/lto/lto-partition.c +++ b/gcc/lto/lto-partition.c @@ -34,7 +34,6 @@ along with GCC; see the file COPYING3. If not see #include "ipa-prop.h" #include "ipa-inline.h" #include "lto-partition.h" -#include "hsa.h" vec ltrans_partitions; @@ -171,24 +170,6 @@ add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node) Therefore put it into the same partition. */ if (cnode->instrumented_version) add_symbol_to_partition_1 (part, cnode->instrumented_version); - - /* Add an HSA associated with the symbol. */ - if (hsa_summaries != NULL) - { - hsa_function_summary *s = hsa_summaries->get (cnode); - if (s->m_kind == HSA_KERNEL) - { - /* Add binded function. */ - bool added = add_symbol_to_partition_1 (part, - s->m_binded_function); - gcc_assert (added); - if (symtab->dump_file) - fprintf (symtab->dump_file, - "adding an HSA function (host/gpu) to the " - "partition: %s\n", - s->m_binded_function->name ()); - } - } } add_references_to_partition (part, node); -- 2.7.0