From: Aldy Hernandez <aldyh@redhat.com>
To: Martin Sebor <msebor@gmail.com>, GCC patches <gcc-patches@gcc.gnu.org>
Cc: Martin Sebor <msebor@redhat.com>,
Jeff Law <jeffreyalaw@gmail.com>,
Andrew MacLeod <amacleod@redhat.com>,
Richard Biener <richard.guenther@gmail.com>
Subject: Re: [PATCH 0/2] Ranger-based backwards threader implementation.
Date: Wed, 30 Jun 2021 08:08:00 +0200 [thread overview]
Message-ID: <e03d9c7d-593e-6110-6039-6f991f343b10@redhat.com> (raw)
In-Reply-To: <ca0bf5f4-1089-3aad-78b3-765964999281@gmail.com>
On 6/29/21 11:22 PM, Martin Sebor wrote:
> On 6/29/21 4:27 AM, Aldy Hernandez wrote:
>>
>>
>> On 6/29/21 1:19 AM, Martin Sebor wrote:
>>> On 6/28/21 10:21 AM, Aldy Hernandez via Gcc-patches wrote:
>>>> This is the ranger-based backwards threader. It is divided into two
>>>> parts: the solver and the path discovery bits.
>>>>
>>>> The solver is generic enough, that it may be of use to other passes,
>>>> so it's been abstracted into its own separate class/file. Andrew and
>>>> I have already gone over it, so I don't think a review is necessary.
>>>> Besides, it's technically an extension of the ranger infrastructure.
>>>>
>>>> On the other hand, the path discovery bits could benefit from the
>>>> watchful eye of the jump threading experts.
>>>>
>>>> Documenting the solver in a [ranger-tech] post is on my TODO list,
>>>> as I think it would be useful as an example of GORI as a general
>>>> tool, outside the VRP world.
>>>>
>>>> As I have mentioned elsewhere, I have gone through each test and
>>>> documented the reasons why they were adjusted (when useful). The
>>>> reviewer(s) may benefit from looking at the test notes.
>>>>
>>>> I have added a --param=threader-mode={ranger,legacy} option, which I
>>>> hope to remove shortly after. It has been useful for diagnosing
>>>> issues in the past, though perhaps not so much now. I've left it
>>>> in case there's a remote interest in using it during stage1, but
>>>> removing it could be a huge cleanup to tree-ssa-threadbackward.c.
>>>>
>>>> If/when accepted, I will open 2-3 PRs with the XFAILed tests as
>>>> requested. I am still working on distilling a C counterpart for
>>>> the libphobos missing thread edge. It'll hopefully be ready by the
>>>> time the review is done.
>>>>
>>>> A version of this patchset with the verification code has
>>>> been tested on x86-64, ppc64, ppc64le, and aarch64 (all Linux).
>>>>
>>>> I am currently re-testing on x86-64 Linux, but will not re-test on the
>>>> rest of the architectures because...OMG aarch6 is so slow!
>>>
>>> I applied the series and ran a subset of tests and didn't see any
>>> failures, just the three XPASSes below. The Wfree-nonheap-object
>>> tests you mentioned in the other post all pass. Looks like you
>>> got past that problem?
>>>
>>> XPASS: gcc.dg/uninit-pr61112.c pr61112 (test for bogus messages, line
>>> 32)
>>> XPASS: gcc.dg/uninit-pr61112.c pr61112 (test for bogus messages, line
>>> 46)
>>> XPASS: gcc.dg/uninit-pr61112.c pr61112 (test for bogus messages, line
>>> 60)
>>>
>>> A couple of comments on the tests below (I haven't looked at the meat
>>> of the patch):
>>>
>>>>
>>>> Thanks.
>>>> Aldy
>>>>
>>>> Aldy Hernandez (2):
>>>> Implement basic block path solver.
>>>> Backwards jump threader rewrite with ranger.
>>>>
>>>> gcc/Makefile.in | 6 +
>>>> gcc/flag-types.h | 7 +
>>>> gcc/params.opt | 17 +
>>>> .../g++.dg/debug/dwarf2/deallocator.C | 3 +-
>>>> gcc/testsuite/gcc.c-torture/compile/pr83510.c | 33 ++
>>>> gcc/testsuite/gcc.dg/Wrestrict-22.c | 3 +
>>>
>>> The change here just adds the comment:
>>>
>>> +/* This looks like the threader caused the entire loop to collapse,
>>> and the
>>> + warning pass can't determine the arguments to memcpy. */
>>> +
>>>
>>> Since the test passes I'm not sure I understand what the comment
>>> is trying to say. Is it still accurate and necessary?
>>
>> This seems like it came from the ranger branch which had slightly
>> different code, particularly it made use of a full ranger with
>> equivalences. It looks like this could have failed in the branch, but
>> no longer does. I have removed the comment.
>
> Okay, thanks.
>
>>
>>>
>>>> gcc/testsuite/gcc.dg/loop-unswitch-2.c | 2 +-
>>>> gcc/testsuite/gcc.dg/old-style-asm-1.c | 5 +-
>>>> gcc/testsuite/gcc.dg/pr68317.c | 4 +-
>>>> gcc/testsuite/gcc.dg/pr97567-2.c | 2 +-
>>>> gcc/testsuite/gcc.dg/predict-9.c | 4 +-
>>>> gcc/testsuite/gcc.dg/shrink-wrap-loop.c | 53 ++
>>>> gcc/testsuite/gcc.dg/sibcall-1.c | 10 +
>>>> .../gcc.dg/tree-ssa/builtin-sprintf-3.c | 5 +-
>>>
>>> I wonder if breaking up the test function into five, one for each
>>> of the tests it does, would be a better way to avoid the IL changes
>>> than disabling all the threading passes. Like in the attached patch.
>>
>> As the author of the original test, I completely differ to you :).
>>
>> Attached is the latest version with your suggested changes, as well as
>> a gimple FE test for the previously discussed failing libphobos test.
>
> The tests look good.
>
> In the new APIs, instead of taking vec by value can you please change
> them to either by-const-reference if they don't change the vec or by-
> reference if they do? I'm in the midst of changing code to do that
> with the goal of eventually removing all by-value vec arguments.
Sure.
Aldy
prev parent reply other threads:[~2021-06-30 6:08 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-28 16:21 Aldy Hernandez
2021-06-28 16:21 ` [PATCH 1/2] Implement basic block path solver Aldy Hernandez
2021-07-01 22:20 ` Jeff Law
2021-07-02 8:13 ` Aldy Hernandez
2021-07-02 13:16 ` Andrew MacLeod
2021-07-15 14:55 ` Aldy Hernandez
2021-07-26 19:10 ` Jeff Law
2021-07-27 9:58 ` Aldy Hernandez
2021-07-27 15:18 ` Jeff Law
2021-06-28 16:21 ` [PATCH 2/2] Backwards jump threader rewrite with ranger Aldy Hernandez
2021-07-05 15:39 ` Aldy Hernandez
2021-07-15 14:57 ` Aldy Hernandez
2021-07-26 12:43 ` Aldy Hernandez
2021-07-28 14:32 ` Jeff Law
2021-07-28 14:51 ` Aldy Hernandez
2021-07-28 15:29 ` Martin Sebor
2021-06-28 23:19 ` [PATCH 0/2] Ranger-based backwards threader implementation Martin Sebor
2021-06-29 10:27 ` Aldy Hernandez
2021-06-29 21:22 ` Martin Sebor
2021-06-30 6:08 ` Aldy Hernandez [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e03d9c7d-593e-6110-6039-6f991f343b10@redhat.com \
--to=aldyh@redhat.com \
--cc=amacleod@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=msebor@gmail.com \
--cc=msebor@redhat.com \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).