]> git.ipfire.org Git - thirdparty/gcc.git/commit
path solver: Add relation support.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 21 Sep 2021 07:04:20 +0000 (09:04 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 21 Sep 2021 16:55:14 +0000 (18:55 +0200)
commitf46d33637c71165622aa4c55008798cbd91a8696
treeb623530c77549d9c837cfa8bfaf267019e2dc570
parent198bc5ece960557044483b1c72417759b4630f04
path solver: Add relation support.

This patch adds relational support to the path solver.  It uses a
path_oracle that keeps track of relations within a path which are
augmented by relations on entry to the path.  With it, range_of_stmt,
range_of_expr, and friends can give relation aware answers.

gcc/ChangeLog:

* gimple-range-fold.h (class fur_source): Make oracle protected.
* gimple-range-path.cc (path_range_query::path_range_query): Add
resolve argument.  Initialize oracle.
(path_range_query::~path_range_query): Delete oracle.
(path_range_query::range_of_stmt): Adapt to use relations.
(path_range_query::precompute_ranges): Pre-compute relations.
(class jt_fur_source): New
(jt_fur_source::jt_fur_source): New.
(jt_fur_source::register_relation): New.
(jt_fur_source::query_relation): New.
(path_range_query::precompute_relations): New.
(path_range_query::precompute_phi_relations): New.
* gimple-range-path.h (path_range_query): Add resolve argument.
Add oracle, precompute_relations, precompute_phi_relations.
* tree-ssa-threadbackward.c (back_threader::back_threader): Pass
resolve argument to solver.
gcc/gimple-range-fold.h
gcc/gimple-range-path.cc
gcc/gimple-range-path.h
gcc/tree-ssa-threadbackward.c