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 64AAF3858403 for ; Tue, 16 Aug 2022 13:55:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 64AAF3858403 Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-393-Th1JgO5TNVSxoTubOtgCtw-1; Tue, 16 Aug 2022 09:55:45 -0400 X-MC-Unique: Th1JgO5TNVSxoTubOtgCtw-1 Received: by mail-ot1-f71.google.com with SMTP id d10-20020a05683025ca00b00638a9b2891aso1625028otu.23 for ; Tue, 16 Aug 2022 06:55:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=l0ZJ0mvGGPXOy5HjbCt3vyPONLnn1PD1LootR3dgPmY=; b=eJpa19Atm24iQIL03g7Az5kZQ/eFHke9YtJqMH/HaG1gmvmOfqCOIjG51BRL3ybR4y EDDoLJYk0jQoKhyFH2F0FovguDkWJOyQ6x4Q7SgPtrKuC2z+nJDoEJy8IaSiXpxgjh2D FgTqg9+iMZg+8U9dzD3UHqwxMxHDv9sz42e4MzS4sCOp6aO7+JHSMSXQaVF68mT77dIb mGyejRSot5VZ/zBlggHz+KjB22bsLgR3l5fSgOVuthaXpRCdYFHp0SCYRwdaG4lKo1p1 lXFknYjosyJ+07gvAUkh3Anz6+3YSscdKkLmaUGHPs4Z0SQLpjsQTVjHaKpJKfVT70X+ +Blg== X-Gm-Message-State: ACgBeo36QVTGhQsFJD+wtND1ewXNOCLAAcQJLmJSqvporz1XeAWzDBEY MioR8jW9dUpa10K5uDrii6pm1EP3Qkud1Yt3TT1z8+hZ+kPuQsU2xOTDm4OmjnOZuWHxvDamWe3 /eIuydDirCnL5s0wm4bGwsBN/wFZFJnIzgQ== X-Received: by 2002:a05:6870:b617:b0:10d:f7ce:50df with SMTP id cm23-20020a056870b61700b0010df7ce50dfmr13174307oab.36.1660658145039; Tue, 16 Aug 2022 06:55:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR480AHkwuGl4Zy5rUdz7ItFNJH6ZGPwh2S0rZStLvWkMCIob/Ch2wGxMJsBAfsWJTtfXGpkOKqXKdV1pOQdwBw= X-Received: by 2002:a05:6870:b617:b0:10d:f7ce:50df with SMTP id cm23-20020a056870b61700b0010df7ce50dfmr13174304oab.36.1660658144835; Tue, 16 Aug 2022 06:55:44 -0700 (PDT) MIME-Version: 1.0 References: <73820.122081107421800679@us-mta-533.us.mimecast.lan> <9b5f86c8-6920-843d-a766-7fe9166c44da@redhat.com> In-Reply-To: <9b5f86c8-6920-843d-a766-7fe9166c44da@redhat.com> From: Aldy Hernandez Date: Tue, 16 Aug 2022 15:55:33 +0200 Message-ID: Subject: Re: [PATCH] Tame path_range_query::compute_imports To: Andrew MacLeod Cc: Richard Biener , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Tue, 16 Aug 2022 13:55:51 -0000 On Tue, Aug 16, 2022 at 3:48 PM Andrew MacLeod wrote: > > > On 8/16/22 06:25, Aldy Hernandez wrote: > > On Mon, Aug 15, 2022 at 11:53 AM Richard Biener wrote: > >> The remaining issue I have with the path_range_query is that > >> we re-use the same instance in the back threader but the > >> class doesn't provide any way to "restart", aka give m_path > >> a lifetime. The "start a new path" API seems to essentially > >> be compute_ranges (), but there's no convenient way to end. > >> It might be more appropriate to re-instantiate the path_range_query, > >> though that comes at a cost. Or abstract an actual query, like > >> adding a > > Yes, compute_ranges() is the way to start a new path. It resets exit > > dependencies, the path, relations, etc. I think it would be clearer > > to name it set_path (or reset_path if we want to share nomenclature > > with the path_oracle). > > > > Instantiating a new path_range_query per path is fine, as long as you > > allocate the ranger it uses yourself, instead of letting > > path_range_query allocate it. Instantiating a new ranger does have a > > cost, and it's best to let path_range_query re-use a ranger from path > > to path. This is why path_range_query is (class) global in the > > backwards threader. Andrew mentioned last year making the ranger > > start-up 0-cost, but it still leaves the internal caching the ranger > > will do from path to path (well, the stuff outside the current path, > > cause the stuff inside the path is irrelevant since it'll get > > recalculated). > > Yes, you will want to have one instance of ranger regardless... just > pass it to whatever/however many other instances you want to build paths > from. > > Ranger itself is primarily to provide range-on-entry to the path. > Trying to use it for values within the path would bring in values > outside the path as it doesnt understand you have selected on certain > edges along the way. > > The GORI engine within ranger can be utilized within the path because > GORI never looks outside the basic block being asked about, other than > thru the range-query that is provided to it. SO its perfectly safe to > use within the path. > > As both GORI and ranger cache things and share the def chains, its far > more efficient to have a global instance that is just utilized. Even a > zero-cost start up would incur costs as it recalculates the same things > over and over I forgot about the def chains. That should be fine however, since we use the gori from within the ranger that got passed down. Aldy