Integrated: 8257211: C2: Enable call devirtualization during post-parse phase
Vladimir Ivanov
vlivanov at openjdk.java.net
Mon Dec 7 22:54:29 UTC 2020
On Tue, 1 Dec 2020 22:54:04 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> As of now, call devirtualization is performed only during parsing. After parsing is over, virtual calls stay unchanged even if there's enough information available to successfully devirtualize them.
>
> Proposed patch enhances incremental inlining with virtual call support. The implementation is similar to how late inlining through MethodHandle linkers works: `CallGenerator` is linked from related `CallJavaNode` and once the call becomes eligible for devirtualization, it is put on the late inline list for future processing. It enables inlining through the call, but also even when inlining doesn't happen, devirtualization is beneficial anyway: it strength-reduces a virtual call to a static call (optimised virtual).
>
> Also, the patch introduces a dedicated pass over inline list very late in the pipeline specifically to strength reduce virtual calls to static ones w/o even attempting inlining. And it covers late inlining of MethodHandle linkers along the way.
>
> Initial version of the patch has been integrated into `panama-dev` (`vectorIntrinsics` branch) in July, 2020 [1] and since then it went through multiple rounds of testing and a number of bugs were fixed.
>
> (Original motivation for the work was Vector API which suffered severe performance regression after major API and implementation refactoring (`vector-unstable` branch), but it turned out it benefits ordinary Java code as well.)
>
> Testing:
> - [x] hs-tier1-6 w/ and w/o `-XX:+AlwaysIncrementalInline` and `-XX:+StressMethodHandleLinkerInlining`
>
> Thanks!
>
> [1] https://hg.openjdk.java.net/panama/dev/rev/5b601a43ac88
This pull request has now been integrated.
Changeset: 62c7788b
Author: Vladimir Ivanov <vlivanov at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/62c7788b
Stats: 774 lines in 15 files changed: 510 ins; 147 del; 117 mod
8257211: C2: Enable call devirtualization during post-parse phase
Reviewed-by: kvn, neliasso, thartmann
-------------
PR: https://git.openjdk.java.net/jdk/pull/1550
More information about the hotspot-compiler-dev
mailing list