From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10035 invoked by alias); 28 Jun 2011 12:04:02 -0000 Received: (qmail 10016 invoked by uid 22791); 28 Jun 2011 12:04:00 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Jun 2011 12:03:47 +0000 Received: by wyg30 with SMTP id 30so107876wyg.20 for ; Tue, 28 Jun 2011 05:03:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.58.71 with SMTP id f7mr6484971wbh.110.1309262625898; Tue, 28 Jun 2011 05:03:45 -0700 (PDT) Received: by 10.227.36.212 with HTTP; Tue, 28 Jun 2011 05:03:45 -0700 (PDT) In-Reply-To: <4E09B142.4020402@codesourcery.com> References: <4E034EF2.3070503@codesourcery.com> <4E03504B.9060305@codesourcery.com> <4E044559.5000105@linaro.org> <1A77B5B39081C241A68E6CF16983025F020906F6@EU1-MAIL.mgc.mentorg.com> <4E09B142.4020402@codesourcery.com> Date: Tue, 28 Jun 2011 12:48:00 -0000 Message-ID: Subject: Re: [PATCH (3/7)] Widening multiply-and-accumulate pattern matching From: Richard Guenther To: Andrew Stubbs Cc: gcc-patches@gcc.gnu.org, patches@linaro.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2011-06/txt/msg02126.txt.bz2 On Tue, Jun 28, 2011 at 12:47 PM, Andrew Stubbs w= rote: > On 24/06/11 16:47, Richard Guenther wrote: >>> >>> I can certainly add checks to make sure that the skipped operations >>> > =A0actually don't make any important changes to the value, but do I n= eed >>> > to? >> >> Yes. > > OK, how about this patch? I'd name the predicate value_preserving_conversion_p which I think is what you mean. harmless isn't really descriptive. Note that you include non-value-preserving conversions, namely int -> unsigned int. Don't dispatch to useless_type_conversion_p, it's easy to enumerate which conversions are value-preserving. Don't try to match the tree_ssa_useless_* set of functions, instead put the value_preserving_conversion_p predicate in tree.[ch] and a suitable function using it in tree-ssa-math-opts.c. Thanks, Richard. > I've added checks to make sure the value is not truncated at any point. > > I've also changed the test cases to address Janis' comments. > > Andrew >