path solver: Use ranger to solve unknowns.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 21 Sep 2021 07:24:12 +0000 (09:24 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 21 Sep 2021 16:55:14 +0000 (18:55 +0200)
commit97cfb54c3ff15b9691fd1c12a29de56966bf8e0d
tree8d7f17bee680f8445056a4ced6d40cdeaa35d683
parente4249b10038bd906f50c00759b37807dd2fffede
path solver: Use ranger to solve unknowns.

The default behavior for the path solver is to resort to VARYING when
the range for an unknown SSA is outside the given path.  This is both
cheap and fast, but fails to get a significant amount of ranges that
traditionally the DOM and VRP threaders could get.

This patch uses the ranger to resolve any unknown names upon entry to
the path.  It also uses equivalences to improve ranges.

gcc/ChangeLog:

* gimple-range-path.cc (path_range_query::defined_outside_path):
New.
(path_range_query::range_on_path_entry): New.
(path_range_query::internal_range_of_expr): Resolve unknowns
with ranger.
(path_range_query::improve_range_with_equivs): New.
(path_range_query::ssa_range_in_phi): Resolve unknowns with
ranger.
* gimple-range-path.h (class path_range_query): Add
defined_outside_path, range_on_path_entry, and
improve_range_with_equivs.
gcc/gimple-range-path.cc
gcc/gimple-range-path.h