From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) by sourceware.org (Postfix) with ESMTPS id 1310938A1408 for ; Mon, 4 Oct 2021 13:31:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1310938A1408 Received: by mail-vk1-xa35.google.com with SMTP id g15so7628594vke.5 for ; Mon, 04 Oct 2021 06:31:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=1UINtUE4pLprmTNFeuQSI/KXXgzsPV2R+hIUz00Qoqo=; b=yKCByZQScT5/h5AAEMqFn39h0wPQzFLRYoBzzlN/M2feHhrbOjUYmoG6FcaS8HawoH B4j2sj5RGojzyG8zJZ43rVGdcQy/iOj+M4pLXWQITDdxcZyKss0QvEhCwKfO1iP2gGYE dxZB+4zmW4S0siR9SdQCiwFDvk0L11813dpx/yCHYi2XhBvbej6X0bjxDaZc9UpS3QOg CrfPwTp/QXJvNn6td6Iy7DYMSkvPz6y1GTrReqq38Juxaycm4/DZWeJMg4XflcKAvCNc L3gTXh0j5QJaJLWCe4DnIILZ036KgtJ+uKlEt6L3ynjUtcIUQ7gWzbZ2fwQgDcoTdPRX zRhw== X-Gm-Message-State: AOAM5316xe2gHcsMReMaB34UNrzxyHCo0/vDB22Z0sc4IC+51SZIJYYw J5HdZ9Yd25XzmDfs/H+6kzNaMq/yoss= X-Google-Smtp-Source: ABdhPJzSbFb8J6w74x2f5GhQYoynNrS0cZB7r5e9eaK/Yy4rxCQo4gUN5mDw9YubIuFoRAV5HzJzLQ== X-Received: by 2002:ac5:ccab:: with SMTP id p11mr1672388vkm.1.1633354294384; Mon, 04 Oct 2021 06:31:34 -0700 (PDT) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id n1sm6941340vkl.23.2021.10.04.06.31.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Oct 2021 06:31:34 -0700 (PDT) Subject: Re: [RFC] More jump threading restrictions in the presence of loops. To: Aldy Hernandez , Richard Biener , matz@suse.de Cc: Andrew MacLeod , GCC patches References: <20211004094313.1596556-1-aldyh@redhat.com> From: Jeff Law Message-ID: Date: Mon, 4 Oct 2021 07:31:30 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211004094313.1596556-1-aldyh@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Mon, 04 Oct 2021 13:31:36 -0000 On 10/4/2021 3:43 AM, Aldy Hernandez wrote: > It is frustrating that virtually all the regressions with the hybrid > threader for VRP, have not been with the engine itself, but with the > independent restrictions we have agreed upon. > > The following patch is a collection of discussions with Richi, Jeff, > and Michael Matz regarding jump threading limitations in the presence > of loops, that I hope can lead to further refinements. > > As I have mentioned before, most of our threading tests are too > fragile, so in this patch I have distilled various restrictions into > gimple FE tests that I hope can help in maintaining the threader going > forward. The goal is to have one test with no valid threads > whatsover, and one with exclusively one valid thread per function. > This should make it trivial to maintain this going forward. > > I would like to request the relevant experts to not only examine the > patch, but review the tests in this patch, to make sure we agree upon > these restrictions. I have distilled the smallest possible test for > each restriction and have annotated said tests to make reviewing easy. > > Note that the test in ssa-thread-valid.c is a thread that Jeff has > suggested should be an exception to the path crossing loops > restriction, but I have not implemented it yet, because even if we > could loosen the restriction, it would violate Richi's restriction of > a path that rotates a loop. Comments are highly welcome. > > By the way, these restrictions trigger *a lot*. We seem to be > rotating loops left and right. So I wouldn't be surprised if this > requires (as usual) a lot of test tweaking. > > Untested patch follows. > > p.s. Note that I'm just facilitating the discussion. I'm highly > dependent on the loop experts here ;-). > > gcc/ChangeLog: > > * tree-ssa-threadupdate.c > (jt_path_registry::cancel_invalid_paths): Tweak. > > gcc/testsuite/ChangeLog: > > * gcc.dg/tree-ssa/ssa-thread-invalid.c: New test. > * gcc.dg/tree-ssa/ssa-thread-valid.c: New test. Let me throw that into the tester and see what pops. Jeff