diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-04-17 14:26:33 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-04-26 15:42:50 +0200 |
commit | 694c956b6b877e48323cf86c90c09237b7b0e8c8 (patch) | |
tree | 2849f7af5081259c283a52c0af30ff724c0c28d3 /gcc/tree-vrp.c | |
parent | 778032166d960d97541e652c59684d1187d0233c (diff) | |
download | gcc-694c956b6b877e48323cf86c90c09237b7b0e8c8.zip gcc-694c956b6b877e48323cf86c90c09237b7b0e8c8.tar.gz gcc-694c956b6b877e48323cf86c90c09237b7b0e8c8.tar.bz2 |
Remove irange::varying_p checks from symbolic_p and constant_p.
As of a few releases ago, varying_p() ranges are also constant_p.
Consequently, there is no need to check varying_p from either
symbolic_p or constant_p.
I have adjusted a few users of constant_p that were depending on
constant_p returning false for varying_p. In these cases, I have
placed the varying_p check before the constant_p check to avoid
the more expensive constant_p check when possible.
gcc/ChangeLog:
* gimple-ssa-evrp-analyze.c (evrp_range_analyzer::set_ssa_range_info):
Adjust for constant_p including varying_p.
* tree-vrp.c (vrp_prop::finalize): Same.
(determine_value_range): Same.
* vr-values.c (vr_values::range_of_expr): Same.
* value-range.cc (irange::symbolic_p): Do not check varying_p.
(irange::constant_p): Same.
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 62b9007..d968ef2 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -4059,7 +4059,7 @@ vrp_prop::finalize () continue; const value_range_equiv *vr = m_vr_values->get_value_range (name); - if (!name || !vr->constant_p ()) + if (!name || vr->varying_p () || !vr->constant_p ()) continue; if (POINTER_TYPE_P (TREE_TYPE (name)) @@ -4679,7 +4679,7 @@ determine_value_range (tree expr, wide_int *min, wide_int *max) { value_range vr; determine_value_range_1 (&vr, expr); - if (vr.constant_p ()) + if (!vr.varying_p () && vr.constant_p ()) { *min = wi::to_wide (vr.min ()); *max = wi::to_wide (vr.max ()); |