Integrated: 8335628: C2 SuperWord: cleanup: remove SuperWord::longer_type_for_conversion
Emanuel Peter
epeter at openjdk.org
Tue Aug 13 05:55:57 UTC 2024
On Wed, 3 Jul 2024 15:38:06 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> After [JDK-8325155](https://bugs.openjdk.org/browse/JDK-8325155), there is now only a single use of `SuperWord::longer_type_for_conversion`.
> The check there is rather useless, and we should just remove it for the sake of code complexity.
>
> **What did this check do?**
> It checks if the input-type of a node is larger than the output type, relevant in these cases:
> - `is_convert_opcode`
> - `is_scalar_op_that_returns_int_but_vector_op_returns_long`
>
> If there is a larger type, it checks if this larger type can even create vectors of at least size 2:
> - `Matcher::max_vector_size_auto_vectorization(longer_bt) < 2)`
>
> Of course if there cannot be vectors for this larger type, then we could avoid creating these vectors.
>
> **Why is it rather useless?**
> On most modern platforms, all types have vectors of at least length 2. So this would never fail on those platforms.
> And even if this check fails: we would pack the nodes and later reject those packs when we do the `implemented` checks. Hence, we do not wrongly vectorize anyway. The cost of removing this check is that on most platforms we do not have to do this check, and the few that it would fail for just have a bit more compilation time (but very very minimal increase). I think this is worth the reduction in complexity. But we could always revert this change if there are problems because of it.
This pull request has now been integrated.
Changeset: 73ddb7de
Author: Emanuel Peter <epeter at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/73ddb7deab26c526337ec6e7cd5f528f698a552c
Stats: 27 lines in 2 files changed: 0 ins; 26 del; 1 mod
8335628: C2 SuperWord: cleanup: remove SuperWord::longer_type_for_conversion
Reviewed-by: chagedorn, kvn
-------------
PR: https://git.openjdk.org/jdk/pull/20009
More information about the hotspot-compiler-dev
mailing list