aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-cache.h
AgeCommit message (Collapse)AuthorFilesLines
2021-09-13Merged current trunk to branch.Thomas Koenig1-22/+20
2020-11-04Add Ranger temporal cacheAndrew MacLeod1-0/+3
Add a timestamp to supplement the global range cache to detect when a value may become stale. gcc/ PR tree-optimization/97515 * gimple-range-cache.h (class ranger_cache): New prototypes plus temporal cache pointer. * gimple-range-cache.cc (struct range_timestamp): New. (class temporal_cache): New. (temporal_cache::temporal_cache): New. (temporal_cache::~temporal_cache): New. (temporal_cache::get_timestamp): New. (temporal_cache::set_dependency): New. (temporal_cache::temporal_value): New. (temporal_cache::current_p): New. (temporal_cache::set_timestamp): New. (temporal_cache::set_always_current): New. (ranger_cache::ranger_cache): Allocate the temporal cache. (ranger_cache::~ranger_cache): Free temporal cache. (ranger_cache::get_non_stale_global_range): New. (ranger_cache::set_global_range): Add a timestamp. (ranger_cache::register_dependency): New. Add timestamp dependency. * gimple-range.cc (gimple_ranger::range_of_range_op): Add operand dependencies. (gimple_ranger::range_of_phi): Ditto. (gimple_ranger::range_of_stmt): Check if global range is stale, and recalculate if so. gcc/testsuite/ * gcc.dg/pr97515.c: Check listing for folding of entire function.
2020-11-03More Ranger cache tweaksAndrew MacLeod1-4/+6
This patch splits the individual value propagation out from fill_block_cache, and calls it from set_global_value when the global value is updated. This ensures the "current" global value is reflected in the on-entry cache. * gimple-range-cache.cc (ssa_global_cache::get_global_range): Return true if there was a previous range set. (ranger_cache::ranger_cache): Take a gimple_ranger parameter. (ranger_cache::set_global_range): Propagate the value if updating. (ranger_cache::propagate_cache): Renamed from iterative_cache_update. (ranger_cache::propagate_updated_value): New. Split from: (ranger_cache::fill_block_cache): Split out value propagator. * gimple-range-cache.h (ssa_global_cache): Update prototypes. (ranger_cache): Update prototypes.
2020-11-03Tweaks to ranger cacheAndrew MacLeod1-2/+9
Add some bounds checking to ssa_block_ranges, and privatize the ranges block cache and global cache, adding API points for accessing them. * gimple-range-cache.h (block_range_cache): Add new entry point. (ranger_cache): Privatize global abnd block cache members. * gimple-range-cache.cc (ssa_block_ranges::set_bb_range): Add bounds check. (ssa_block_ranges::set_bb_varying): Ditto. (ssa_block_ranges::get_bb_range): Ditto. (ssa_block_ranges::bb_range_p): Ditto. (block_range_cache::get_block_ranges): Fix formatting. (block_range_cache::query_block_ranges): New. (block_range_cache::get_bb_range): Use Query_block_ranges. (block_range_cache::bb_range_p): Ditto. (ranger_cache::dump): New. (ranger_cache::get_global_range): New. (ranger_cache::set_global_range): New. * gimple-range.cc (gimple_ranger::range_of_expr): Use new API. (gimple_ranger::range_of_stmt): Ditto. (gimple_ranger::export_global_ranges): Ditto. (gimple_ranger::dump): Ditto.
2020-10-06Ranger classes.Andrew MacLeod1-0/+120
Add the 8 ranger files and the Makefile changes to build it. 2020-10-06 Andrew MacLeod <amacleod@redhat.com> * Makefile.in (OBJS): Add gimple-range*.o. * gimple-range.h: New file. * gimple-range.cc: New file. * gimple-range-cache.h: New file. * gimple-range-cache.cc: New file. * gimple-range-edge.h: New file. * gimple-range-edge.cc: New file. * gimple-range-gori.h: New file. * gimple-range-gori.cc: New file.