RFR(S) 8251271- C2: Compile::_for_igvn list is corrupted after RenumberLiveNodes

Nhat Nguyen honguye at microsoft.com
Fri Sep 4 18:34:05 UTC 2020


Hi everyone,

I'm sorry for overlooking that for_igvn is not empty once PhaseRenumberLive finishes.

On 03.09.20 19:29, Liu, Xin wrote:
> How about this? We can clear() the worklist out. 
> 
> diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp
> --- a/src/hotspot/share/opto/compile.cpp
> +++ b/src/hotspot/share/opto/compile.cpp
> @@ -2089,9 +2089,12 @@
>        ResourceMark rm;
>        PhaseRenumberLive prl = PhaseRenumberLive(initial_gvn(), for_igvn(), &new_worklist);
>      }
> +    Unique_Node_List* save_for_igvn = for_igvn();
>      set_for_igvn(&new_worklist);
>      igvn = PhaseIterGVN(initial_gvn());
>      igvn.optimize();
> +    set_for_igvn(save_for_igvn);
> +    for_igvn()->clear();
>    }

Thank you Xin for the suggestion -- I totally agree with it. ��

Nhat

-----Original Message-----
From: Tobias Hartmann <tobias.hartmann at oracle.com> 
Sent: Friday, September 4, 2020 2:29 AM
To: Liu, Xin <xxinliu at amazon.com>; Christian Hagedorn <christian.hagedorn at oracle.com>; Nhat Nguyen <honguye at microsoft.com>; hotspot-compiler-dev at openjdk.java.net
Subject: [EXTERNAL] Re: RFR(S) 8251271- C2: Compile::_for_igvn list is corrupted after RenumberLiveNodes

Hi Xin,

On 03.09.20 19:29, Liu, Xin wrote:
> How about this? We can clear() the worklist out. 
> 
> diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp
> --- a/src/hotspot/share/opto/compile.cpp
> +++ b/src/hotspot/share/opto/compile.cpp
> @@ -2089,9 +2089,12 @@
>        ResourceMark rm;
>        PhaseRenumberLive prl = PhaseRenumberLive(initial_gvn(), for_igvn(), &new_worklist);
>      }
> +    Unique_Node_List* save_for_igvn = for_igvn();
>      set_for_igvn(&new_worklist);
>      igvn = PhaseIterGVN(initial_gvn());
>      igvn.optimize();
> +    set_for_igvn(save_for_igvn);
> +    for_igvn()->clear();
>    }

That looks good to me.

Best regards,
Tobias


More information about the hotspot-compiler-dev mailing list