RFR: 8252219: C2: Randomize IGVN worklist for stress testing [v3]
Christian Hagedorn
chagedorn at openjdk.java.net
Wed Sep 23 10:45:03 UTC 2020
On Tue, 22 Sep 2020 19:27:20 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 incrementally with one additional commit since the last revision:
>
> Define 'StressSeed' option as 'uint' rather than 'uintx'
Maybe you could add an additional HelloWorld test which only runs with your new flags to sanity check them without any
other flags.
src/hotspot/share/opto/phaseX.cpp line 1153:
> 1151: DEBUG_ONLY(uint num_processed = 0;)
> 1152: NOT_PRODUCT(init_verifyPhaseIterGVN();)
> 1153: if (StressIGVN) C->shuffle(&_worklist);
You should add curly braces. You could also move `shuffle` to `PhaseIterGVN`.
src/hotspot/share/opto/compile.cpp line 4462:
> 4460: void Compile::shuffle(Unique_Node_List* l) {
> 4461: if (l->size() < 2) return;
> 4462: for (uint i = l->size() - 1; i >= 1; i--) {
You can remove the if-check as the loop check already covers it (loop is only executed if size >= 2).
-------------
Changes requested by chagedorn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/242
More information about the hotspot-compiler-dev
mailing list