RFR: 8288883: C2: assert(allow_address || t != T_ADDRESS) failed after JDK-8283091

Martin Doerr mdoerr at openjdk.org
Thu Jul 14 09:33:58 UTC 2022


On Wed, 6 Jul 2022 07:51:01 GMT, Fei Gao <fgao at openjdk.org> wrote:

> Superword doesn't vectorize any nodes of non-primitive types and
> thus sets `allow_address` false when calling type2aelembytes() in
> SuperWord::data_size()[1]. Therefore, when we try to resolve the
> data size for a node of T_ADDRESS type, the assertion in
> type2aelembytes()[2] takes effect.
> 
> We try to resolve the data sizes for node s and node t in the
> SuperWord::adjust_alignment_for_type_conversion()[3] when type
> conversion between different data sizes happens. The issue is,
> when node s is a ConvI2L node and node t is an AddP node of
> T_ADDRESS type, type2aelembytes() will assert. To fix it, we
> should filter out all non-primitive nodes, like the patch does
> in SuperWord::adjust_alignment_for_type_conversion(). Since
> it's a failure in the mid-end, all superword available platforms
> are affected. In my local test, this failure can be reproduced
> on both x86 and aarch64. With this patch, the failure can be fixed.
> 
> Apart from fixing the bug, the patch also adds necessary type check
> and does some clean-up in SuperWord::longer_type_for_conversion()
> and VectorCastNode::implemented().
> 
> [1]https://github.com/openjdk/jdk/blob/dddd4e7c81fccd82b0fd37ea4583ce1a8e175919/src/hotspot/share/opto/superword.cpp#L1417
> [2]https://github.com/openjdk/jdk/blob/b96ba19807845739b36274efb168dd048db819a3/src/hotspot/share/utilities/globalDefinitions.cpp#L326
> [3]https://github.com/openjdk/jdk/blob/dddd4e7c81fccd82b0fd37ea4583ce1a8e175919/src/hotspot/share/opto/superword.cpp#L1454

Your fix LGTM. The test doesn't show the problem on PPC64, but my original replay file has worked to verify the fix.

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

Marked as reviewed by mdoerr (Reviewer).

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


More information about the hotspot-compiler-dev mailing list