https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114151
--- Comment #23 from Andrew Macleod <amacleod at redhat dot com> --- Created attachment 57686 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57686&action=edit another patch (In reply to Richard Biener from comment #22) > (In reply to Andrew Macleod from comment #21) > > > > And have that all work with general trees expressions.. That would solve > > much of this for you? > > Yes, I wouldn't mind if range_on_{entry,exit} handle general tree > expressions, > there's enough APIs to be confused with already ;) > > > I promoted range_on_exit and range_on_entry to be part of the API in this patch. This brings valeu_query in line with rangers basic 5 routine API. It also tweaks rangers versions to handle tree expressions. It bootstraps and shows no regressions, with the caveat that I haven't actually tested the usage of range_on_entry and exit with arbitrary trees. As you can see, I didnt change much... so it should work OK. > > > > > > > > > > Interestingly enough we somehow still need the > > > > > > > > > > > hunk of Andrews patch to do it :/ > > > > > > > That probably means there is another call somewhere in the chain with no > > context. However, I will say that functionality is more important than it > > seems. Should have been there from the start :-P. > > Possibly yes. It might be we fill rangers cache with VARYING and when > we re-do the query as a dependent one but with context we don't recompute > it? I also only patched up a single place in SCEV with the context so > I possibly missed some others that end up with a range query, for example > through niter analysis that might be triggered. My guess is the latter. Without a context and with that change, ranger evaluates the definition with the context at the location of the def, then simply uses that value. If anything it is dependent on later changes, the temporal cache should indicate it's out of date and trigger a new fold using current values.