RFR: 8288883: C2: assert(allow_address || t != T_ADDRESS) failed after JDK-8283091
Fei Gao
fgao at openjdk.org
Wed Jul 6 08:01:52 UTC 2022
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
-------------
Commit messages:
- 8288883: C2: assert(allow_address || t != T_ADDRESS) failed after JDK-8283091
Changes: https://git.openjdk.org/jdk/pull/9391/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9391&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8288883
Stats: 116 lines in 5 files changed: 89 ins; 9 del; 18 mod
Patch: https://git.openjdk.org/jdk/pull/9391.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9391/head:pull/9391
PR: https://git.openjdk.org/jdk/pull/9391
More information about the hotspot-dev
mailing list