RFR: 8252219: C2: Randomize IGVN worklist for stress testing [v3]

Roberto Castañeda Lozano github.com+8792647+robcasloz at openjdk.java.net
Wed Sep 23 14:20:41 UTC 2020


On Wed, 23 Sep 2020 10:42:15 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> Maybe you could add an additional HelloWorld test which only runs with your new flags to sanity check them without any
> other flags.

Good idea, I just did that.

> 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`.

Done.

> 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).

Note that `size()` could be 0, leading `l->size() - 1` to underflow.

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

PR: https://git.openjdk.java.net/jdk/pull/242


More information about the hotspot-compiler-dev mailing list