RFR: 8369258: C2: enable ReassociateInvariants for all loop types [v3]

Emanuel Peter epeter at openjdk.org
Thu Oct 16 06:50:09 UTC 2025


On Wed, 15 Oct 2025 15:52:08 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> Currently ReassociateInvariants is only enabled for int counted
>> loops. I noticed, enabling it for long counted loops helps RCE. It
>> also seems like something that would help any loop. I propose enabling
>> it for all inner loops.
>
> Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review

Thanks for the updates, looks even better now :)

test/hotspot/jtreg/compiler/loopopts/TestReassociateInvariants.java line 72:

> 70:     // removal of long counted loop. The long counted loop is
> 71:     // transformed into a loop nest with an inner int counted
> 72:     // loop. That one is empty and is removed.

Sounds like we should file an RFE for long counted loop removal, right?

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

Marked as reviewed by epeter (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27666#pullrequestreview-3343291039
PR Review Comment: https://git.openjdk.org/jdk/pull/27666#discussion_r2434759865


More information about the hotspot-compiler-dev mailing list