RFR(S): 8201532: Update idom to get correct dom depth calculation
nils.eliasson at oracle.com
Fri Apr 13 11:03:27 UTC 2018
In testing we hit an assert in insert_post_loop that the dom depth was
wrong. I tracked down the cause to be a node replacement in counted
loops that only does a lazy_replace. Lazy replace is enough when all
later transformation are using the idom()-getter (it checks the
new-to-old-mapping in _nodes). In insert_post_loop we use dom depth for
an assert. The dom-depth have been recalculated, but
recompue_dom_depth-call doesn't use the lazy mappings and computes dom
depth on the old and stale data.
This problem started show up due to loop strip mining and ZGC barriers.
ZGC loadbarriers can be moved out of loops, that increases the loop
depth of the loop node. Loop strip mining adds an outer loop also affect
the loop depth. If there exists previous lazy updates to the idom when
those optimizations are done, the dom depth recalculation will be wrong,
and asserts can be hit.
More information about the hotspot-compiler-dev