+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
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
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. */
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)
}
}
-/* 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. */
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;
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;
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 ();
/* 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.
/* 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)
{