Clean up and virtualize the on-entry cache interface.
authorAndrew MacLeod <amacleod@redhat.com>
Fri, 7 May 2021 16:03:01 +0000 (12:03 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Fri, 7 May 2021 19:01:35 +0000 (15:01 -0400)
commit14b0f37a644d7b59e1737fb275ec4fff044972a8
tree82f00813ce65dafa682bc3f092f8e599af64968c
parenta7943ea96d6a076a06eb06bd71a2656e682b8a78
Clean up and virtualize the on-entry cache interface.

Cleanup/Virtualize the ssa_block_range class, and implement the current
vector approach as a derived class.
Allow memory allocation from the irange allocator obstack for easy freeing.

* gimple-range-cache.cc (ssa_block_ranges): Virtualize.
(sbr_vector): Renamed from ssa_block_cache.
(sbr_vector::sbr_vector): Allocate from obstack abd initialize.
(ssa_block_ranges::~ssa_block_ranges): Remove.
(sbr_vector::set_bb_range): Use varying and undefined cached values.
(ssa_block_ranges::set_bb_varying): Remove.
(sbr_vector::get_bb_range): Adjust assert.
(sbr_vector::bb_range_p): Adjust assert.
(~block_range_cache): No freeing loop required.
(block_range_cache::get_block_ranges): Remove.
(block_range_cache::set_bb_range): Inline get_block_ranges.
(block_range_cache::set_bb_varying): Remove.
* gimple-range-cache.h (set_bb_varying): Remove prototype.
* value-range.h (irange_allocator::get_memory): New.
gcc/gimple-range-cache.cc
gcc/gimple-range-cache.h
gcc/value-range.h