RFR: 8347997: assert(false) failed: EA: missing memory path

Vladimir Kozlov kvn at openjdk.org
Fri Jan 24 00:14:58 UTC 2025


C2's Escape Analysis does not recognize pattern where one input of memory `Phi` node is `MergeMem` node and an other is RAW store. This pattern is created by Continuation pinning intrinsic. As result EA complains about strange memory graph.

I suggest to add second `MergeMem` between Store and Phi nodes by calling `reset_memory()`. EA recognize such patter and removes allocations.

I checked generated assembler pinning code and it is the same as before. The only difference in the test is eliminated allocations.

I moved Uncommon code up to avoid resetting memory - it is already done at the beginning of this intrinsic code.

We should not use `uncommon_trap_exact()` for `Deoptimization::Action_none` - It is used for other actions to prevent changing them to `Action_none`.

Tested tier1-5, hs-xcomp, hs-comp-stress
Added new regression test based on reproducer from bug report.

-------------

Commit messages:
 - Remove trailing space
 - 8347997: assert(false) failed: EA: missing memory path

Changes: https://git.openjdk.org/jdk/pull/23284/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23284&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8347997
  Stats: 119 lines in 2 files changed: 104 ins; 13 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/23284.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23284/head:pull/23284

PR: https://git.openjdk.org/jdk/pull/23284


More information about the hotspot-compiler-dev mailing list