diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2024-05-07 14:05:50 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2024-05-08 08:12:48 +0200 |
commit | 36e877996936abd8bd08f8b1d983c8d1023a5842 (patch) | |
tree | 11984fa2d34d0b0d218ef8fd794e455350579f25 /gcc/range-op.cc | |
parent | f6ce85502eb2e4e7bbd9b3c6c1c065a004f8f531 (diff) | |
download | gcc-36e877996936abd8bd08f8b1d983c8d1023a5842.zip gcc-36e877996936abd8bd08f8b1d983c8d1023a5842.tar.gz gcc-36e877996936abd8bd08f8b1d983c8d1023a5842.tar.bz2 |
Enable prange support.
This throws the switch on prange. After this patch, it is no longer
valid to store a pointer in an irange (or vice versa). Instead, they
must go in prange, which is faster and more memory efficient.
I will push this now, so I have time to do any follow-up bugfixing
before going on paternity leave.
There are various cleanups we plan on doing after this patch (faster
intersect/union, remove range-op-mixed.h, remove value_range in favor
of int_range_max, reclaim the name for the Value_Range temporary,
clean up range-ops, etc etc). But we will hold off on those for now
to make it easier to revert this patch, if for some reason we need to
do so while I'm away.
Tested on x86-64 Linux.
gcc/ChangeLog:
* gimple-range-cache.cc (sbr_sparse_bitmap::sbr_sparse_bitmap):
Change irange to prange.
* gimple-range-fold.cc (fold_using_range::fold_stmt): Same.
(fold_using_range::range_of_address): Same.
* gimple-range-fold.h (range_of_address): Same.
* gimple-range-infer.cc (gimple_infer_range::add_nonzero): Same.
* gimple-range-op.cc (class cfn_strlen): Same.
* gimple-range-path.cc
(path_range_query::adjust_for_non_null_uses): Same.
* gimple-ssa-warn-access.cc (pass_waccess::check_pointer_uses): Same.
* tree-ssa-structalias.cc (find_what_p_points_to): Same.
* range-op-ptr.cc (range_op_table::initialize_pointer_ops): Remove
hybrid entries in table.
* range-op.cc (range_op_table::range_op_table): Add pointer
entries for bitwise and/or and min/max.
* value-range.cc (irange::verify_range): Add assert.
* value-range.h (irange::varying_compatible_p): Remove check for
error_mark_node.
(irange::supports_p): Remove pointer support.
* ipa-cp.h (ipa_supports_p): Add prange support.
Diffstat (limited to 'gcc/range-op.cc')
-rw-r--r-- | gcc/range-op.cc | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 65f3843..245385f 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -102,23 +102,13 @@ range_op_table::range_op_table () set (MINUS_EXPR, op_minus); set (NEGATE_EXPR, op_negate); set (MULT_EXPR, op_mult); - - // Occur in both integer and pointer tables, but currently share - // integral implementation. set (ADDR_EXPR, op_addr); set (BIT_NOT_EXPR, op_bitwise_not); set (BIT_XOR_EXPR, op_bitwise_xor); - - // These are in both integer and pointer tables, but pointer has a different - // implementation. - // If commented out, there is a hybrid version in range-op-ptr.cc which - // is used until there is a pointer range class. Then we can simply - // uncomment the operator here and use the unified version. - - // set (BIT_AND_EXPR, op_bitwise_and); - // set (BIT_IOR_EXPR, op_bitwise_or); - // set (MIN_EXPR, op_min); - // set (MAX_EXPR, op_max); + set (BIT_AND_EXPR, op_bitwise_and); + set (BIT_IOR_EXPR, op_bitwise_or); + set (MIN_EXPR, op_min); + set (MAX_EXPR, op_max); } // Instantiate a default range operator for opcodes with no entry. |