[lworld] RFR: 8264586: [lworld] C2 compilation fails due to infinite loop in PhaseIterGVN::optimize

Tobias Hartmann thartmann at openjdk.java.net
Tue Apr 6 12:45:53 UTC 2021


The problem is an `InlineTypePtrNode` that becomes dead after CCP removes a redundant null check and then keeps several other nodes alive. Since we don't run any loop opts anymore after CCP, the dead subgraph is not removed and the dead nodes are also not re-processed by `PhaseCCP::transform_once` to update their bottom types. As a result, two `LoadNodes` only used by a `ValueTypePtrNode` end up with types that are inconsistent with their bottom types and are re-enqueued for IGVN indefinitely by this code:
https://github.com/openjdk/valhalla/blob/28a4ec0249fd86fe17f2b816c6f5f8eed31abfeb/src/hotspot/share/opto/memnode.cpp#L352-L358

I think we should aggressively remove `InlineTypePtrNodes` if they are no longer needed to keep track of the individual field values. I've added an Ideal transformation to take care of that.

The patch also includes a fix for an unrelated "Control flow was added although the intrinsic bailed out" failure and some cleanup/refactoring.

Thanks,
Tobias

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

Commit messages:
 - 8264586: [lworld] C2 compilation fails due to infinite loop in PhaseIterGVN::optimize

Changes: https://git.openjdk.java.net/valhalla/pull/377/files
 Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=377&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8264586
  Stats: 66 lines in 6 files changed: 55 ins; 8 del; 3 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/377.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/377/head:pull/377

PR: https://git.openjdk.java.net/valhalla/pull/377


More information about the valhalla-dev mailing list