From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from server.nextmovesoftware.com (server.nextmovesoftware.com [162.254.253.69]) by sourceware.org (Postfix) with ESMTPS id 1B46F385737E for ; Thu, 12 May 2022 07:14:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1B46F385737E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nextmovesoftware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nextmovesoftware.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nextmovesoftware.com; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:In-Reply-To:References:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=MMCO7WrevvTwf9JukCW/fqrlN5Kt4CEwTqsrgtT9Pgw=; b=C2v0aXt7A97rUhFJDFm87PNU6g 0l4nv6DvefZ+TMec6l9Wom9YM4zewwEPBXS1XZG7WA2sJmUH5HxxIsvEGG9GrW/wvSlIi1RPrafL5 42nJuTnVmTEEBMsd2YHxIK2eN8GabUE7qQP0xbuH4oiK7/VyPNUgU24+uT/Wg997wVr7uPeMDbe// taWeSqTS93+p7HbDvK2uJDbjlutlraOjvRl5hK1ZStXrKMmFP0B9Na++pyWlPzE4F+YVtcSayOC+u Ztf0zoGrX/dcN28DDsYeCxsLcQN1NM1HgttHKrqOrR+wMCQ6YY38ZZDGU/7YeewmaH2+adX0rSJ7l GnPksATQ==; Received: from host109-154-46-241.range109-154.btcentralplus.com ([109.154.46.241]:63484 helo=Dell) by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1np320-0006bz-EW; Thu, 12 May 2022 03:14:40 -0400 From: "Roger Sayle" To: "'Jeff Law'" Cc: References: <014201d8267a$206e1320$614a3960$@nextmovesoftware.com> <7da496e6-ee9b-e6ae-f4ed-dbadeef694ed@gmail.com> In-Reply-To: <7da496e6-ee9b-e6ae-f4ed-dbadeef694ed@gmail.com> Subject: RE: [PATCH] PR tree-optimization/83907: Improved memset handling in strlen pass. Date: Thu, 12 May 2022 08:14:38 +0100 Message-ID: <000601d865cf$f1d392c0$d57ab840$@nextmovesoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJV+IJVNdS6VoSQ9oRXMBYwGBOJ+QKUGCFkrAsNgJA= Content-Language: en-gb X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextmovesoftware.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - nextmovesoftware.com X-Get-Message-Sender-Via: server.nextmovesoftware.com: authenticated_id: roger@nextmovesoftware.com X-Authenticated-Sender: server.nextmovesoftware.com: roger@nextmovesoftware.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2022 07:14:42 -0000 Hi Jeff, Any chance you could take a look at this patch, now that we're back in = stage1? Thanks in advance, Roger > -----Original Message----- > From: Jeff Law > Sent: 02 March 2022 19:33 > To: Roger Sayle ; gcc-patches@gcc.gnu.org > Subject: Re: [PATCH] PR tree-optimization/83907: Improved memset = handling in > strlen pass. >=20 > On 2/20/2022 9:51 AM, Roger Sayle wrote: > > This patch implements the missed optimization enhancement PR 83907, = by > > handling memset with a constant byte value in tree-ssa's strlen > > optimization pass. Effectively, this treats memset(dst,'x',3) as it > > would memcpy(dst,"xxx",3). > > > > This patch also includes a tweak to handle_store to address another > > missed optimization observed in the related test case pr83907-2.c. > > The consecutive byte stores to memory get coalesced into a vector > > write of a vector const, but unfortunately tree-ssa-strlen's > > handle_store didn't previously handle the (unusual) case where the > > stored "string" starts with a zero byte but also contains non-zero > > bytes. > > > > This patch has been tested on x86_64-pc-linux-gnu with make = bootstrap > > and make -k check with no new failures. Ok for mainline? > > > > > > 2022-02-20 Roger Sayle > > > > gcc/ChangeLog > > PR tree-optimization/83907 > > * tree-ssa-strlen.cc (handle_builtin_memset): Record a strinfo > > for memset with an constant char value. > > (handle_store): Improved handling of stores with a first byte > > of zero, but not storing_all_zeros_p. > > > > gcc/testsuite/ChangeLog > > PR tree-optimization/83907 > > * gcc.dg/tree-ssa/pr83907-1.c: New test case. > > * gcc.dg/tree-ssa/pr83907-2.c: New test case. > Deferring to stage1. > jeff