From patchwork Wed May 20 12:09:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Kulkarni X-Patchwork-Id: 48797 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 87EAA2121F for ; Wed, 20 May 2015 12:09:39 +0000 (UTC) Received: by lagr1 with SMTP id r1sf16636341lag.3 for ; Wed, 20 May 2015 05:09:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:mime-version:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-original-sender :x-original-authentication-results; bh=xrELwKBO+cqZPrQLZxtp1uDCu8EcWlMRl8WCE5U4m8o=; b=gtezFKo1C0yp5q56ABR3vEDExOD9pUQIr2lot4nCzhG8HQrnPv9eBCMoR4R2u3sNY3 y1qy3V3Ue6meR9boOM/20dTmx05hRJ2B3yBl9rxF42PCoXzEnvxoKKzcN4KtqnoWrx+F aSKvoXBtBNSV/jxwgft8zVj98ERYQrWb0g6Hi05guZXFEJVGpBdObGSa6VlE5tF6w6f9 o2go2M0xR6b9rKKoqjqh+AMHbam09/YG4zTEgKiPp8jAssB+QjNPV4MdPdelsSpOxAzb 8Jf47dWXbRZyYvgkMI+aX0upcZdbhqkAElt4DeKRKyFZCLeth/G0mPiEtvw1X4vx1sXC pxbA== X-Gm-Message-State: ALoCoQlixifUdHM+GkpcxIfSH65YD5lc8Et3RTaCCcJ4IzY9tHrfuK5hHfrZQysBn1xhAscWFKJ5 X-Received: by 10.112.162.228 with SMTP id yd4mr26160101lbb.8.1432123778320; Wed, 20 May 2015 05:09:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.7 with SMTP id js7ls176418lab.34.gmail; Wed, 20 May 2015 05:09:38 -0700 (PDT) X-Received: by 10.112.151.4 with SMTP id um4mr4612022lbb.95.1432123778173; Wed, 20 May 2015 05:09:38 -0700 (PDT) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com. [2a00:1450:4010:c03::236]) by mx.google.com with ESMTPS id r7si11033401lae.163.2015.05.20.05.09.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 05:09:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::236 as permitted sender) client-ip=2a00:1450:4010:c03::236; Received: by laat2 with SMTP id t2so70191896laa.1 for ; Wed, 20 May 2015 05:09:38 -0700 (PDT) X-Received: by 10.152.9.66 with SMTP id x2mr25590117laa.36.1432123777981; Wed, 20 May 2015 05:09:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1484164lbb; Wed, 20 May 2015 05:09:36 -0700 (PDT) X-Received: by 10.66.66.173 with SMTP id g13mr18960373pat.155.1432123775673; Wed, 20 May 2015 05:09:35 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id iv3si26109447pbb.202.2015.05.20.05.09.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 05:09:35 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-398380-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 36838 invoked by alias); 20 May 2015 12:09:21 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 36827 invoked by uid 89); 20 May 2015 12:09:20 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f53.google.com Received: from mail-la0-f53.google.com (HELO mail-la0-f53.google.com) (209.85.215.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 20 May 2015 12:09:19 +0000 Received: by laat2 with SMTP id t2so70177248laa.1 for ; Wed, 20 May 2015 05:09:15 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.152.30.100 with SMTP id r4mr25170646lah.107.1432123755377; Wed, 20 May 2015 05:09:15 -0700 (PDT) Received: by 10.25.205.146 with HTTP; Wed, 20 May 2015 05:09:15 -0700 (PDT) In-Reply-To: References: Date: Wed, 20 May 2015 17:39:15 +0530 Message-ID: Subject: Re: [match-and-simplify] reject expanding operator-list to implicit 'for' From: Prathamesh Kulkarni To: Richard Biener Cc: gcc Patches X-IsSubscribed: yes X-Original-Sender: prathamesh.kulkarni@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::236 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 On 20 May 2015 at 17:01, Richard Biener wrote: > On Wed, 20 May 2015, Prathamesh Kulkarni wrote: > >> On 20 May 2015 at 16:17, Prathamesh Kulkarni >> wrote: >> > Hi, >> > This patch rejects expanding operator-list to implicit 'for'. >> On second thoughts, should we reject expansion of operator-list _only_ >> if it's mixed with 'for' ? > > At least that, yes. > >> We could define multiple operator-lists in simplify to be the same as >> enclosing the simplify in 'for' with number of iterators >> equal to number of operator-lists. >> So we could allow >> (define_operator_list op1 ...) >> (define_operator_list op2 ...) >> >> (simplify >> (op1 (op2 ... ))) >> >> is equivalent to: >> (for temp1 (op1) >> temp2 (op2) >> (simplify >> (temp1 (temp2 ...)))) >> >> I think we have patterns like these in match-builtin.pd in the >> match-and-simplify branch >> And reject mixing of 'for' and operator-lists. >> Admittedly the implicit 'for' behavior is not obvious from the syntax -;( > > Hmm, indeed we have for example > > /* Optimize pow(1.0,y) = 1.0. */ > (simplify > (POW real_onep@0 @1) > @0) > > and I remember wanting that implicit for to make those less ugly. > > So can you rework only rejecting it within for? This patch rejects expanding operator-list inside 'for'. OK for trunk after bootstrap+testing ? Thanks, Prathamesh > > Thanks, > Richard. > > >> Thanks, >> Prathamesh >> > OK for trunk after bootstrap+testing ? >> > >> > Thanks, >> > Prathamesh >> >> > > -- > Richard Biener > SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nuernberg) 2015-05-20 Prathamesh Kulkarni * genmatch.c (parser::parse_operation): Reject expanding operator-list inside 'for'. Index: genmatch.c =================================================================== --- genmatch.c (revision 223437) +++ genmatch.c (working copy) @@ -2913,7 +2913,10 @@ user_id *p = dyn_cast (op); if (p && p->is_oper_list) - record_operlist (id_tok->src_loc, p); + if (active_fors.length() == 0) + record_operlist (id_tok->src_loc, p); + else + fatal_at (id_tok, "operator-list %s cannot be exapnded inside 'for'", id); return op; }