[lworld] RFR: 8325417: [lworld] Incorrect re-execution state at uncommon traps emitted by acmp

Tobias Hartmann thartmann at openjdk.org
Thu Feb 8 15:13:19 UTC 2024


The `acmp` implementation in C2 uses `Parse::do_if` for pointer comparison and other checks. That method then adds traps to (unstable) if branches that are never taken based on profiling. `OptimizeUnstableIf` would set an incorrect re-execution state because it assumes that there is a 1-1 mapping between the if and the acmp branches and that hitting a trap means that we will take the corresponding acmp branch on re-execution. That is not correct and will lead to pruning of supposedly dead locals and thus incorrect re-execution.

I also had to adjust some tests that incorrectly assumed that we should skip the substitutability test if acmp profiling suggested that the operands are always equal and only keep the pointer comparison. That's not correct because two value objects can be equal/substitutable even if the pointer comparison is false.

Thanks,
Tobias

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

Commit messages:
 - Test fixes
 - Test
 - 8325417: [lworld] Incorrect re-execution state at uncommon traps emitted by acmp

Changes: https://git.openjdk.org/valhalla/pull/1000/files
 Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1000&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8325417
  Stats: 179 lines in 6 files changed: 157 ins; 5 del; 17 mod
  Patch: https://git.openjdk.org/valhalla/pull/1000.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1000/head:pull/1000

PR: https://git.openjdk.org/valhalla/pull/1000



More information about the valhalla-dev mailing list