aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2022-11-10 11:27:52 +0100
committerAldy Hernandez <aldyh@redhat.com>2022-11-11 14:52:10 +0100
commite0cfde7e8b36a8176b661af16dff91ebf4f99a8e (patch)
tree211fd5dfadced15f009861553e73e32f735b44ee
parentc0662c74969820fb576c8a2f35e946581c2c6f9d (diff)
downloadgcc-e0cfde7e8b36a8176b661af16dff91ebf4f99a8e.zip
gcc-e0cfde7e8b36a8176b661af16dff91ebf4f99a8e.tar.gz
gcc-e0cfde7e8b36a8176b661af16dff91ebf4f99a8e.tar.bz2
[range-ops] Remove specialized fold_range methods for various operators.
Remove some specialized fold_range methods that were merely setting maybe nonzero masks, as these are now subsumed by the generic version. gcc/ChangeLog: * range-op.cc (operator_mult::fold_range): Remove. (operator_div::fold_range): Remove. (operator_bitwise_and): Remove.
-rw-r--r--gcc/range-op.cc52
1 files changed, 0 insertions, 52 deletions
diff --git a/gcc/range-op.cc b/gcc/range-op.cc
index 0b01cf4..6fa3b15 100644
--- a/gcc/range-op.cc
+++ b/gcc/range-op.cc
@@ -1790,13 +1790,9 @@ cross_product_operator::wi_cross_product (irange &r, tree type,
class operator_mult : public cross_product_operator
{
- using range_operator::fold_range;
using range_operator::op1_range;
using range_operator::op2_range;
public:
- virtual bool fold_range (irange &r, tree type,
- const irange &lh, const irange &rh,
- relation_trio = TRIO_VARYING) const final override;
virtual void wi_fold (irange &r, tree type,
const wide_int &lh_lb,
const wide_int &lh_ub,
@@ -1816,18 +1812,6 @@ public:
} op_mult;
bool
-operator_mult::fold_range (irange &r, tree type,
- const irange &lh, const irange &rh,
- relation_trio trio) const
-{
- if (!cross_product_operator::fold_range (r, type, lh, rh, trio))
- return false;
-
- update_known_bitmask (r, MULT_EXPR, lh, rh);
- return true;
-}
-
-bool
operator_mult::op1_range (irange &r, tree type,
const irange &lhs, const irange &op2,
relation_trio) const
@@ -1979,24 +1963,9 @@ public:
virtual bool wi_op_overflows (wide_int &res, tree type,
const wide_int &, const wide_int &)
const final override;
- virtual bool fold_range (irange &r, tree type,
- const irange &lh, const irange &rh,
- relation_trio trio) const final override;
};
bool
-operator_div::fold_range (irange &r, tree type,
- const irange &lh, const irange &rh,
- relation_trio trio) const
-{
- if (!cross_product_operator::fold_range (r, type, lh, rh, trio))
- return false;
-
- update_known_bitmask (r, m_code, lh, rh);
- return true;
-}
-
-bool
operator_div::wi_op_overflows (wide_int &res, tree type,
const wide_int &w0, const wide_int &w1) const
{
@@ -2834,14 +2803,9 @@ operator_logical_and::op2_range (irange &r, tree type,
class operator_bitwise_and : public range_operator
{
- using range_operator::fold_range;
using range_operator::op1_range;
using range_operator::op2_range;
public:
- virtual bool fold_range (irange &r, tree type,
- const irange &lh,
- const irange &rh,
- relation_trio rel = TRIO_VARYING) const;
virtual bool op1_range (irange &r, tree type,
const irange &lhs,
const irange &op2,
@@ -2865,22 +2829,6 @@ private:
const irange &op2) const;
} op_bitwise_and;
-bool
-operator_bitwise_and::fold_range (irange &r, tree type,
- const irange &lh,
- const irange &rh,
- relation_trio) const
-{
- if (range_operator::fold_range (r, type, lh, rh))
- {
- if (!r.undefined_p () && !lh.undefined_p () && !rh.undefined_p ())
- r.set_nonzero_bits (wi::bit_and (lh.get_nonzero_bits (),
- rh.get_nonzero_bits ()));
- return true;
- }
- return false;
-}
-
// Optimize BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR of signed types
// by considering the number of leading redundant sign bit copies.