RFR: 8308994: C2: Re-implement experimental post loop vectorization [v2]

Pengfei Li pli at openjdk.org
Mon Jul 3 07:46:15 UTC 2023


On Fri, 23 Jun 2023 09:48:27 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Pengfei Li has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address part of comments from Emanuel
>
> src/hotspot/share/opto/loopnode.cpp line 2280:
> 
>> 2278:   if (!stride_is_con()) {
>> 2279:     // Stride could be non-constant if a loop is vector masked
>> 2280:     return 0;
> 
> Could this break the assumption anywhere else that `stride_con != 0`?
> I fear that it may just silently succeed everywhere, or do checks like:
> 
> if (stride_con() > 0) {
>   // assume positive
> } else {
>   // assume negative (now wrong!)
> }
> 
> Might it be better to have an assert here, and do the `stride_is_con` checks at the call sites of `stride_con`?

I have reverted this change and turned to update `CountedLoopNode::stride_con()` (and add asserts there) to mitigate this potential issue. That one is a call site of this function and "int" counted loop transformation directly calls there. Before my patch, that function may also return 0.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250410252


More information about the hotspot-dev mailing list