RFR: 8273454: C2: Transform (-a)*(-b) into a*b [v2]

Zhengyu Gu zgu at openjdk.java.net
Thu Sep 9 12:19:09 UTC 2021


On Thu, 9 Sep 2021 07:19:13 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> Yes, I would also prefer to move the optimization into `MulNode::Ideal`. @theRealELiu's patch is good but can be further improved by modifying the node inputs instead of returning a new node (similar to the other optimizations in `MulNode::Ideal`).
>
> Also, `Type::is_zero_type` can be used to detect 0 and instead of checking the opcodes, `Node::is_Sub` should be used.

Nice! Thanks, I will make changes accordingly.

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

PR: https://git.openjdk.java.net/jdk/pull/5403


More information about the hotspot-compiler-dev mailing list