RFR: 8347555: [REDO] C2: implement optimization for series of Add of unique value [v9]

Christian Hagedorn chagedorn at openjdk.org
Thu Apr 3 05:09:56 UTC 2025


On Wed, 2 Apr 2025 10:25:32 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Kangcheng Xu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix ((x<<y) << z) + (x<<y) patterns
>
> src/hotspot/share/opto/addnode.cpp line 509:
> 
>> 507:     if (rhs.valid && rhs.variable == n->in(1)) {
>> 508:       return Multiplication{true, rhs.variable, rhs.multiplier + 1};
>> 509:     }
> 
> Hmm, it seems these are patterns that you did not promise you would cover in the description above.
> It makes it a little difficult to keep the overview...

Just a drive-by comment what might help: Name the cases you cover in the description with `(1)`, (2)` etc. and add the numbers as comments in the code where you cover the patterns. This would support the mapping from description to implementation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23506#discussion_r2026196086


More information about the hotspot-compiler-dev mailing list