From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112441 invoked by alias); 5 Aug 2015 16:08:04 -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 112429 invoked by uid 89); 5 Aug 2015 16:08:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Aug 2015 16:08:03 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-23--NjbwDAPQm-En22gchXIxg-1; Wed, 05 Aug 2015 17:07:57 +0100 Received: from [10.2.207.65] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 5 Aug 2015 17:07:56 +0100 Message-ID: <55C234DC.9050709@arm.com> Date: Wed, 05 Aug 2015 16:08:00 -0000 From: Alan Lawrence User-Agent: Thunderbird 2.0.0.24 (X11/20101213) MIME-Version: 1.0 To: Richard Biener CC: Michael Collison , gcc Patches Subject: Re: [PATCH] Optimize certain end of loop conditions into min/max operation References: <55B5A884.4060105@linaro.org> In-Reply-To: X-MC-Unique: -NjbwDAPQm-En22gchXIxg-1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00301.txt.bz2 Richard Biener wrote: > Furthermore it doesn't work for three such ops which would require > an additional pattern like >=20 > (simplfiy > (bit_and:c (op @0 (min @1 @2)) (op @0 @3)) > (op @0 (min (min @1 @2) @3)))) >=20 > if that's profitable? Shouldn't that be just a case of binding @1 in the original pattern: >> +/* Transform (@0 < @1 and @0 < @2) to use min */ >> +(for op (lt le) >> +(simplify >> +(bit_and:c (op @0 @1) (op @0 @2)) >> +(if (INTEGRAL_TYPE_P (TREE_TYPE (@0))) >> +(op @0 (min @1 @2))))) to (min @1 @2) in your three-way pattern, @2 in the original to @3 in yours= , and=20 @0 to @0 ? Or is @1 not allowed to bind to a 'min' ? Secondly: should/can Michael's fix reference PR57600 ? Cheers, Alan