RFR: 8280126: C2: detect and remove dead irreducible loops [v3]

Vladimir Kozlov kvn at openjdk.org
Fri Jan 13 04:03:05 UTC 2023


On Thu, 12 Jan 2023 23:36:21 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Improvements after review (Vladimir K)
>
> src/hotspot/share/ci/ciTypeFlow.cpp line 1876:
> 
>> 1874:   // while(condition) { break; } infinite_loop;
>> 1875:   // Thus, we can understand lp as an outermost loop, and can terminate and
>> 1876:   // conclude: this block is in no irreducible loop.
> 
> `lp->parent() == nullptr` is true for RootNode too I think. But I see that you have an other check for Root.
> 
> I am confusing about case like next case (pseudo code):
> 
> void foo() {
>    if (condition2) goto A;
>    while (condition) { // irreducible
>       while (true) { ... } // infinite
>       A : {...}
>    }
> }

Also what about irreducible infinite loop?

void foo() {
   if (condition2) goto A;
   while (condition) { // irreducible
      while (true) {  // infinite
        A : {...}
      }
   }
}

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

PR: https://git.openjdk.org/jdk/pull/11764


More information about the hotspot-compiler-dev mailing list