RFR: 8325495: C2: implement optimization for series of Add of unique value [v2]
Kangcheng Xu
kxu at openjdk.org
Mon Sep 30 06:46:39 UTC 2024
On Mon, 23 Sep 2024 11:39:41 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> I believe so. Consider the case `(a + a) * 3`. Recurse here allows us to extract `a` and factor `2 * 3 => 6`
>
> That case would be better handled in 2 steps, I think:
> `a+a` into `a*2` with a `AddNode` transformation
> `(a*2)*3` into `a*6` with a `MulNode` (or `LShift`) transformation. Can you check if it already exists?
Done. The new version doesn't use recurssions at all
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20754#discussion_r1780520892
More information about the hotspot-compiler-dev
mailing list