RFR: 8281453: New optimization: convert `~x` into `-1-x` when `~x` is used in an arithmetic expression [v7]

Zhiqiang Zang duke at openjdk.org
Thu Sep 15 17:03:35 UTC 2022


On Wed, 13 Apr 2022 17:56:56 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> Optimization you proposed does not match RFE description and title.
> 
> You do only: `~x` or (x ^ (-1))`->`(-1 - x)`
> 
> As result this should be Xor nodes ideal transformation. I don't even think you need such transformation if `rhs` and `lhs` are not constants because I assume `XOR` and `SUB` hw instructions have the same latency.
> 
> I suggest you to redo performance testing after you merged #7795 changes.

Hello @vnkozlov I updated the performance results and updated description and title as well. Can you please take a look when you get a chance thank you!

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

PR: https://git.openjdk.org/jdk/pull/7376


More information about the hotspot-compiler-dev mailing list