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.129.124]) by sourceware.org (Postfix) with ESMTPS id 0037F3858C33 for ; Thu, 7 Sep 2023 14:02:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0037F3858C33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694095375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MfSMCbsn9YlCMLCGUrxSw7HWrCFvCWIwyVjGhvfp+4c=; b=HHxTdCJFAD8vvb0v1adG4nLupI8f/T8CiSZa7r086qrCk34KiWahNOfqY9736X+bVK56fI eCNjFUIUj9YkhHjrC/zX9pdUZRDn0lZyfpjKagw8Mxf0d/GwzPwMCxOXlqSODL825FEMgL e2JbTUyW5jhKxCeveIxab4BwMSCRap8= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-313-aRSQzihhPY2coo9Is4-YPA-1; Thu, 07 Sep 2023 10:02:53 -0400 X-MC-Unique: aRSQzihhPY2coo9Is4-YPA-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-64a459efdbcso10817516d6.3 for ; Thu, 07 Sep 2023 07:02:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694095373; x=1694700173; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MfSMCbsn9YlCMLCGUrxSw7HWrCFvCWIwyVjGhvfp+4c=; b=cPkLYR9YsG2i/ozv6tEZL+A1yLo9Be45yZWQEicsli8WqPvQQKY6cvzyPc/YF5hDS6 Fb7MtJW53deIyAGe6jRDJE/WFxFzJTZ744+fP20FCzIPEPeoTJt7rHbMbt240uoZIO90 AsVK4lJzh4AdoHsyoPJ8KUoG8xASMKSyf82uudmjdy5zXkuvFrYCcf1phkimg+mZWDsp l7l0ogAS+hF2FMkbQK5GHxdvTK3Py15Y7ZK5OQuSonx/VCFWlad2rUdPMXInHNgLNmXD 9zwj8VrVPaMI8b0fiiHfHOHQg/xuhv/YaGfxjOrw3OHXqB3Gn01T5+HElP11vjyJzynf oFeA== X-Gm-Message-State: AOJu0Yzgrw3dRt4lD4QWG8rimkHZm6nIpPeWuXxFtLIUMKzYmwNEsDcy X6mvCzFLgTDKv/dDcoRfF1VbJ5MRVOFYSb7Q54fHPwhubzy4tfoug3ewedSez3K1s6wBvXzglIY Ae1Aym5sd4zv5TlRf5Q== X-Received: by 2002:a0c:aa93:0:b0:64f:4d8e:574e with SMTP id f19-20020a0caa93000000b0064f4d8e574emr15504565qvb.7.1694095373287; Thu, 07 Sep 2023 07:02:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJKeIi7RgT+tnNxK0ssmalm8nBgsinw1kMlxxt/1OmZFHsm5PT031xaIc8U9ZTtycREQGIDQ== X-Received: by 2002:a0c:aa93:0:b0:64f:4d8e:574e with SMTP id f19-20020a0caa93000000b0064f4d8e574emr15504546qvb.7.1694095372985; Thu, 07 Sep 2023 07:02:52 -0700 (PDT) Received: from [192.168.0.174] ([104.219.124.252]) by smtp.gmail.com with ESMTPSA id p14-20020ae9f30e000000b007677347e20asm5810222qkg.129.2023.09.07.07.02.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Sep 2023 07:02:52 -0700 (PDT) Message-ID: <937776ff-9497-f668-72dc-b36cc315939e@redhat.com> Date: Thu, 7 Sep 2023 10:02:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 2/2] VR-VALUES: Rewrite test_for_singularity using range_op_handler To: Andrew Pinski Cc: Richard Biener , Andrew Pinski , Aldy Hernandez , gcc-patches@gcc.gnu.org References: <20230811091551.2758227-1-apinski@marvell.com> <20230811091551.2758227-2-apinski@marvell.com> <5b67902f-fcf4-8024-079d-0bb7ea6fda56@redhat.com> From: Andrew MacLeod In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.6 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_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 9/1/23 02:40, Andrew Pinski wrote: > On Fri, Aug 11, 2023 at 8:08 AM Andrew MacLeod via Gcc-patches > wrote: >> >> If this is only going to work with integers, you might want to check >> that somewhere or switch to irange and int_range_max.. >> >> You can make it work with any kind (if you know op1 is a constant) by >> simply doing >> >> Value_Range op1_range (TREE_TYPE (op1)) >> get_global_range_query->range_of_expr (op1_range, op1) >> >> That will convert trees to a the appropriate range... THis is also true >> for integer constants... but you can also just do the WI conversion like >> you do. >> >> The routine also get confusing to read because it passes in op0 and >> op1, but of course ranger uses op1 and op2 nomenclature, and it looks a >> bit confusing :-P I'd change the operands passed in to op1 and op2 if >> we are rewriting the routine. > Ranger using the nomenclature of op1/op2 and gimple is inconsistent > with trees and other parts of GCC. > It seems like we have to live with this inconsistency now too. > Renaming things in this one function to op1/op2 might be ok but the > rest of the file uses op0/op1 too; most likely because it was > originally written before gimple. > > I think it would be good to have this written in the coding style, > which way should we have it for new code; if we start at 0 or 1 for > operands. It might reduce differences based on who wrote which part > (and even to some extent when). I don't really care which one is > picked as long as we pick one. > > Thanks, > Andrew Pinski > I certainly wont argue it would be good to be consistent, but of course its quite prevalent. Perhaps we should rewrite vr-values.cc to change the terminology in one patch? long term some of it is likely to get absorbed into rangeops, and what isn't could/should be made vrange/irange  aware...  no one has gotten to it yet. we could change the terminology as the routines are reworked too... Andrew