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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 272373858D29 for ; Wed, 30 Jun 2021 06:20:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 272373858D29 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-453-J-awyNm0No2LIjT9JAUKxA-1; Wed, 30 Jun 2021 02:20:21 -0400 X-MC-Unique: J-awyNm0No2LIjT9JAUKxA-1 Received: by mail-wr1-f72.google.com with SMTP id p4-20020a5d63840000b0290126f2836a61so458031wru.6 for ; Tue, 29 Jun 2021 23:20:21 -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-language :content-transfer-encoding; bh=YRmVtFQgJWat8plsRXzWHSPw5u+K9rno4ykeNNTooh8=; b=WgrWhBBmInjtaErHWZiKqqJG2uDiJWJMDyKFN9EN0J5NDSjVzX6HalhJNKmrdpZl9v BT0k9pm/dAiUrbOwhLCWNibaaii3KDh4OIGaIg5vH51CrMpvE311JTh55r/HmzQcMOj2 J7Yckp/R4D7dEKNvb7Pzg13DO/L4odUBbIXOiEtk9zrTQxmSuBEmFVJCiPE0iK2VA2AH P80ZKoG3NHzD0DmSmuY1LcxsNLar2T7T1DxowKUQ+3zFHKYsdRAaJLkcgL4rQ3DA8XcG 8hLGS6n0eBEspto9umrK4rWUHcblKiLm1JuLtDGQPGAhlkKzlFggzFuaY4RRYyx3E16j jLjQ== X-Gm-Message-State: AOAM533XLDzc4BGxDAd4NnETDeF8q7kcxsMmU0Ymp+aWnRi6kmdlDobO o3YZlXpToOz5L0WiCPxDK8EPOjd7cjT/+S1HriQQgkoSzhzSi15wcctoi/ohae0EXcKxFfr6fI+ kekn7MS1sG+3OxwXKkJm60MTfuOSfpy6KHcxrqBkDbmCJe9UfqShkTTsys0qJL4zOkQ== X-Received: by 2002:a05:600c:26d1:: with SMTP id 17mr12244030wmv.1.1625034020032; Tue, 29 Jun 2021 23:20:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV944ewVWauHut/L1CgPwFFzsxkQZQPVD70nif01E93/T+NHxiQs5HvXVA8c6hsVsRKZ2ORw== X-Received: by 2002:a05:600c:26d1:: with SMTP id 17mr12244015wmv.1.1625034019805; Tue, 29 Jun 2021 23:20:19 -0700 (PDT) Received: from abulafia.quesejoda.com ([95.169.237.215]) by smtp.gmail.com with ESMTPSA id j17sm24533082wrx.0.2021.06.29.23.20.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Jun 2021 23:20:19 -0700 (PDT) Subject: Re: [PATCH] Add stmt context in simplify_using_ranges. To: Andrew MacLeod , gcc-patches References: From: Aldy Hernandez Message-ID: Date: Wed, 30 Jun 2021 08:20:18 +0200 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-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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 06:20:24 -0000 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