RFR: 8328865: [c2] No need to convert "(x+1)+y" into "(x+y)+1" when y is a CallNode [v2]

Emanuel Peter epeter at openjdk.org
Wed Mar 27 09:26:22 UTC 2024


On Wed, 27 Mar 2024 08:45:55 GMT, SUN Guoyun <duke at openjdk.org> wrote:

>> This patch prohibits the conversion from  "(x+1)+y" into "(x+y)+1" when y is a CallNode to reduce unnecessary spillcode and ADDNode.
>> 
>> Testing: tier1-3 in x86_64 and LoongArch64
>> 
>> JMH in x86_64:
>> <pre>
>> before:
>> Benchmark           Mode  Cnt      Score   Error  Units
>> CallNode.test      thrpt    2  26397.733          ops/s
>> 
>> after:
>> Benchmark           Mode  Cnt      Score   Error  Units
>> CallNode.test      thrpt    2  27839.337          ops/s
>> </pre>
>
> SUN Guoyun has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
> 
>  - 8328865: [c2] No need to convert "(x+1)+y" into "(x+y)+1" when y is a CallNode
>  - 8328865: [c2] No need to convert "(x+1)+y" into "(x+y)+1" when y is a CallNode

Ah, I just saw your attached benchmark. Will have a look at it later.

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

PR Comment: https://git.openjdk.org/jdk/pull/18482#issuecomment-2022293394


More information about the hotspot-compiler-dev mailing list