Implement class vrange_storage to stream ranges to long term memory.
This patch implements a storage class that will be used to stream out
ranges to long term storage, initially in SSA_NAME_RANGE_INFO, but it
is flexible enough to use with our obstack allocator. For instance,
in the future we could use it in the ranger cache to save memory.
The current size of range_info_def which is used in
SSA_NAME_RANGE_INFO is 16 bytes. With this patch, the size of the
slot (irange_storage_slot) will be 24 bytes. But we'll have the
ability to be able to store up to 5 pairs of sub-ranges if necessary.
If we ever need to save more (say for switches), we could explore a
trailing_wide_ints structure with a pointer to the m_len[N] bits as
Jakub has suggested.
In follow-up patches I will contribute the SSA_NAME_RANGE_INFO changes
as well as changes storing the nonzero bits within an irange.
For reference, the main interface is rather simple:
The above class will have the knowledge to stream out the different
ranges we support (currently only irange_storage_slot). As has been
discussed, the irange storage will use trailing wide ints:
class GTY ((variable_size)) irange_storage_slot
{
<snip>
<snip>
// This is the maximum number of wide_int's allowed in the trailing
// ints structure, without going over 16 bytes (128 bits) in the
// control word that preceeds the HOST_WIDE_INTs in
// trailing_wide_ints::m_val[].
static const unsigned MAX_INTS = 12;
// Maximum number of range pairs we can handle, considering the
// nonzero bits take one wide_int.
static const unsigned MAX_PAIRS = (MAX_INTS - 1) / 2;