Integrated: 8295407: C2 crash: Error: ShouldNotReachHere() in multiple vector tests with -XX:-MonomorphicArrayCheck -XX:-UncommonNullCast
Fei Gao
fgao at openjdk.org
Thu Nov 17 01:44:14 UTC 2022
On Tue, 8 Nov 2022 02:36:13 GMT, Fei Gao <fgao at openjdk.org> wrote:
> For unsupported `CMove` patterns, [JDK-8293833](https://bugs.openjdk.org/browse/JDK-8295407) helps remove unused `CMove` and related packs from superword candidate packset by the function `remove_cmove_and_related_packs()`, but it only works when `-XX:+UseVectorCmov` is enabled[1]. When the option is not enabled, these unsupported `CMove` packs are still kept in the superword packset, causing the same failure.
>
> Actually, the function `filter_packs()` in superword is to filter out unsupported packs but it can't work as expected currently for these `CMove` cases. As we know, not all `CMove` packs can be vectorized. `merge_packs_to_cmovd()`[2] looks through all packs in the superword packset and generates a `CMove` candidate packset to collect all qualified `CMove` packs. Hence, only `CMove` packs in the `CMove` candidate packset are our target patterns and can be vectorized. But `filter_packs()` thinks, if the `CMove` pack is in a superword packset and its vector node is implemented in the current platform, then it can be vectorized. Therefore, the function doesn't remove these unsupported packs.
>
> We can adjust the function `implemented()` in the stage of `filter_packs()` to check if the current `CMove` pack is in the `CMove` candidate packset. If not, `filter_packs()` considers it not to be vectorized and then remove it. After the fix, whether
> `-XX:+UseVectorCmov` is enabled or not, these unsupported packs can be removed by `filter_packs()`. In this way, we don't need the function`remove_cmove_and_related_packs()` anymore and thus the patch also cleans related code.
>
> [1] https://github.com/openjdk/jdk/blob/9b9be88bcaa35c89b6915ff0c251e5a04b10b330/src/hotspot/share/opto/superword.cpp#L537
> [2] https://github.com/openjdk/jdk/blob/9b9be88bcaa35c89b6915ff0c251e5a04b10b330/src/hotspot/share/opto/superword.cpp#L1892
This pull request has now been integrated.
Changeset: cc444198
Author: Fei Gao <fgao at openjdk.org>
Committer: Pengfei Li <pli at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/cc44419840d98fed0bcdab66bbb835855f1a8a11
Stats: 175 lines in 3 files changed: 74 ins; 45 del; 56 mod
8295407: C2 crash: Error: ShouldNotReachHere() in multiple vector tests with -XX:-MonomorphicArrayCheck -XX:-UncommonNullCast
Reviewed-by: thartmann, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/11034
More information about the hotspot-compiler-dev
mailing list