8204927: ZGC: assert(phase->idom(head) == head->in(LoopNode::EntryControl)) failed
authorneliasso
Fri, 15 Jun 2018 13:57:37 +0200
changeset 50627 70ccca2e60aa
parent 50626 9fdfe5ca0e5e
child 50628 83b1a52f187c
8204927: ZGC: assert(phase->idom(head) == head->in(LoopNode::EntryControl)) failed Summary: Update idom Reviewed-by: roland
src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
--- a/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Tue Jun 19 10:57:13 2018 +0200
+++ b/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp	Fri Jun 15 13:57:37 2018 +0200
@@ -1181,8 +1181,14 @@
           if (is_strip_mined && (i == LoopNode::EntryControl)) {
             assert(region->in(i)->is_OuterStripMinedLoop(), "");
             igvn.replace_input_of(region->in(i), i, out_ctrl);
+            phase->set_idom(region->in(i), out_ctrl, phase->dom_depth(out_ctrl));
           } else if (ctrl == region->in(i)) {
             igvn.replace_input_of(region, i, out_ctrl);
+            // Only update the idom if is the loop entry we are updating
+            // - A loop backedge doesn't change the idom
+            if (region->is_Loop() && i == LoopNode::EntryControl) {
+              phase->set_idom(region, out_ctrl, phase->dom_depth(out_ctrl));
+            }
           } else {
             Node* iff = region->in(i)->in(0);
             igvn.replace_input_of(iff, 0, out_ctrl);