From patchwork Wed Nov 28 21:09:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ploujnikov X-Patchwork-Id: 1004835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-491161-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="GkjSMqlT"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="eB24l61u"; dkim-atps=neutral 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 434tZZ1HvBz9ryk for ; Thu, 29 Nov 2018 08:09:40 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=anC/tmEeER1ZRLBSQ IcXjVt/Nlo2bXUwBHGhXaFXZPuz5KVwkUCbhX13dKU6utdFSPCRgwR0ifagHMdr2 kVethv0ygAFK9LX/sEroSrZFDX+Kry9JpLyEOqgFQ9+r1FX+JVQSVoMKCGiwfl1s vQYbWmQCQGlTbW2l2Pac4BI1aU= 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:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=fIqIxnPBgIVV+8p2GJF04L3 KQkI=; b=GkjSMqlTnLqyL2P/nGiZJmacn8dSpQAziRIQsfb6hfxZHKIie6Wvqw/ j5YONanmz5gT5D6GHhPJ8NUDo+NcNJrritvNsa8DzN3i0eoc6LM71JM8XkNNxRPu Gz6ER+HsBTXVLhESCdwYE7nuYTv011R4FP6ruJyxl0nydhfJtrlw= Received: (qmail 122699 invoked by alias); 28 Nov 2018 21:09:32 -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 122684 invoked by uid 89); 28 Nov 2018 21:09:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=function's, HX-Envelope-From:sk:michael, 747, formal X-HELO: aserp2120.oracle.com Received: from aserp2120.oracle.com (HELO aserp2120.oracle.com) (141.146.126.78) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Nov 2018 21:09:26 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wASL4Cwd053033; Wed, 28 Nov 2018 21:09:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : references : message-id : date : mime-version : in-reply-to : content-type; s=corp-2018-07-02; bh=M9PVDf5nxLnP/o1wtMcQwlL4ggwAYDQSDN2+lWIrEEc=; b=eB24l61uzzKxDbfFbpv5eGyYM9dURDNs7FidTZ9B+5oubo1bc0eLoFtxvZxfqg6dNxqp eIdPOtXdN2ynTh/6yum+Pvi6g1f+VZIi2FLMJC5bPLjA1GpIatMsMAiOHu/0xmQKdMlN eUWbXpkcI8m9VcKjIMCoDXfwh0kc6XW9LI+4IaxSIX+NNa5+EluQpBsq+zW53AKkEq31 6gGI0haifGirbZ0FNZLumhT7GQVnOsSNbby1m2XCrfzKnlsBxNQcNAWu9y69awdD4e0K ihXXCibCwBWGabOHt3Ak0PMvtK5D7hDcrTRP4US1nPhl68bMiE7FK2K8M121ZdVawZxa Dw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2nxxkqmp2v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Nov 2018 21:09:24 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wASL9Ia6025377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Nov 2018 21:09:19 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wASL9G0H021820; Wed, 28 Nov 2018 21:09:17 GMT Received: from [10.39.195.92] (/10.39.195.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 28 Nov 2018 13:09:16 -0800 Subject: [PATCH v3] Make function clone name numbering independent. From: Michael Ploujnikov To: Martin Jambor , Richard Biener Cc: GCC Patches , Jan Hubicka , segher@kernel.crashing.org References: <6A1E6E88-63F7-43E4-8A53-78C7694D34BE@gmail.com> <069cb2a6-2e37-58fb-2009-35e0300270f1@oracle.com> <618e046e-3f28-f008-237d-497bcff2531e@oracle.com> <121c01f4-c1a2-249e-2cac-c6d5ec250fcb@oracle.com> <702ab3f1-fe25-9013-7a1e-f5e1615c9396@oracle.com> <85bd8119-0bce-a06d-df3f-1a1a6ed88187@oracle.com> <3167e521-aa5b-e47c-6d9b-956a1af2a886@oracle.com> <078bf036-f02b-3bdb-545d-3f5ad67bc786@oracle.com> <3f9e8c2a-6112-b595-a932-137958e61f5e@oracle.com> Openpgp: preference=signencrypt Message-ID: Date: Wed, 28 Nov 2018 16:09:14 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <3f9e8c2a-6112-b595-a932-137958e61f5e@oracle.com> X-IsSubscribed: yes Continuing from https://gcc.gnu.org/ml/gcc-patches/2018-09/msg00228.html It took longer than expected, but I've finally rebased this on top of the new clone_function_name* API and included the requested optimizations. There are a few remaining spots where we could probably apply similar optimizations: - gcc/multiple_target.c:create_target_clone - gcc/multiple_target.c:create_dispatcher_calls - gcc/omp-expand.c:grid_expand_target_grid_body But I've yet to figure out how these work in detail and with the new API these shouldn't block the main change from being merged. I've also included a small change to rs6000 which I'm pretty sure is safe, but I have no way of testing. I'm not sure what's the consensus on what's more appropriate, but I thought that it would be a good idea to keep these changes as separate patches since only the first one really changes behaviour, while the rest are optimizations. It's conceivable that someone who is backporting this to an older release might want to just backport the core bits of the change. I can re-submit it as one patch if that's more appropriate. Everything in these patches was bootstrapped and regression tested on x86_64. Ok for trunk? - Michael From a822759e422f0cea11640ec3d6d6fba94bcd4ee9 Mon Sep 17 00:00:00 2001 From: Michael Ploujnikov Date: Wed, 28 Nov 2018 09:24:30 -0500 Subject: [PATCH 4/4] There can be at most one .resolver clone per function gcc: 2018-11-28 Michael Ploujnikov * config/rs6000/rs6000.c (make_resolver_func): Generate resolver symbol with clone_function_name instead of clone_function_name_numbered. --- gcc/config/rs6000/rs6000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git gcc/config/rs6000/rs6000.c gcc/config/rs6000/rs6000.c index 4f113cb025..a9d038829b 100644 --- gcc/config/rs6000/rs6000.c +++ gcc/config/rs6000/rs6000.c @@ -36997,7 +36997,7 @@ make_resolver_func (const tree default_decl, { /* Make the resolver function static. The resolver function returns void *. */ - tree decl_name = clone_function_name_numbered (default_decl, "resolver"); + tree decl_name = clone_function_name (default_decl, "resolver"); const char *resolver_name = IDENTIFIER_POINTER (decl_name); tree type = build_function_type_list (ptr_type_node, NULL_TREE); tree decl = build_fn_decl (resolver_name, type); -- 2.19.1