From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id 1D7363858CDB for ; Fri, 24 Mar 2023 07:03:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D7363858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22d.google.com with SMTP id s20so715382ljp.1 for ; Fri, 24 Mar 2023 00:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679641424; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YQJYzi+TT2Y+FE89PsW/lvCzPHKlICcPSDz99+50FFE=; b=WpW5qUt+bnLU835Z4zlwJOHq+ehEGsQUt1jktPnZjZWBSUoSLF3Q93FTT4OUcujrET 228nQ8hoP9+l4F5I5IbS9vmV3FkE8KLFVXoG7l5dzkCyYHy23H579i8ZVfCSW3Jx8E5O /xWPawdHM3aBLJUx89t2YoS8uGc/Sxg/n5IO3eo2IP+1DmJp2t4EZrY0BqLOJWYDivUy lnjglrj/gfbxgshzIpKMqYlp5vOpQfB7tgBgXqLL8/HG0cnt03naXisrB5CcJ2rCtnaa mYvoibN2CsGYFUm/TCVpRFQ4DaFU/U2u1aXSACXobdVXoL+IIMX3cOiY4DCOnXTURnJy cwYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679641424; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YQJYzi+TT2Y+FE89PsW/lvCzPHKlICcPSDz99+50FFE=; b=EHZLqMhl59yo7iXbMS+SFqgWfkqijHiA49op16xlilIUQDY14/5AhmDgboZ4Qh/1Cz W7erfY5Se02pRIUsy9bbh/uBaPetSg2EUqx2boGETLE114W7/E1sok+4CxW2rgEzfHSt U2sysgysrXyARbG23mHvyPtRaXABhSqRVCVSOab61E2BqhgpkOBUlTATVCMkPnoUmSVl OQiEJMxND2uXs69unzWS1kOrAWB+ItcSCUG/w5emB7kRnBvPDBbJPYdwlDxHUa6p86hh 2l9C28bcjK29Uo1vyE8h7yh6nb3oi6gu1wxwDtdEPbQFwpUGCI+I1H4O2w3ODvWn/qUP I4Eg== X-Gm-Message-State: AAQBX9dW1RdszAzVRoiVFkIbNcwUckJw6hHvZr13yVqTsnl31jqq+q9g LB72b51aqDrtNlyYHr9DyDTstUEYIqscv8H6+g+sMH0G X-Google-Smtp-Source: AKy350aU/NVrdXTZ8OoTBNau5axQO+yHeWqd3jZSwYmCtxS9auvhZnxNh54Dq07+9sF3eRl6NQD82AV+K0OfsvDUGDM= X-Received: by 2002:a2e:995a:0:b0:296:d4da:16ac with SMTP id r26-20020a2e995a000000b00296d4da16acmr517210ljj.10.1679641424068; Fri, 24 Mar 2023 00:03:44 -0700 (PDT) MIME-Version: 1.0 References: <96146be5-a7aa-23fb-0052-d2d81ff60c08@redhat.com> In-Reply-To: <96146be5-a7aa-23fb-0052-d2d81ff60c08@redhat.com> From: Richard Biener Date: Fri, 24 Mar 2023 08:03:32 +0100 Message-ID: Subject: Re: [PATCH] PR tree-optimization/109238 - Ranger cache dominator queries should ignore backedges. To: Andrew MacLeod Cc: gcc-patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 Thu, Mar 23, 2023 at 7:37=E2=80=AFPM Andrew MacLeod via Gcc-patches wrote: > > Detailed info in the PR. > > As we walk the DOM tree to calculate ranges, any block with multiple > predecessors is processed by evaluating and unioning incoming values. > This catches more complex cases where the dominator node itself may not > carry range adjustments that we care about. > > What was missing was the "quick check" doesn't propagate any info. If > the edge we check is dominated by this block (ie, its a back edge), then > no additional useful information can be provided as it just leads back > to where we currently are. Only edges which are not dominated by the > current block need be checked. > > The issue arose because this "quick check" mechanism gives up on complex > cases and returns VARYING... so any backedge would union the real value > from the dominators with the failed result "VARYING" from that edge, and > we get VARYING instead of the correct result. > > The patch simply checks if the current block dominates the predecessor > of an edge before launching the query. > > Performance impact in negligible. slight slowdown for the check, slight > speedup by doing less work.. its a wash. > > Bootstraps on x86_64-pc-linux-gnu with no regressions. > > Ok for trunk? LGTM with the testcase Jakub provided. Richard. > Andrew > > PS I have not managed to produce a reduced testcase yet.. If I do I will > supply it. > > >