RFR: 8252219: C2: Randomize IGVN worklist for stress testing [v2]
Vladimir Kozlov
kvn at openjdk.java.net
Tue Sep 22 17:07:19 UTC 2020
On Tue, 22 Sep 2020 12:44:33 GMT, Roberto Castañeda Lozano <github.com+8792647+robcasloz at openjdk.org> wrote:
>> Add `StressIGVN` option to let C2 randomize IGVN worklist order. When enabled, the worklist is shuffled before each
>> main run of the IGVN loop. Also add `GenerateStressSeed` and `StressSeed=N` options to randomly generate or specify the
>> seed. In either case, the seed is logged if `LogCompilation` is enabled. The new options are declared as
>> production+diagnostic for consistency with the existing `StressLCM` and `StressGCM` options.
>
> Roberto Castañeda Lozano has updated the pull request with a new target base due to a merge or a rebase. The
> incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five
> additional commits since the last revision:
> - Apply minor rearrangements to simplify the patch
> - Do not use the per-compilation seed for StressLCM and StressGCM
>
> Use global seed for StressLCM and StressGCM as before to preserve their behavior
> by now. In the future, these options can also benefit from using the local
> (per-compilation) seed by simply using Compile::random() instead of os::random()
> and extending the Compile constructor accordingly.
> - Merge branch 'master' of github.com:robcasloz/jdk into JDK-8252219
> - Replace global seed with compilation-local seeds for repeatability
>
> Replace usage of global seed for stress testing with a seed per compilation, to
> make stress runs repeatable in the face of concurrent method compilations. This
> affects StressLCM, StressGCM, and StressIGVN. Reuse pseudonumber generation
> logic in os::random_helper.
> - 8252219: C2: Randomize IGVN worklist for stress testing
>
> Add 'StressIGVN' option to let C2 randomize IGVN worklist order. When enabled,
> the worklist is shuffled before each main run of the IGVN loop. Also add
> 'GenerateStressSeed' and 'StressSeed=N' options to randomly generate or specify
> the seed. In either case, the seed is logged if 'LogCompilation' is enabled.
>
> The generation or specification of seeds also affects the randomization
> triggered by 'StressLCM' and 'StressGCM'. The new options are declared as
> production+diagnostic for consistency with these existing options.
src/hotspot/share/opto/compile.cpp line 4456:
> 4454:
> 4455: int Compile::random() {
> 4456: _stress_seed = os::next_random(_stress_seed);
I don't see os::next_random() in runtime/os.hpp
src/hotspot/share/opto/c2_globals.hpp line 58:
> 56: "Generate random seed for IGVN stress testing") \
> 57: \
> 58: product(uintx, StressSeed, 0, DIAGNOSTIC, \
uintx is 64 bit type. Use uint as type for _stress_seed field.
-------------
PR: https://git.openjdk.java.net/jdk/pull/242
More information about the hotspot-compiler-dev
mailing list