diff options
| author | David Malcolm <dmalcolm@redhat.com> | 2026-01-26 18:57:51 -0500 |
|---|---|---|
| committer | David Malcolm <dmalcolm@redhat.com> | 2026-01-26 18:57:51 -0500 |
| commit | c28dd8467b1e35219b8d74c5ff96c43d49eb9612 (patch) | |
| tree | 3ce1098d24b1da6dd2c8618c0c6915c34cb85c0d /libjava/gnu/java | |
| parent | 4626921de245970b4bd6ab0a837841185cf7de2d (diff) | |
| download | gcc-c28dd8467b1e35219b8d74c5ff96c43d49eb9612.zip gcc-c28dd8467b1e35219b8d74c5ff96c43d49eb9612.tar.gz gcc-c28dd8467b1e35219b8d74c5ff96c43d49eb9612.tar.bz2 | |
analyzer: avoid calling binding_map::const_iterator::operator* [PR123145]
PR analyzer/123145 tracks a large slowdown seen in -fanalyzer on
a particular test case in qemu.
Profiling showed a large amount of time being spent iterating through
binding maps with binding_map::const_iterator::operator*, due to the
work spent converting from bit_range to concrete_key via
store_manager::get_concrete_binding.
Many of the iterations where this done are merely looking at the bound
svalues, not the keys, so this work is wasted.
This patch updates these iterations to avoid needing to do work on the
keys.
Crude benchmarking (on a debug, not release build) showed a speedup on
the test case, from 3 hours to 2.2 hours.
No functional change intended.
gcc/analyzer/ChangeLog:
PR analyzer/123145
* program-state.cc (sm_state_map::impl_set_state): Update
iteration to avoid looking up binding_key values.
* region-model-reachability.cc (reachable_regions::handle_sval):
Use iter.get_svalue.
(reachable_regions::handle_parm): Likewise.
* region-model.cc (iterable_cluster::iterable_cluster): Update
iteration to avoid looking up binding_key values.
(iterable_cluster::dump_to_pp): Likewise.
(exposure_through_uninit_copy::calc_num_uninit_bits): Likewise.
(exposure_through_uninit_copy::complain_about_uninit_ranges):
Likewise.
(contains_uninit_p): Likewise.
* store.cc (binding_map::hash): Likewise.
* store.h (bit_range::hash): New, based on...
(concrete_binding::hash): ...this. Reimplement using the above.
(binding_map::const_iterator::get_svalue): New decl.
(binding_map::get_symbolic_bindings): New accessor.
(binding_map::for_each_value): Update iteration to avoid looking
up binding_key values.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'libjava/gnu/java')
0 files changed, 0 insertions, 0 deletions
