RFR: 8257057: C2: Improve safepoint processing during vector scalarization pass
Tobias Hartmann
thartmann at openjdk.java.net
Mon Nov 30 10:15:54 UTC 2020
On Thu, 26 Nov 2020 13:14:26 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> Cast nodes (`CheckCastPP`/`CastPP`) hinders scalarization of vectors since they aren't taken into account when affected safepoints are enumerated.
>
> Proposed fix implements a reversed variant of `Node::uncast()` to find all safepoints which have vectors referenced from their debug info and then uses `Node::uncast()` when iterating over debug edges. It is safe to ignore cast nodes (even the ones which carry control dependency): `VectorBox` already contains the most precise type information and the vector value it represents is immutable. So, it's safe to replace a fully constructed boxed vector instance with the vector value it contains and rematerialize the equivalent box instance if deoptimization happens.
>
> Testing:
> - `jdk/incubator/vector` tests w/ different flag combinations (no flags, `-Xcomp`, `-XX:+DeoptimizeALot`);
> - tier1-4
Looks good.
-------------
Marked as reviewed by thartmann (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/1456
More information about the hotspot-compiler-dev
mailing list