From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100311 invoked by alias); 24 Jul 2017 14:37:53 -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 100276 invoked by uid 89); 24 Jul 2017 14:37:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 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=Hx-languages-length:2067 X-HELO: mail-ua0-f195.google.com Received: from mail-ua0-f195.google.com (HELO mail-ua0-f195.google.com) (209.85.217.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Jul 2017 14:37:51 +0000 Received: by mail-ua0-f195.google.com with SMTP id k43so5561756uaf.1 for ; Mon, 24 Jul 2017 07:37:51 -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=ZX31FxoHxzmFQXGlJpwkKDsj9ipOdMg8onzOYLRSP7s=; b=cWF4t8tvUn5UPGfJPg7RfaDBiGKTe/gRyBuHbDv99eZDREp0trD0BhYI2xUlK8VsuY FovZBOXs28EOb64UKsqPLXszLiVY24aYLPPhaoeeVgzVs7E7bXms7j3kktYdYyudDYGV A7JO8YVhbIJ5ONMOSkc4GWl7T7H3SoFv5HZJuxJmbw8XIjVvJbapZ00G3AV0jiF5sRy1 pOUx28pwJFATbRzn8/sWR9iT5n+y/EF8+AnTSoGzPWSrS4UvbJssnIb5liA4WQ/fzI/L ewmKxlv/+omUa5a1DvkdOWcNYv4E2DEYb2Mb3bCS51AxqaTNPJk5j8/oKgeuDnsfYbT6 8YcA== X-Gm-Message-State: AIVw111YfpOhNcAxMUdxTJehyajn6ROvtzUO0U0tOpsvKJpbsK/2uRxL yUJ0WDFBh602ARZPQbCJN7xKfIh1JA== X-Received: by 10.176.86.21 with SMTP id y21mr9551017uaa.74.1500907069835; Mon, 24 Jul 2017 07:37:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.34.5 with HTTP; Mon, 24 Jul 2017 07:37:49 -0700 (PDT) In-Reply-To: References: From: "Bin.Cheng" Date: Mon, 24 Jul 2017 14:37:00 -0000 Message-ID: Subject: Re: [PATCH GCC][1/2]Feed bound computation to folder in loop split To: Marc Glisse Cc: gcc-patches List , Richard Biener Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg01434.txt.bz2 On Mon, Jul 24, 2017 at 3:31 PM, Marc Glisse wrote: > On Mon, 24 Jul 2017, Bin.Cheng wrote: > >> On Mon, Jul 24, 2017 at 2:59 PM, Marc Glisse wrote: >>> >>> On Mon, 24 Jul 2017, Bin.Cheng wrote: >>> >>>> But since definition of _197 isn't in current stmt sequence, call "o31 >>>> = do_valueize (valueize, o31)" will return NULL. As a result, it's >>>> not matched. >>> >>> >>> >>> Wait, actually, how was your fold_build* version working? Why was the >>> first >>> addition "in the current generic tree" and why isn't it "in current stmt >>> sequence"? >> >> Maybe I didn't express it clearly. In compute_new_first_bound, we >> have stmt sequence "_124 = _197 + 1", and we try to simplify "_124 - >> 1" by calling gimple_build. The definition of _197 is a PHI and isn't >> in current stmt sequence. For fold_build* version, it builds >> expression "_197 + 1 - 1" and simplifies it. > > > It seems like it shouldn't be relevant whether the definition of _197 is in > the stmt sequence or not, but indeed we seem to generate a lot of calls to > do_valueize... I had misunderstood the issue, sorry. Oh, no need at all, and thanks very much for all the explanation. > > Strangely, for a pattern like > (simplify (plus @0 @1) @0) > we generate no call to valueize, while for the following > (simplify (plus @0 (minus @1 @2)) @0) > we generate 3 calls to do_valueize. > > I think we need Richard to say what the intent is for the valueization > function. It is used both to stop looking at defining stmt if the return is > NULL, and to replace/optimize one SSA_NAME with another, but currently it > seems hard to prevent looking at the defining statement without preventing > from looking at the SSA_NAME at all. Looks we don't really expand into def_stmt on leaf nodes, maybe valueization can be saved in the case? > > I guess we'll need a fix in genmatch... Yeah, then the original patch becomes unnecessary. Thanks again! Thanks, bin > > -- > Marc Glisse