@@ -465,6 +465,21 @@ set_nonzero_bits (tree name, const wide_int &mask)
set_range_info (name, r);
}
+/* Update the known bits of NAME.
+
+ Zero bits in MASK cover constant values. Set bits in MASK cover
+ unknown values. VALUE are the known bits. */
+
+void
+set_bitmask (tree name, const wide_int &value, const wide_int &mask)
+{
+ gcc_assert (!POINTER_TYPE_P (TREE_TYPE (name)));
+
+ int_range<2> r (TREE_TYPE (name));
+ r.update_bitmask (irange_bitmask (value, mask));
+ set_range_info (name, r);
+}
+
/* Return a widest_int with potentially non-zero bits in SSA_NAME
NAME, the constant for INTEGER_CST, or -1 if unknown. */
@@ -59,6 +59,7 @@ struct GTY(()) ptr_info_def
/* Sets the value range to SSA. */
extern bool set_range_info (tree, const vrange &);
extern void set_nonzero_bits (tree, const wide_int &);
+extern void set_bitmask (tree, const wide_int &value, const wide_int &mask);
extern wide_int get_nonzero_bits (const_tree);
extern bool ssa_name_has_boolean_range (tree);
extern void init_ssanames (struct function *, int);