RFR: 8347555: [REDO] C2: implement optimization for series of Add of unique value [v20]
Roland Westrelin
roland at openjdk.org
Tue Oct 7 12:25:09 UTC 2025
On Mon, 6 Oct 2025 14:12:30 GMT, Kangcheng Xu <kxu at openjdk.org> wrote:
>> src/hotspot/share/opto/addnode.hpp line 74:
>>
>>> 72: Multiplication add(const Multiplication rhs) const {
>>> 73: if (is_valid_with(rhs.variable()) && rhs.is_valid_with(variable())) {
>>> 74: return {variable(), java_add(multiplier(), rhs.multiplier())};
>>
>> You should use a constructor call here
>
> clang-tidy suggested to
>
>> Avoid repeating the return type from the declaration; use a braced initializer list instead
>
> I believe they generate the same code for this case, but I updated to explicitly use constructor making it more clear. Thanks!
I think you should change that one as well to keep everything consistent.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23506#discussion_r2410433511
More information about the hotspot-compiler-dev
mailing list