RFR: 8270366: C2: Add associative rule to add/sub node
Zhengyu Gu
zgu at openjdk.java.net
Wed Jul 14 14:04:44 UTC 2021
On Tue, 13 Jul 2021 14:04:45 GMT, Andrew Dinn <adinn at openjdk.org> wrote:
> Hi Zhengyu,
>
> It looks like you are missing a case for both long and int. Your code looks for these patterns:
>
> ```
> a*b+a*c --> a*(b+c)
> a*b+b*c --> b*(a+c)
> a*c+b*c --> (a+b)*c
> ```
>
> So you are not transforming this this case
>
> ```
> a*b+c*a -> a*(b+c)
> ```
-------------
PR: https://git.openjdk.java.net/jdk/pull/4765
More information about the hotspot-compiler-dev
mailing list