Integrated: 8337066: Repeated call of StringBuffer.reverse with double byte string returns wrong result
Igor Veresov
iveresov at openjdk.org
Tue Oct 8 23:25:05 UTC 2024
On Fri, 27 Sep 2024 16:02:29 GMT, Igor Veresov <iveresov at openjdk.org> wrote:
> This is essentially a defensive forward port of a solution for an issue discovered in 11, where a use of pinned load (for which we disable almost all transforms in `LoadNode::Ideal()`) leads to a graph shape that is not expected by `insert_anti_dependences()`
>
> The `insert_anti_dependences()` assumes that the memory input for a load is the root of the memory subgraph that it has to search for the possibly conflicting store. Usually this is true if we run all the memory optimizations but with pinned we don't.
>
> Compare the good graph shape (with control dependency set to `UnknownControl`):
> <img width="1128" alt="Good graph" src="https://github.com/user-attachments/assets/d2c72d20-bc3c-403f-b340-e7cfe6d1796d">
>
> With the graph produce with the nodes pinned:
> <img width="1206" alt="Bad graph" src="https://github.com/user-attachments/assets/bbd14b37-584b-4906-973e-93c9046975a6">
>
> With the "bad graph" loads and store don't share the same memory graph root, and therefore are not considered by `insert_anti_dependences()`. The solution, I think, could be to walk up the memory chain of the load, skipping MergeMems, in order to get to the real root and then run the precedence edge insertion algorithm from there.
This pull request has now been integrated.
Changeset: 7eab0a50
Author: Igor Veresov <iveresov at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/7eab0a506adffac7bed940cc020e37754f0adbdb
Stats: 59 lines in 2 files changed: 59 ins; 0 del; 0 mod
8337066: Repeated call of StringBuffer.reverse with double byte string returns wrong result
Reviewed-by: kvn, thartmann
-------------
PR: https://git.openjdk.org/jdk/pull/21222
More information about the hotspot-compiler-dev
mailing list