public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Andrew MacLeod <amacleod@redhat.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	Aldy Hernandez <aldyh@redhat.com>
Subject: [PING][PATCH] enable ranger and caching in pass_waccess
Date: Wed, 25 Aug 2021 09:20:16 -0600	[thread overview]
Message-ID: <ba41ff81-809b-8cc0-2983-f2e082266ec7@gmail.com> (raw)
In-Reply-To: <71d7a933-6942-1598-0cdd-5413f03fc188@gmail.com>

Ping: Andrew, did I answer your questions?  Do you (or anyone else)
have any other comments on the latest patch below?

https://gcc.gnu.org/pipermail/gcc-patches/2021-August/577865.html

On 8/20/21 4:16 PM, Martin Sebor wrote:
> On 8/20/21 7:09 AM, Andrew MacLeod wrote:
>> On 8/19/21 7:09 PM, Martin Sebor via Gcc-patches wrote:
>>> The attached patch changes the new access warning pass to use
>>> the per-function ranger instance.  To do that it makes a number
>>> of the global static functions members of the pass (that involved
>>> moving one to a later point in the file, increasing the diff;
>>> the body of the function hasn't changed otherwise).  Still more
>>> functions remain.  At the same time, the patch also enables
>>> the simple pointer_query cache to avoid repeatedly recomputing
>>> the properties of related pointers into the same objects, and
>>> makes the cache more effective (trunk fails to cache a bunch of
>>> intermediate results).  Finally, the patch enhances the debugging
>>> support for the cache.
>>>
>>> Other than the ranger/caching the changes have no user-visible
>>> effect.
>>
>>
>> Why are you calling enable/disable ranger if you are passing a ranger 
>> instance around instead of using the get_range_query (cfun)->range* 
>> calls?
> 
> The pass stores an instance of the pointer_query class which in
> turn stores a pointer to range_query (which is a copy of the ranger).
> So storing it also in pass_waccess isn't necessary and can be
> removed.  I've made that change in the attached update.  I'm not
> sure the corresponding pointer should at some point also be removed
> from the pointer_query class and replaced by calls to get_range_query
> (cfun).  If so, that would take some surgery to the strlen pass which
> also uses pointer_query and isn't quite ready to make this switch.
> 
> 
>>
>> Are you planning to transition to using the get_range_query() 
>> interface instead of keeping a range_query pointer in the 
>> pointer_query class?
> 
> This pass and to a smaller extent the pointer_query class that's
> used by it and the strlen pass are still a work in progress.
> I also still need to convert the strlen pass to use Ranger and
> I expect it will take some changes to pointer_query.  So at that
> point, if going through get_range_query (cfun) everywhere is what
> you recommend, I'm happy to do it.
> 
> Anyway, attached is an updated revision with the m_ranger member
> removed and a few helpers changed to take a range_query argument
> to use the pointer_query member instead.  It was retested on
> x86_64-linux.
> 
> Martin
> 
> PS There has been an effort to get rid of global variables from GCC,
> or, as the first step, to avoid accessing them directly(*).  If and
> when that happens, it seems like each pass will have to store either
> the ranger instance as a member (directly or indirectly, via a member
> of a class that stores it) or the function passed to pass::execute()
> if it wants to access either.
> 
> [*] https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573975.html
> The patch at the link above wasn't approved but IIUC removing globals
> from GCC is still a goal.


  reply	other threads:[~2021-08-25 15:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 23:09 [PATCH] " Martin Sebor
2021-08-20 13:09 ` Andrew MacLeod
2021-08-20 22:16   ` Martin Sebor
2021-08-25 15:20     ` Martin Sebor [this message]
2021-08-25 16:14       ` [PING][PATCH] " Andrew MacLeod
2021-08-25 21:26         ` Martin Sebor
2021-08-30 14:27           ` [PING #2][PATCH] " Martin Sebor
2021-08-31  6:00             ` Richard Biener

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=ba41ff81-809b-8cc0-2983-f2e082266ec7@gmail.com \
    --to=msebor@gmail.com \
    --cc=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).