From fd4cf7a092bb2ce21c0d8246c17c0b7f82de440c Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Thu, 22 Feb 2024 09:18:46 +0100 Subject: Move bitmask routines to vrange base class. Any range can theoretically have a bitmask of set bits. This patch moves the bitmask accessors to the base class. This cleans up some users in IPA*, and will provide a cleaner interface when prange is in place. gcc/ChangeLog: * ipa-cp.cc (propagate_bits_across_jump_function): Access bitmask through base class. (ipcp_store_vr_results): Same. * ipa-prop.cc (ipa_compute_jump_functions_for_edge): Same. (ipcp_get_parm_bits): Same. (ipcp_update_vr): Same. * range-op-mixed.h (update_known_bitmask): Change argument to vrange. * range-op.cc (update_known_bitmask): Same. * value-range.cc (vrange::update_bitmask): New. (irange::set_nonzero_bits): Move to vrange class. (irange::get_nonzero_bits): Same. * value-range.h (class vrange): Add update_bitmask, get_bitmask, get_nonzero_bits, and set_nonzero_bits. (class irange): Make bitmask methods virtual overrides. (class Value_Range): Add get_bitmask and update_bitmask. --- gcc/range-op.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/range-op.cc') diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 4ccb86e..aeff55c 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -415,8 +415,8 @@ range_op_handler::operand_check_p (tree t1, tree t2, tree t3) const // LH and RH. void -update_known_bitmask (irange &r, tree_code code, - const irange &lh, const irange &rh) +update_known_bitmask (vrange &r, tree_code code, + const vrange &lh, const vrange &rh) { if (r.undefined_p () || lh.undefined_p () || rh.undefined_p () || r.singleton_p ()) -- cgit v1.1