aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/java
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2025-09-05 18:38:13 +0100
committerRichard Sandiford <rdsandiford@googlemail.com>2025-09-05 18:38:13 +0100
commit168cdfd137abacb2a227c4242d7a8c87270f22d4 (patch)
tree7019e36e017c4084c25f62dca7b9608e7b4365e0 /libjava/gnu/java
parent8e971d665a9922a73de3a37ec8e04aea975e0993 (diff)
downloadgcc-168cdfd137abacb2a227c4242d7a8c87270f22d4.zip
gcc-168cdfd137abacb2a227c4242d7a8c87270f22d4.tar.gz
gcc-168cdfd137abacb2a227c4242d7a8c87270f22d4.tar.bz2
rtl-ssa: Maintain clobber_group invariant [PR121757]
In order to reduce time complexity, rtl-ssa groups consecutive clobbers together. Each group of clobbers has a splay tree for lookup and manipulation purposes. This arrangement means that we might need to split a group (when inserting a new non-clobber definition between two clobbers) or to join consecutive groups together (when deleting an intervening non-clobber definition). To reduce the time complexity of these updates, the back pointer from a clobber to its group is only updated lazily. The invariant is supposed to be that the first clobber, last clobber, and splay tree root have the right group at all times, whereas other members of the group can have identifiably stale group pointers. However, a lack of abstraction meant that only some splay tree lookups correctly maintained this invariant. Others did not update the group pointer after installing a new root. This patch adds a helper that maintains the invariant and uses it in three places, one that was already correct and two that were wrong. The original lookup_clobber is still used in other code that manipulates groups as a whole. gcc/ PR rtl-optimization/121757 * rtl-ssa/accesses.h (clobber_group::lookup_clobber): New member function. * rtl-ssa/accesses.cc (clobber_group::lookup_clobber): Likewise. (clobber_group::prev_clobber, clobber_group::next_clobber) (function_info::add_clobber): Use it. gcc/testsuite/ PR rtl-optimization/121757 * g++.dg/pr121757.C: New test.
Diffstat (limited to 'libjava/gnu/java')
0 files changed, 0 insertions, 0 deletions