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 17BFE385802A for ; Mon, 24 May 2021 16:09:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 17BFE385802A Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-OsKQH9tgP-GMtPS1CCC2Ng-1; Mon, 24 May 2021 12:09:49 -0400 X-MC-Unique: OsKQH9tgP-GMtPS1CCC2Ng-1 Received: by mail-wm1-f72.google.com with SMTP id f141-20020a1c1f930000b029017ce5240ed6so2217828wmf.5 for ; Mon, 24 May 2021 09:09:48 -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:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=w0gRlEVE8f0YV+yvHsaImbyMF43zkzoFGZUXD4fSPII=; b=gT7ELBWtZqssnfYdiPxGtdiuR9w+ckkT+3uq9NC7pDoy/iwWshj8gRhgEDsaPm2ld2 ew7yRerpoPRoDh5iD2xlv0cFad7+n3Ayxh3Mx4xL6XXgl0Ganwx+Sy7ngDaQc6qwSeB3 4NyyxiN0UequPg+YZ4RFE+txLRo6RXeNRpDVEePjecrrfbqXSrlh7lhlqjcmsbo0WNFh W/ZK8QZj9LPnQ72l32KO80REyD7q0L56fZrMd8vI27r4acjq3kBpZu2o9mubkE6784ns jAh4la5HGqCvGVnVbocmB0IkYjFJXHL0nl9cx4SyDQzQmlG3Ckk7vMGNk+Q8MK9LDnbo 7wAQ== X-Gm-Message-State: AOAM5336yD4CY2l0XSW8sDFHZgzdgGiHjYfoxdTuonaul3D7xvu1iz8a ytj4wKFh/p12d8FXbQ7sVtHY2YTPjVSc9aJxUIT+/WvWFkQWn4iHwupzHP+DG6Q/2KefDG9oBlc byN6+8GRRorlDMHe7EA== X-Received: by 2002:adf:b356:: with SMTP id k22mr19267515wrd.80.1621872587838; Mon, 24 May 2021 09:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyz4Rk9mr/VjnrZ2mB16ugmH5NHEkRR0rroOqugjOwwPH38rdWkCfb++d5a5c049L4gj5JZgA== X-Received: by 2002:adf:b356:: with SMTP id k22mr19267504wrd.80.1621872587668; Mon, 24 May 2021 09:09:47 -0700 (PDT) Received: from abulafia.quesejoda.com ([95.169.237.215]) by smtp.gmail.com with ESMTPSA id k11sm8308455wmj.1.2021.05.24.09.09.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 May 2021 09:09:47 -0700 (PDT) Subject: Re: [PATCH 1/5] Common API for accessing global and on-demand ranges. To: GCC patches , Andrew MacLeod Cc: Jeff Law , Martin Sebor References: <20210521113954.1148075-1-aldyh@redhat.com> From: Aldy Hernandez Message-ID: <71bc0536-573b-a389-89f5-f13f5763d3df@redhat.com> Date: Mon, 24 May 2021 18:09:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210521113954.1148075-1-aldyh@redhat.com> 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: 7bit X-Spam-Status: No, score=-3.4 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: Mon, 24 May 2021 16:09:52 -0000 On 5/21/21 1:39 PM, Aldy Hernandez wrote: > This patch provides a generic API for accessing global ranges. It is > meant to replace get_range_info() and get_ptr_nonnull() with one > common interface. It uses the same API as the ranger (class > range_query), so there will now be one API for accessing local and > global ranges alike. > > Follow-up patches will convert all users of get_range_info and > get_ptr_nonnull to this API. > > For get_range_info, instead of: > > if (!POINTER_TYPE_P (TREE_TYPE (name)) && SSA_NAME_RANGE_INFO (name)) > get_range_info (name, vr); > > You can now do: > > RANGE_QUERY (cfun)->range_of_expr (vr, name, [stmt]); BTW, we're not wed to the idea of putting the current range object in cfun. The important thing is that the API is consistent across, not where it lives. We're open to suggestions: a global variable, cfun, the pass manager, or even a pass property: ( PROP_blah | PROP_ranger ), /* properties_required */ I personally like cfun, but we're open to suggestions. Aldy