On Fri, 11 Sep 2026 00:28:35 GMT, Chen Liang <[email protected]> wrote:
>> The return value of `convert0('X', vspecies().withLanes(laneType))` is
>> polymorphic, making the subsequent call `swapIfNeeded` megamorphic and thus
>> causing allocations. We have the constant species available and should
>> execute code on the species instead.
>>
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Chen Liang 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 five additional commits since
> the last revision:
>
> - Merge branch 'master' of github.com:openjdk/jdk into
> fix/vector-reinterpret-cliff
> - Tweak asByteVectorRawTemplate to avoid reversal for bytes
> - Introduce a regression test
> - 8392004
> - Try to fix sublane swap inline
At least for the non-BE case, we can now constant fold even if the vector
operand to swapIfNeeded is polymorphic. This represents the majority of use
cases. If convert0's intrinsic can't constant fold, I can't help from the
library side.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/32803#issuecomment-5724221937