RFR: 8345485: C2 MergeLoads: merge adjacent array/native memory loads into larger load [v4]

kuaiwei duke at openjdk.org
Fri Mar 21 10:09:14 UTC 2025


On Tue, 18 Mar 2025 08:46:37 GMT, kuaiwei <duke at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/c2/TestMergeLoads.java line 44:
>> 
>>> 42:  * @run main compiler.c2.TestMergeLoads aligned
>>> 43:  *
>>> 44:  * @requires os.arch != "riscv64" | vm.cpu.features ~= ".*zbb.*"
>> 
>> Can you remove this global requirement, so that those platforms can at least do result verification?
>> You can always add restrictions to the `@IR` rules.
>
> Ok, I will add them to @IR rules.

Fixed

>> test/hotspot/jtreg/compiler/c2/TestMergeLoads.java line 69:
>> 
>>> 67:         switch (args[0]) {
>>> 68:             case "aligned"     -> { framework.addFlags("-XX:-UseUnalignedAccesses"); }
>>> 69:             case "unaligned"   -> { framework.addFlags("-XX:+UseUnalignedAccesses"); }
>> 
>> Can you please also add an explicit run with `StressIGVN`? Because the flag is not whitelisted for the TestFramework, and so if it was set from the outside, the IR rules would not be executed. But it would be nice that your algorithm is stable to reorderings in IGVN ;)
>
> I think my optimization is not dependent on order of IGVN. I will verify it with this option. Thanks.

`StreassIGVN` tests added

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24023#discussion_r2007250651
PR Review Comment: https://git.openjdk.org/jdk/pull/24023#discussion_r2007251654


More information about the hotspot-compiler-dev mailing list