RFR: 8305073: Fix VerifyLoopOptimizations - step 2 - verify idom

Emanuel Peter epeter at openjdk.org
Fri May 12 09:48:47 UTC 2023


This is the second step in the `VerifyLoopOptimizations` revival.

Last step:
[JDK-8173709](https://bugs.openjdk.org/browse/JDK-8173709) Fix VerifyLoopOptimizations - step 1 - minimal infrastructure 
See PR for all the planned steps: https://github.com/openjdk/jdk/pull/13207

Next step:
[JDK-8307982](https://bugs.openjdk.org/browse/JDK-8307982) Fix VerifyLoopOptimizations - step 3 - fix ctrl/loop

-------

There only seemed to be one bug with idom that I could find up to **tier6 and stress testing**. That one bug already showed up with a simple `java -Xcomp --version`. But it is possible that there are more that we would find in the future, maybe with the fuzzer.

**Details about the bug** I fixed in `PhaseIdealLoop::create_new_if_for_predicate`:
We computed the `dom_lca_internal` for `rgn` too early - the following line can change the CFG such that the idom would change:
https://github.com/openjdk/jdk/blob/1e1abc4c086298060ccb13b63f646a298bbe3ef7/src/hotspot/share/opto/loopPredicate.cpp#L216

So I moved the idom computation down, until after we do not change the CFG anymore, and idom should be stable from there on.

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

Commit messages:
 - 8305073: Fix VerifyLoopOptimizations - step 2 - verify idom

Changes: https://git.openjdk.org/jdk/pull/13951/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13951&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8305073
  Stats: 30 lines in 2 files changed: 9 ins; 14 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/13951.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13951/head:pull/13951

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


More information about the hotspot-compiler-dev mailing list