RFR: 8337066: Repeated call of StringBuffer.reverse with double byte string returns wrong result [v3]
Igor Veresov
iveresov at openjdk.org
Tue Oct 8 15:39:37 UTC 2024
> 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.
Igor Veresov has updated the pull request incrementally with one additional commit since the last revision:
Update src/hotspot/share/opto/gcm.cpp
Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/21222/files
- new: https://git.openjdk.org/jdk/pull/21222/files/e9295d93..e80084ed
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=21222&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=21222&range=01-02
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/21222.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/21222/head:pull/21222
PR: https://git.openjdk.org/jdk/pull/21222
More information about the hotspot-compiler-dev
mailing list