From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44347 invoked by alias); 26 Jun 2017 10:16:44 -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 44326 invoked by uid 89); 26 Jun 2017 10:16:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 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=ca X-HELO: mail-ot0-f171.google.com Received: from mail-ot0-f171.google.com (HELO mail-ot0-f171.google.com) (74.125.82.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Jun 2017 10:16:42 +0000 Received: by mail-ot0-f171.google.com with SMTP id 95so64447643ott.3 for ; Mon, 26 Jun 2017 03:16:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wfDrijCsUGKYrLfaY8gKu055oid92ulWA2U4wAkACR4=; b=Uh5w8AOFuw88wXD+kLvESULYCmymW4UdxeeSF6zVMbCgftfIYrLoYh8V4Y+kKYX+59 vuug2/1lp2kvT6DzrwqrhWvIovQmlvWzKCh5CmYTG8fgtTjbcKqHQYDt9HVEx0+Is1cW bMHlTBlT8YmKyC0zZYoIpgfJQNGHKv7Q4PQDNSyFcPS4bFQVpseD7LEuDfbVUAXVC8LW 1S1FYNIMrwXaw72vd6+PAhzwABLEhMaZ60+G5zJSGNLdct+/YXgt9FFPDJiQfaHlTcCW 9ycelrLRxhIzccntqUWkUS4tgbV2Fd8wuTKzvixPtmgn2GjEKF42cBXxfKyDLgX4q4Bw w2yA== X-Gm-Message-State: AKS2vOyZR5105a6jv/KsZXinVJNhQoBChQ3bGNj/E2ffotwsprrj1C5G CdjysY8TBNRWnJcs2zig8V2T0wZV2g== X-Received: by 10.157.38.164 with SMTP id l33mr13043482otb.197.1498472200462; Mon, 26 Jun 2017 03:16:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.37.66 with HTTP; Mon, 26 Jun 2017 03:16:40 -0700 (PDT) In-Reply-To: References: From: Richard Biener Date: Mon, 26 Jun 2017 10:16:00 -0000 Message-ID: Subject: Re: Simple reassoc transforms in match.pd To: Marc Glisse Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01902.txt.bz2 On Fri, Jun 23, 2017 at 3:12 PM, Marc Glisse wrote: > Hello, > > here are a few simple transformations, mostly useful for types with > undefined overflow where we do not have reassoc. > > I did not name the testcase reassoc-* to leave that namespace to the realloc > pass, and -fno-tree-reassoc is just in case someone ever enhances that > pass... You probably saw /* (T)(P + A) - (T)(P + B) -> (T)A - (T)B */ (for add (plus pointer_plus) (simplify (minus (convert (add @@0 @1)) (convert (add @0 @2))) as you didn't duplicate its functionality. It misses a :c in one of the adds for the PLUS_EXPR case though so it might be worth splitting that out near to your added cases? Which then raises the question of handling conversions around the inner ops in your patterns? I think the patch is ok as-is but we could improve this as a followup maybe? Thanks, Richard. > Bootstrap + testsuite on powerpc64le-unknown-linux-gnu. > > 2017-06-23 Marc Glisse > > gcc/ > * match.pd ((A+-B)+(C-A), (A+B)-(A-C)): New transformations. > > gcc/testsuite/ > * gcc.dg/tree-ssa/assoc-1.c: New file. > > -- > Marc Glisse