From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46586 invoked by alias); 27 Sep 2016 08:43:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 46570 invoked by uid 89); 27 Sep 2016 08:43:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-wm0-f67.google.com Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Sep 2016 08:43:37 +0000 Received: by mail-wm0-f67.google.com with SMTP id w84so6507wmg.0 for ; Tue, 27 Sep 2016 01:43:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hdrMq1Ef/JM0jzhoymXt3wOVgCyBgLwZtIbcF3C9Ojk=; b=PTK+5tHo04gkcLIIcfgwoqwX48wrLwqMaVuRTw6TB+uC+OEn8+gj4cfz+GHdzKdOah Tumj/Eqhafw3HrfPmu8BBqIB8JvrMUAepSL+fK3u1LvvZG98/IIjva9bLElwtta2j6bW 6RGsjDpzC7r8YLLToR5wBdmWtGu3kZ1Czi4eVbaZcUEdD7o/45hSXZCvCsBqocqqQqsG Il4KXOBV9M7uHlrwTORGrZTpe6KHRxJTkp+ASP8+nmulmOEmlb5tpTWeA0O6m0UFpq91 5snqPFRa2T2uDYwdrSl68iUMVTvpuHfu5ucZSVuMbZJ8dhk5AdR2fGP1wtXvx9Bl2+61 hlQg== X-Gm-Message-State: AA6/9RmlXz2hgFbIyBgxYeOL4aUe97ci3FibU7OcypBFYJHxBuTzBvogSawuyxnBAlRW/NbSopiBeD7wpYuHVA== X-Received: by 10.28.207.193 with SMTP id f184mr1867994wmg.40.1474965815659; Tue, 27 Sep 2016 01:43:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.137.129 with HTTP; Tue, 27 Sep 2016 01:43:35 -0700 (PDT) In-Reply-To: <1474639855.2578.2.camel@t-online.de> References: <1474639855.2578.2.camel@t-online.de> From: Richard Biener Date: Tue, 27 Sep 2016 09:07:00 -0000 Message-ID: Subject: Re: [PATCH v3] Optimize strchr to strlen To: Oleg Endo Cc: Wilco Dijkstra , GCC Patches , nd , Jakub Jelinek Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg01910.txt.bz2 On Fri, Sep 23, 2016 at 4:10 PM, Oleg Endo wrote: > On Fri, 2016-09-23 at 14:07 +0000, Wilco Dijkstra wrote: >> After discussion (https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00718 >> .html) >> here is the latest version of the strchr patch. This uses a gimple >> statement for >> the pointer addition so the gsi_prev always points at the strlen >> call. >> >> Optimize strchr (s, 0) to s + strlen (s). strchr (s, 0) appears a >> common >> idiom for finding the end of a string, however it is not a very >> efficient >> way of doing so. Strlen is a much simpler operation which is >> significantly >> faster (eg. on x86 strlen is 50% faster for strings of 8 bytes and >> about >> twice as fast as strchr on strings of 1KB). >> >> OK for commit? > > Please add PR tree-optimization/61056 to the changelog so that it gets > linked in bugzilla. Yes. Also you should strip gcc/ and gcc/testsuite from the filenames in the changelog entry as this entries are for gcc/ChangeLog and gcc/testsuite/ChangeLog. Ok with that changelog changes. Thanks, Richard. > Cheers, > Oleg