https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114121

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #10)
> Could we for lookups if range isn't a subset of the found range pretend
> there was not a match, try to see through definitions again and only if it
> yields an equivalent result value range it the same?  Perhaps even remember
> the range used in it and in case we find non-subset lookup having the same
> result union the remembered range?

So pretend we record the first match with using a range that improves
the result in the hashtable.  Then, when looking up the second ref we
hit the hashtable entry, see it has an incompatible range so we can't
use the recorded value.  We can then easily only ignore the entry (the
prototype patch does this).  As we can't easily tell whether we used any
(or even which) range without doing multiple lookups for each ref and
comparing the result "re-doing" things wouldn't work.

But for determining two refs are equivalent it might be enough to avoid
recording any kind of range for when the value was "varying".  The value
of such hashtable entry would be usable even by lookups with narrower
range (but also not yielding any better "constant" value).

I'm trying to improve things this way.

Reply via email to