RFR: 8335628: C2 SuperWord: cleanup: remove SuperWord::longer_type_for_conversion [v3]
Vladimir Kozlov
kvn at openjdk.org
Mon Jul 29 15:58:35 UTC 2024
On Mon, 8 Jul 2024 07:13:05 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.
>
> Emanuel Peter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>
> - Merge branch 'master' into JDK-8335628-rm-sw-longer_type_for_conversion
> - Merge branch 'master' into JDK-8335628-rm-sw-longer_type_for_conversion
> - 8335628
There was micro `TypeVectorOperations.java ` in [8283091](https://github.com/openjdk/jdk/commit/a1795901ee292fa6272768cef2fedcaaf8044074) changes. Can you check that there is no regression on our supported platforms?
-------------
PR Review: https://git.openjdk.org/jdk/pull/20009#pullrequestreview-2205374713
More information about the hotspot-compiler-dev
mailing list