public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 00/23] prange: pointer ranges
@ 2024-05-04  8:30 Aldy Hernandez
  2024-05-04  8:30 ` [COMMITTED 01/23] Minimal prange class showing inlining degradation to VRP Aldy Hernandez
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: Aldy Hernandez @ 2024-05-04  8:30 UTC (permalink / raw)
  To: GCC patches; +Cc: Andrew MacLeod, Aldy Hernandez

This patchset implements prange, a range class for pointers.

This is meant to be a drop-in replacement for pointer ranges, so we
can pull them out of irange, simplifying both irange and prange in the
process.  Initially we have two integer endpoints and the usual
value/mask bitmasks as this is how irange currently implements them,
but the end goal is to provide points-to info to replace the hacky
pointer equivalency we do in class pointer_equiv_analyzer.

I have split up the patchset into tiny pieces to make it easier to
track any problems.  I have also disabled it by default, choosing to
wait a few days until the dust has settled.  In a few days I will
throw the switch enabling pranges, which will make it invalid for
irange's to hold pointers.  Once pranges are enabled, I will do some
minor cleanups like removing pointer support from range-ops, etc.

The performance of prange is a wash for VRP and a 7% improvement for
IPA-cp.  This is taking into account the unrelated 2% hit we take due to
inlining as discussed here:

https://gcc.gnu.org/pipermail/gcc/2024-May/243898.html

Also, as part of this work, we improved VRP by 6% (on top of the above
numbers):

https://gcc.gnu.org/pipermail/gcc-patches/2024-May/650320.html

So things are looking relatively good.

The memory usage will also decrease, both by the 14% reduction in
Value_Range, and by prange's being smaller than say int_range_max or
int_range<3>.

Tested and benchmarked on x86-64 Linux.

Aldy Hernandez (23):
  Minimal prange class showing inlining degradation to VRP.
  Implement basic prange class.
  Add streaming support for prange.
  Add storage support for prange.
  Add hashing support for prange.
  Add prange implementation for get_legacy_range.
  Implement range-op dispatch for prange.
  Implement operator_identity for prange.
  Implement operator_cst for prange.
  Implement operator_cast for prange.
  Implement operator_min and operator_max for prange.
  Implement operator_addr_expr for prange.
  Implement pointer_plus_operator for prange.
  Implement operator_pointer_diff for prange.
  Implement operator_bitwise_and for prange.
  Implement operator_bitwise_or for prange.
  Implement operator_not_equal for prange.
  Implement operator_equal for prange.
  Implement operator_lt for prange.
  Implement operator_le for prange.
  Implement operator_gt for prange.
  Implement operator_ge for prange....
  Add prange entries in gimple-range-op.cc.

 gcc/data-streamer-in.cc         |   12 +
 gcc/data-streamer-out.cc        |   10 +
 gcc/gimple-range-op.cc          |   36 +
 gcc/range-op-mixed.h            |  156 ++++
 gcc/range-op-ptr.cc             | 1545 +++++++++++++++++++++++++++++++
 gcc/range-op.cc                 |  124 +++
 gcc/range-op.h                  |  111 +++
 gcc/value-range-pretty-print.cc |   25 +
 gcc/value-range-pretty-print.h  |    1 +
 gcc/value-range-storage.cc      |  117 +++
 gcc/value-range-storage.h       |   33 +
 gcc/value-range.cc              |  354 ++++++-
 gcc/value-range.h               |  214 ++++-
 13 files changed, 2730 insertions(+), 8 deletions(-)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-05-04  8:31 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-04  8:30 [PATCH 00/23] prange: pointer ranges Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 01/23] Minimal prange class showing inlining degradation to VRP Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 02/23] Implement basic prange class Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 03/23] Add streaming support for prange Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 04/23] Add storage " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 05/23] Add hashing " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 06/23] Add prange implementation for get_legacy_range Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 07/23] Implement range-op dispatch for prange Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 08/23] Implement operator_identity " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 09/23] Implement operator_cst " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 10/23] Implement operator_cast " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 11/23] Implement operator_min and operator_max " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 12/23] Implement operator_addr_expr " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 13/23] Implement pointer_plus_operator " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 14/23] Implement operator_pointer_diff " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 15/23] Implement operator_bitwise_and " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 16/23] Implement operator_bitwise_or " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 17/23] Implement operator_not_equal " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 18/23] Implement operator_equal " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 19/23] Implement operator_lt " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 20/23] Implement operator_le " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 21/23] Implement operator_gt " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 22/23] Implement operator_ge " Aldy Hernandez
2024-05-04  8:30 ` [COMMITTED 23/23] Add prange entries in gimple-range-op.cc Aldy Hernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).