diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2022-02-14 19:43:40 -0500 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2022-02-15 17:03:27 -0500 |
commit | e15425e899e4a9eec768cf74aaf36cdbf1d29913 (patch) | |
tree | 19d92086586f3e8f60f478030c89710f2a6f41e9 /gcc/gimple-range-gori.h | |
parent | 84832cab6e43db7fa10ec53d15f8f8457aa31080 (diff) | |
download | gcc-e15425e899e4a9eec768cf74aaf36cdbf1d29913.zip gcc-e15425e899e4a9eec768cf74aaf36cdbf1d29913.tar.gz gcc-e15425e899e4a9eec768cf74aaf36cdbf1d29913.tar.bz2 |
Use GORI to evaluate arguments of a COND_EXPR.
Provide an API into gori to perform a basic evaluation of the arguments of a
COND_EXPR if they are in the dependency chain of the condition.
PR tree-optimization/104526
gcc/
* gimple-range-fold.cc (fold_using_range::range_of_cond_expr): Call
new routine.
* gimple-range-gori.cc (range_def_chain::get_def_chain): Force a build
of dependency chain if there isn't one.
(gori_compute::condexpr_adjust): New.
* gimple-range-gori.h (class gori_compute): New prototype.
gcc/testsuite/
* gcc.dg/pr104526.c: New.
Diffstat (limited to 'gcc/gimple-range-gori.h')
-rw-r--r-- | gcc/gimple-range-gori.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/gimple-range-gori.h b/gcc/gimple-range-gori.h index b799a84..605884e 100644 --- a/gcc/gimple-range-gori.h +++ b/gcc/gimple-range-gori.h @@ -158,6 +158,8 @@ class gori_compute : public gori_map public: gori_compute (int not_executable_flag = 0); bool outgoing_edge_range_p (irange &r, edge e, tree name, range_query &q); + bool condexpr_adjust (irange &r1, irange &r2, gimple *s, tree cond, tree op1, + tree op2, fur_source &src); bool has_edge_range_p (tree name, basic_block bb = NULL); bool has_edge_range_p (tree name, edge e); void dump (FILE *f); |