From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 563C638654B5 for ; Wed, 30 Jun 2021 13:25:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 563C638654B5 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-572-YRj32DAhNbiUBOil_YwN9g-1; Wed, 30 Jun 2021 09:25:06 -0400 X-MC-Unique: YRj32DAhNbiUBOil_YwN9g-1 Received: by mail-qt1-f199.google.com with SMTP id t6-20020ac80dc60000b029024e988e8277so1084675qti.23 for ; Wed, 30 Jun 2021 06:25:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VSGox9uQiiI4t+pmEMCbngS4TE/3ZhfxhUFb20J4jnY=; b=eUPYvCttRhgDQQMSNG6ZFMSt2AjKqMCuAEgoX9MO2VvaxZRLi84zM/eBJyFBXa1YoF oxaSR6W9Qe205gWwlW11ATzw1mPVh8fMkCcbvep/I4UMMH8dQpHaIDfnrLtOamLZcIeg zN5awOPdJYRnzS4GQB3Xcb2cYuOHYw/pOp+x640L0K6PMoK443LEyZMagADoIFVhrfJ5 g7r85TeE/hXKVeGvCtrIGgyrF3iIG5AhBdHjX9VTCxN3e85zin3aUyxhHaM4Bb5N85pE 7EdAe26LSxaf81Kpn3GFNEscm7ioTNOuuB8VmhxSXsJvqvUboypIJSBlROUhJLBsmfar B87A== X-Gm-Message-State: AOAM5306o092bJYDprj+SzuLsL8dA2HcfipnjF6Kx3bb35B3BXjpYA/b bJqomJVIsz1ESspzKtKfZqWsv5dOfPs7XGNgXbCd0GJNA92phjCSZC1AXw2jX941VI2T9YBE6Z3 4eiQiXK7ybP+FPIx8KolNw0x9Yu9ZZhXt9a2BFXGE8TqRy2IASNhf0ZuGGP8HD24ZYgk0KA== X-Received: by 2002:a05:6214:d49:: with SMTP id 9mr1251338qvr.30.1625059505564; Wed, 30 Jun 2021 06:25:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyomdueI8df6qIW/IMdHMTxLMgtye7NuJaftvI3NxYZiRR0dMpWwrD5FtPsPY/xMbbbC3wAw== X-Received: by 2002:a05:6214:d49:: with SMTP id 9mr1251311qvr.30.1625059505359; Wed, 30 Jun 2021 06:25:05 -0700 (PDT) Received: from [192.168.0.102] ([104.219.121.150]) by smtp.gmail.com with ESMTPSA id m139sm5016570qke.116.2021.06.30.06.25.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Jun 2021 06:25:04 -0700 (PDT) Subject: Re: [PATCH] Add stmt context in simplify_using_ranges. To: Aldy Hernandez , gcc-patches References: From: Andrew MacLeod Message-ID: <4cd93cc4-a55e-c134-972a-0e7f14417ec0@redhat.com> Date: Wed, 30 Jun 2021 09:25:03 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-CA X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2021 13:25:09 -0000 On 6/30/21 2:20 AM, Aldy Hernandez wrote: > > > On 6/29/21 9:09 PM, Andrew MacLeod wrote: >> We added context to a lot of simplify_using_ranges, but we didn't >> catch all the places. This provides the originating stmt to the >> missing cases which resolve a few EVRP testcases when running in >> ranger-only mode. >> >> Bootstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. >> >> Andrew >> >> > > Thanks for doing this.  I've done a half-assed job at passing context > around; probably only when it yielded a discrepancy with evrp. > >> >>  bool >> -simplify_using_ranges::op_with_boolean_value_range_p (tree op) >> +simplify_using_ranges::op_with_boolean_value_range_p (tree op, >> gimple *s) >>  { >>    if (TYPE_PRECISION (TREE_TYPE (op)) == 1) > > I know you like single letter arguments, but I find them confusing > when the method is more than a few lines long.  Besides, "stmt" is > what is used throughout vr-values.c. > > And speaking of passing statements around, I wonder if it'd be best to > have m_stmt and possible m_gsi as class fields.  After all, we never > change them, and they're used by most methods. > > Aldy > I think there's a revamp of simplify down the pipe anyway. class simplify_using_ranges { public:   simplify_using_ranges (class range_query *query = NULL);   ~simplify_using_ranges ();   void set_range_query (class range_query *q) { query = q; }   bool simplify (gimple_stmt_iterator *); This is really the only external API.. the call to simplify. Long term Im not sure that containing all the switch update management stuff att he bottom of the class should be contained in this class.. That seems like it should be a class that is used by simplifcation...  and simplification itself could be stateless..    kinda following the model of fold_using_ranges.. the the gsi and stmt can be wrapped into a source class if needed... likewise we're eventually going to want to restructure the folding stuff that happens..    but most of this can wait until evrp and vrp are gone, then we can change the model a bit easier. bigger fish to fry and they are already way better than they were before :-)