diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2018-11-14 16:29:41 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2018-11-14 16:29:41 +0000 |
commit | ff361cc65f8e90aa77884c93d77e592cc470d6b7 (patch) | |
tree | 8b95736bf2742adb4c897e564733110891f59e8b | |
parent | 62ec3fe8f1bb871c19b6d30b3051443293276d54 (diff) | |
download | gcc-ff361cc65f8e90aa77884c93d77e592cc470d6b7.zip gcc-ff361cc65f8e90aa77884c93d77e592cc470d6b7.tar.gz gcc-ff361cc65f8e90aa77884c93d77e592cc470d6b7.tar.bz2 |
* gimple-ssa-evrp-analyze.c
(evrp_range_analyzer::record_ranges_from_incoming_edge): Rename
ignore_equivs_equal_p to equal_p.
* ipa-cp.c (meet_with_1): Use equal_p instead of
ignore_equivs_equal_p.
* ipa-prop.c (ipa_vr_ggc_hash_traits::equal): Same.
* tree-vrp.c (value_range::ignore_equivs_equal_p): Remove.
(value_range::operator==): Remove.
(value_range::operator!=): Remove.
(vrp_prop::visit_stmt): Use equal_p.
* tree-vrp.h (value_range): Remove operator==, operator!=,
ignore_equivs_equal_p.
* vr-values.c (update_value_range): Use equal_p.
From-SVN: r266150
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/gimple-ssa-evrp-analyze.c | 2 | ||||
-rw-r--r-- | gcc/ipa-cp.c | 2 | ||||
-rw-r--r-- | gcc/ipa-prop.c | 2 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 32 | ||||
-rw-r--r-- | gcc/tree-vrp.h | 10 | ||||
-rw-r--r-- | gcc/vr-values.c | 2 |
7 files changed, 37 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f83b0ed..3efd96b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2018-11-14 Aldy Hernandez <aldyh@redhat.com> + + * gimple-ssa-evrp-analyze.c + (evrp_range_analyzer::record_ranges_from_incoming_edge): Rename + ignore_equivs_equal_p to equal_p. + * ipa-cp.c (meet_with_1): Use equal_p instead of + ignore_equivs_equal_p. + * ipa-prop.c (ipa_vr_ggc_hash_traits::equal): Same. + * tree-vrp.c (value_range::ignore_equivs_equal_p): Remove. + (value_range::operator==): Remove. + (value_range::operator!=): Remove. + (vrp_prop::visit_stmt): Use equal_p. + * tree-vrp.h (value_range): Remove operator==, operator!=, + ignore_equivs_equal_p. + * vr-values.c (update_value_range): Use equal_p. + 2018-11-14 Michael Matz <matz@suse.de> PR middle-end/86575 diff --git a/gcc/gimple-ssa-evrp-analyze.c b/gcc/gimple-ssa-evrp-analyze.c index bd11eea..220dde0 100644 --- a/gcc/gimple-ssa-evrp-analyze.c +++ b/gcc/gimple-ssa-evrp-analyze.c @@ -209,7 +209,7 @@ evrp_range_analyzer::record_ranges_from_incoming_edge (basic_block bb) value_range *old_vr = get_value_range (vrs[i].first); value_range tem (old_vr->kind (), old_vr->min (), old_vr->max ()); tem.intersect (vrs[i].second); - if (tem.ignore_equivs_equal_p (*old_vr)) + if (tem.equal_p (*old_vr, /*ignore_equivs=*/true)) continue; push_value_range (vrs[i].first, vrs[i].second); if (is_fallthru diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 81da108..6b9dc8c 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -928,7 +928,7 @@ ipcp_vr_lattice::meet_with_1 (const value_range_base *other_vr) value_range_base save (m_vr); m_vr.union_ (other_vr); - return !m_vr.ignore_equivs_equal_p (save); + return !m_vr.equal_p (save); } /* Return true if value range information in the lattice is yet unknown. */ diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index c779d86..7405235 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -121,7 +121,7 @@ struct ipa_vr_ggc_hash_traits : public ggc_cache_remove <value_range_base *> static bool equal (const value_range_base *a, const value_range_base *b) { - return a->ignore_equivs_equal_p (*b); + return a->equal_p (*b); } static void mark_empty (value_range_base *&p) diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index f498386..53d5bd6 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -210,37 +210,27 @@ value_range::check () } } -/* Returns TRUE if THIS == OTHER. Ignores the equivalence bitmap if - IGNORE_EQUIVS is TRUE. */ - -bool -value_range::equal_p (const value_range &other, bool ignore_equivs) const -{ - return (ignore_equivs_equal_p (other) - && (ignore_equivs - || vrp_bitmap_equal_p (m_equiv, other.m_equiv))); -} - -/* Return equality while ignoring equivalence bitmap. */ +/* Equality operator. We purposely do not overload ==, to avoid + confusion with the equality bitmap in the derived value_range + class. */ bool -value_range_base::ignore_equivs_equal_p (const value_range_base &other) const +value_range_base::equal_p (const value_range_base &other) const { return (m_kind == other.m_kind && vrp_operand_equal_p (m_min, other.m_min) && vrp_operand_equal_p (m_max, other.m_max)); } -bool -value_range::operator== (const value_range &other) const -{ - return equal_p (other, /*ignore_equivs=*/false); -} +/* Returns TRUE if THIS == OTHER. Ignores the equivalence bitmap if + IGNORE_EQUIVS is TRUE. */ bool -value_range::operator!= (const value_range &other) const +value_range::equal_p (const value_range &other, bool ignore_equivs) const { - return !(*this == other); + return (value_range_base::equal_p (other) + && (ignore_equivs + || vrp_bitmap_equal_p (m_equiv, other.m_equiv))); } /* Return TRUE if this is a symbolic range. */ @@ -5382,7 +5372,7 @@ vrp_prop::visit_stmt (gimple *stmt, edge *taken_edge_p, tree *output_p) value_range new_vr; extract_range_basic (&new_vr, use_stmt); const value_range *old_vr = get_value_range (use_lhs); - if (*old_vr != new_vr) + if (!old_vr->equal_p (new_vr, /*ignore_equivs=*/false)) res = SSA_PROP_INTERESTING; else res = SSA_PROP_NOT_INTERESTING; diff --git a/gcc/tree-vrp.h b/gcc/tree-vrp.h index 2878603..de3221e 100644 --- a/gcc/tree-vrp.h +++ b/gcc/tree-vrp.h @@ -63,7 +63,9 @@ public: void union_ (const value_range_base *); - bool ignore_equivs_equal_p (const value_range_base &) const; + bool operator== (const value_range_base &) const /* = delete */; + bool operator!= (const value_range_base &) const /* = delete */; + bool equal_p (const value_range_base &) const; /* Misc methods. */ tree type () const; @@ -119,10 +121,11 @@ class GTY((user)) value_range : public value_range_base void set_nonnull (tree); void set_null (tree); - bool operator== (const value_range &) const; - bool operator!= (const value_range &) const; + bool operator== (const value_range &) const /* = delete */; + bool operator!= (const value_range &) const /* = delete */; void intersect (const value_range *); void union_ (const value_range *); + bool equal_p (const value_range &, bool ignore_equivs) const; /* Types of value ranges. */ void set_undefined (); @@ -142,7 +145,6 @@ class GTY((user)) value_range : public value_range_base /* Deep-copies bitmap argument. */ void set_equiv (bitmap); void check (); - bool equal_p (const value_range &, bool ignore_equivs) const; void intersect_helper (value_range *, const value_range *); /* Set of SSA names whose value ranges are equivalent to this one. diff --git a/gcc/vr-values.c b/gcc/vr-values.c index 8682904..41862b9 100644 --- a/gcc/vr-values.c +++ b/gcc/vr-values.c @@ -180,7 +180,7 @@ vr_values::update_value_range (const_tree var, value_range *new_vr) /* Update the value range, if necessary. */ old_vr = get_value_range (var); - is_new = *old_vr != *new_vr; + is_new = !old_vr->equal_p (*new_vr, /*ignore_equivs=*/false); if (is_new) { |