RFR: 8287840: Dead copy region node blocks IfNode's fold-compares

Xin Liu xliu at openjdk.java.net
Tue Jun 7 05:31:13 UTC 2022


On Mon, 6 Jun 2022 23:45:41 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> IfNode::fold_compares() requires ctrl has a single output. I found some fold-compares case postpone to IterGVN2. The reason is that a dead region prevents IfNode::fold_compares() from transforming code.  The dead node is removed in IterGVN, but it's too late. 
>> 
>> This PR extends Node::has_special_unique_user() so `PhaseIterGVN::remove_globally_dead_node()` puts IfNode back to worklist. The following attempt will carry out fold-compares().
>
> Testing results are good.

@vnkozlov , 
Thank you for reviewing this.  

I found this issue for this method: https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/time/temporal/ChronoField.java#L687

Without this change, c2 processes the IfNode in IterGVN2 after CCP because `PhaseCCP::transform_once` put all IfNode to worklist.  I think it is good idea to get one thing done in one pass of IterGVN. 

thanks,
--lx

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

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


More information about the hotspot-compiler-dev mailing list