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.133.124]) by sourceware.org (Postfix) with ESMTP id 4421F3858C2C for ; Thu, 14 Oct 2021 09:26:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4421F3858C2C Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-520-EUrB396FMU2kJZsGXvYPHA-1; Thu, 14 Oct 2021 05:26:06 -0400 X-MC-Unique: EUrB396FMU2kJZsGXvYPHA-1 Received: by mail-lf1-f72.google.com with SMTP id x7-20020a056512130700b003fd1a7424a8so3941189lfu.5 for ; Thu, 14 Oct 2021 02:26:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e6BRpeOz6/BfGbGRIMGV/5PA2I9VhuUJKI7ha+XN3pk=; b=rh1G1OKej4yBh/0o4ORSl3qIFtjvg4HA3jfBHyRkw8I+DLHWrM9JGs+rzeIXJNRDMO NgvxrHOCSEEb5AqJeNLk1GT/lPkCf3vgwmlngHSojjfkKHNe9Jq9egcyZNPTAptu8Oc7 C4Y1S31h3Yps06+t+8mPMBQ7sZ4qWNKCt2PGo4iGStJsjjq59IBgxE7YGeoiskMYgSCj WxwXuyy6M8HFIPam9OTwbBf+uMGj7Ac+VvLP8BB4Yh7VwfLdefzag8KcIr9hyaIyBdwe Huck7C7YrqBdDnFvzfihzRscs3wTfn99piMQgGsnrzmRY2wnV4TGNETL9iiYaeJFKmxJ LpFQ== X-Gm-Message-State: AOAM530POxcFmNlxu0k+FbXztEXXXPZbMNIQCjZkot5CxdKst5HDCQ/t 7P2CmFAiFj9O4fIsVh6iXs14RqeGhh0bN394pqJpg9YNi6qTXrwP5Dii/+PV7+SPbXpT2dmU9V+ FvP/DzgnwZM8leuH9u8QnJHOLU6nQktGsFQ== X-Received: by 2002:a2e:2f19:: with SMTP id v25mr5028109ljv.281.1634203565171; Thu, 14 Oct 2021 02:26:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRf8GbksqBI6sd17koxfXI/GkVTxnBNt5jSrq+cdZpIjP2d0gh4Ez8xX7UNQCr2WjfKRfnj9/XotCDaJdg9nk= X-Received: by 2002:a2e:2f19:: with SMTP id v25mr5028078ljv.281.1634203564895; Thu, 14 Oct 2021 02:26:04 -0700 (PDT) MIME-Version: 1.0 References: <20211004094313.1596556-1-aldyh@redhat.com> In-Reply-To: From: Aldy Hernandez Date: Thu, 14 Oct 2021 11:25:53 +0200 Message-ID: Subject: Re: [RFC] More jump threading restrictions in the presence of loops. To: Jeff Law , Richard Biener , Michael Matz Cc: Andrew MacLeod , 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.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, THIS_AD, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Thu, 14 Oct 2021 09:26:09 -0000 PING. Note, that there are no PRs and nothing really dependent on this patch. This has just been suggested as the right thing to do wrt loops. This patch fixes 6 XFAILs in our testsuite and has the added side-effect of fixing the aarch64 bootstrap problem (though the problem in the uninit code is still there). This is a fundamental change in what we've traditionally allowed for jump threading, but I think it's a good thing. It also paves the way for combining the validity models for both the forward and the backward threaders. I am happy to field the PRs this may bring about, since every change in the cost model has us questioning whether we should or shouldn't thread a path. But I may need some help from y'all if there's a missing thread that causes a regression in some other pass. That being said, most of the issues that have come with the threader changes haven't been because we thread less, but because we thread more-- so perhaps restricting things is a good thing ;-). Aldy On Wed, Oct 6, 2021 at 12:22 PM Aldy Hernandez wrote: > > [Here go the bits by Richi, tested on x86-64 Linux, and ongoing tests > on aarch64 and ppc64le.] > > There is a lot of fall-out from this patch, as there were many threading > tests that assumed the restrictions introduced by this patch were valid. > Some tests have merely shifted the threading to after loop > optimizations, but others ended up with no threading opportunities at > all. Surprisingly some tests ended up with more total threads. It was > a crapshoot all around. > > On a postive note, there are 6 tests that no longer XFAIL, and one > guality test which now passes. > > I would appreciate someone reviewing the test changes. I am unsure > whether some of the tests should be removed, XFAILed, or some other > thing. > > I felt a bit queasy about such a fundamental change wrt threading, so I > ran it through my callgrind test harness (.ii files from a bootstrap). > There was no change in overall compilation, DOM, or the VRP threaders. > > However, there was a slight increase of 1.63% in the backward threader. > I'm pretty sure we could reduce this if we incorporated the restrictions > into their profitability code. This way we could stop the search when > we ran into one of these restrictions. Not sure it's worth it at this > point. > > Note, that this ad-hoc testing is not meant to replace a more thorough > SPEC, etc test. > > Tested on x86-64 Linux. > > OK pending tests on aarch64 and ppc64le? > > Co-authored-by: Richard Biener