Integrated: 8308103: Massive (up to ~30x) increase in C2 compilation time since JDK 17
Roland Westrelin
roland at openjdk.org
Wed Jul 19 11:34:56 UTC 2023
On Fri, 30 Jun 2023 13:23:38 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> 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.
This pull request has now been integrated.
Changeset: c6ab9c29
Author: Roland Westrelin <roland at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/c6ab9c2905203e1ec897b3404f9179ff975d0054
Stats: 70 lines in 2 files changed: 69 ins; 0 del; 1 mod
8308103: Massive (up to ~30x) increase in C2 compilation time since JDK 17
Reviewed-by: kvn, thartmann, chagedorn
-------------
PR: https://git.openjdk.org/jdk/pull/14732
More information about the hotspot-compiler-dev
mailing list