RFR(S): 8201532: Update idom to get correct dom depth calculation

Roland Westrelin rwestrel at redhat.com
Fri Apr 13 15:03:28 UTC 2018

> What happens is that when the counted loop transformation replaces the 
> loop exit projections here 
> (http://hg.openjdk.java.net/jdk/hs/file/69bae761600b/src/hotspot/share/opto/loopnode.cpp#l728), 
> any recalculation of dom depth will continue to be wrong on the 
> successors. (Until the lazy mappings have propageted to the _idom.) If a 
> loadbarrier is moved out of the loop, or any other transformation is 
> performed that increases the loop depth, we may later fail in clone_loop 
> here 
> (http://hg.openjdk.java.net/jdk/hs/file/69bae761600b/src/hotspot/share/opto/loopopts.cpp#l2010) 
> when the new deeper dom depth of the loop is compared with the old doom 
> depth of the successor node.

Wouldn't the generic fix be to call idom() from recompute_dom_depth()?

There are very few calls to recompute_dom_depth() (2 actually: one for
partial peel and one for loop unswitching). The usual practice when
possible is to set the same dom depth for multiple control nodes
(there's not need for a recompute_dom_depth() call then). So I suppose
you could get rid of the extra recompute_dom_depth() calls in the zgc


More information about the hotspot-compiler-dev mailing list