RFR: 8308103: Massive (up to ~30x) increase in C2 compilation time since JDK 17 [v2]

Roland Westrelin roland at openjdk.org
Wed Jul 19 07:27:15 UTC 2023


> A long chain of nodes are sunk out of a loop. Every time a node is
> moved out of the loop, a cast is created to pin the node out of the
> loop. When its input is next sunk, the cast is removed (the cast is
> replaced by its input) and a new cast is created. Some nodes on the
> chain have 2 other nodes in the chain as uses. When such a node is
> sunk, 2 cast nodes are created, one for each use. So as the compiler
> moves forward in the chain, the number of cast to remove grows. From
> some profiling, removing those casts is what takes a lot of time.
> 
> The fix I propose is, when a node is processed, to check whether a
> cast at the out of loop control was already created for that node and
> to reuse it.
> 
> The test case takes 6 minutes when I run it without the fix and 3
> seconds with it.

Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - review
 - Merge branch 'master' into JDK-8308103
 - fix & test

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/14732/files
  - new: https://git.openjdk.org/jdk/pull/14732/files/cdb24902..c3ba2887

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=14732&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=14732&range=00-01

  Stats: 63051 lines in 970 files changed: 11697 ins; 46140 del; 5214 mod
  Patch: https://git.openjdk.org/jdk/pull/14732.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14732/head:pull/14732

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


More information about the hotspot-compiler-dev mailing list