* 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
This commit is contained in:
Aldy Hernandez 2018-11-14 16:29:41 +00:00 committed by Aldy Hernandez
parent 62ec3fe8f1
commit ff361cc65f
7 changed files with 37 additions and 29 deletions

View File

@ -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

View File

@ -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

View File

@ -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. */

View File

@ -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)

View File

@ -210,37 +210,27 @@ value_range::check ()
}
}
/* Returns TRUE if THIS == OTHER. Ignores the equivalence bitmap if
IGNORE_EQUIVS is TRUE. */
/* Equality operator. We purposely do not overload ==, to avoid
confusion with the equality bitmap in the derived value_range
class. */
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. */
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;

View File

@ -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.

View File

@ -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)
{