On 11/7/25 13:28, Richard Biener wrote:

Am 07.11.2025 um 15:46 schrieb Andrew MacLeod <[email protected]>:


On 11/7/25 08:29, Richard Biener wrote:
When feeding non-SSA names to range_on_edge we degrade to a
non-contextual query even though range_on_exits handling suggests
that we can do better.  The following does what it does in
range_on_edge directly, passing the edge source as 'bbend'
argument to get_tree_range if the edge source has a single
successor (as will be the case for queries from niter analysis).

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

OK?  The remainder of the series makes use of this, I'll hold of
that a bit for followup work.
Yeah, That's good.
I did wonder whether the else path using range_on_exit is wrong in this regard?

Richard

No it is correct

For the most part GORI calculates edge ranges for ssa-names independant of their actual range.    So this is combined with the range-on-exit from the block, to produce the actual range on the edge.

ie,  if (a > 100)     GORI will produce [101, +INF] for the edge range of 'a' on the true side.

It is combined with the on exit range of 'a' in the edges src block to determine the true range of 'a' on an edge.,

      range_on_exit (r, e->src, name);
      <...>
      if (m_cache.range_on_edge (edge_range, e, name))
        r.intersect (edge_range);

In your path with a non-SSA name, its important to only use the on exit range if there is a single successor since there will be no edge adjustment.

Andrew



Reply via email to