RFR: 8307084: C2: Vectorized drain loop is not executed for some small trip counts [v4]

Emanuel Peter epeter at openjdk.org
Fri Jan 16 10:42:54 UTC 2026


On Fri, 16 Jan 2026 09:46:34 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Fei Gao has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits:
>> 
>>  - Fix build failure after rebasing and address review comments
>>  - Merge branch 'master' into optimize-atomic-post
>>  - Fixed new test failures after rebasing and refined parts of the code to address review comments
>>  - Merge branch 'master' into optimize-atomic-post
>>  - Merge branch 'master' into optimize-atomic-post
>>  - Clean up comments for consistency and add spacing for readability
>>  - Fix some corner case failures and refined part of code
>>  - Merge branch 'master' into optimize-atomic-post
>>  - Refine ascii art, rename some variables and resolve conflicts
>>  - Merge branch 'master' into optimize-atomic-post
>>  - ... and 3 more: https://git.openjdk.org/jdk/compare/a8552243...ab1de504
>
> src/hotspot/share/opto/loopTransform.cpp line 1944:
> 
>> 1942: 
>> 1943:   // Step 2: Find some key nodes which control the execution paths of the zero trip guard.
>> 1944:   // Step 2.1: Find 'zero_ctrl' which will be the control input of the zero trip guard.
> 
> Nit: "find" suggests that it already exists. That contradicts `zero_ctrl = new IfFalseNode(outer_main_end);` below a little.

Maybe "get" could be more neutral?

> src/hotspot/share/opto/loopnode.hpp line 1440:
> 
>> 1438:                                  // result control flow branches
>> 1439:                                  // either to inner clone or outer
>> 1440:                                  // strip mined loop.
> 
> I have trouble understanding the comments here (not your fault, it was here already).
> I'm also wondering if this is only used for `post_loop`? If so, maybe we could rename it, and improve the comments here?

At least in your code, it would read much better if it was called `InsertPost`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22629#discussion_r2697768299
PR Review Comment: https://git.openjdk.org/jdk/pull/22629#discussion_r2697734928


More information about the hotspot-compiler-dev mailing list