RFR: 8369258: C2: enable ReassociateInvariants for all loop types
Emanuel Peter
epeter at openjdk.org
Mon Oct 13 08:22:07 UTC 2025
On Tue, 7 Oct 2025 07:36:41 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.
Nice. That looks reasonable. And great that it addresses my two reports!
I think you should now close my two reports as duplicates.
Once this is integrated, I'll do some investigations on `TestAliasingFuzzer.java`, to see if we might be able to enable some more IR rules there. If not, I'll file some more reports ;)
I'll run some internal testing now...
test/hotspot/jtreg/compiler/loopopts/TestReassociateInvariants.java line 28:
> 26: * @summary
> 27: * @library /test/lib /
> 28: * @run driver compiler.loopopts.TestReassociateInvariants
I'm missing a `@bug 8369258`
Suggestion:
* @test
* @bug 8369258
* @summary
* @library /test/lib /
* @run driver compiler.loopopts.TestReassociateInvariants
test/hotspot/jtreg/compiler/loopopts/superword/TestMemorySegment_8365982.java line 40:
> 38: * can also tighten up the IR rules there.
> 39: * @library /test/lib /
> 40: * @run driver compiler.loopopts.superword.TestMemorySegment_8365982
You should add the new bug-id to the one above! `@bug 8324751 8369258`
test/hotspot/jtreg/compiler/loopopts/superword/TestMemorySegment_8365982.java line 88:
> 86: // does not have any range checks any more.
> 87: // Now it vectorizes. That's good, but we should be able to vectorize without multiversioning.
> 88: //
Can you please also remove the comments below?
test/hotspot/jtreg/compiler/loopopts/superword/TestMemorySegment_ReassociateInvariants1.java line 40:
> 38: * can also tighten up the IR rules there.
> 39: * @library /test/lib /
> 40: * @run driver compiler.loopopts.superword.TestMemorySegment_ReassociateInvariants1
You should add the new bug-id to the one above! `@bug 8324751 8369258`
-------------
PR Review: https://git.openjdk.org/jdk/pull/27666#pullrequestreview-3330405292
PR Review Comment: https://git.openjdk.org/jdk/pull/27666#discussion_r2425522357
PR Review Comment: https://git.openjdk.org/jdk/pull/27666#discussion_r2425516994
PR Review Comment: https://git.openjdk.org/jdk/pull/27666#discussion_r2425519554
PR Review Comment: https://git.openjdk.org/jdk/pull/27666#discussion_r2425515941
More information about the hotspot-compiler-dev
mailing list