From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122639 invoked by alias); 15 May 2019 17:59:08 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 122531 invoked by uid 89); 15 May 2019 17:59:08 -0000 Authentication-Results: sourceware.org; auth=none 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.1 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 May 2019 17:59:07 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FHvVcr060854; Wed, 15 May 2019 13:59:04 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 2sgmm7t60k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 May 2019 13:59:04 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x4FBwaAt021625; Wed, 15 May 2019 12:03:27 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma01dal.us.ibm.com with ESMTP id 2sdp14y3mp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 May 2019 12:03:27 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4FHx2xu38666706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 May 2019 17:59:02 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CE782112062; Wed, 15 May 2019 17:59:01 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6D398112067; Wed, 15 May 2019 17:59:01 +0000 (GMT) Received: from ragesh4.rchland.ibm.com (unknown [9.10.86.76]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 15 May 2019 17:59:01 +0000 (GMT) Subject: Re: Fixing inline expansion of overlapping memmove and non-overlapping memcpy To: Jakub Jelinek Cc: Michael Matz , Richard Biener , GCC Development , Joseph Myers , Jeff Law , Segher Boessenkool , David Edelsohn , Bill Schmidt References: <21ca63aa-3838-e2ae-bf6e-39ec1b98dca4@linux.ibm.com> <20190515163129.GL19695@tucnak> From: Aaron Sawdey Message-ID: <70750ab4-d51a-0d52-41c2-9f8157016790@linux.ibm.com> Date: Wed, 15 May 2019 17:59:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190515163129.GL19695@tucnak> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00121.txt.bz2 On 5/15/19 11:31 AM, Jakub Jelinek wrote: > On Wed, May 15, 2019 at 11:23:54AM -0500, Aaron Sawdey wrote: >> My goals for this are: >> * memcpy() call becomes __builtin_memcpy and goes to optab[cpymem] >> * memmove() call becomes __builtin_memmove (or __builtin_memcpy based >> on the gimple analysis) and goes through optab[movmem] or optab[cpymem] > > Except for the becomes part (the memcpy call is the same thing as > __builtin_memcpy in the middle-end, all you care about if it is > BUILT_IN_MEMCPY etc. and whether it has compatible arguments), and for the > missing optab[movmem] part and movmem->cpymem renaming, isn't that what we > have already? Yes. I was just trying to state what I wanted it to become, some of which is already present. So I think I will start working on two patches: 1) rename optab movmem and the underlying patterns to cpymem. 2) add a new optab movmem that is really memmove() and add support for having __builtin_memmove() use it. Handling of the partial overlap case can be a separate piece of work. Thanks, Aaron -- Aaron Sawdey, Ph.D. acsawdey@linux.vnet.ibm.com 050-2/C113 (507) 253-7520 home: 507/263-0782 IBM Linux Technology Center - PPC Toolchain