Fri, 25 Oct 2013 10:13:40 +0200
8026940: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
Summary: Remove input to junk phi if they also become dead during post_allocate_copy_removal
Reviewed-by: roland
src/share/vm/opto/postaloc.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/postaloc.cpp Wed Oct 23 20:20:03 2013 +0400 1.2 +++ b/src/share/vm/opto/postaloc.cpp Fri Oct 25 10:13:40 2013 +0200 1.3 @@ -97,7 +97,8 @@ 1.4 static bool expected_yanked_node(Node *old, Node *orig_old) { 1.5 // This code is expected only next original nodes: 1.6 // - load from constant table node which may have next data input nodes: 1.7 - // MachConstantBase, Phi, MachTemp, MachSpillCopy 1.8 + // MachConstantBase, MachTemp, MachSpillCopy 1.9 + // - Phi nodes that are considered Junk 1.10 // - load constant node which may have next data input nodes: 1.11 // MachTemp, MachSpillCopy 1.12 // - MachSpillCopy 1.13 @@ -112,7 +113,9 @@ 1.14 return (old == orig_old); 1.15 } else if (old->is_MachTemp()) { 1.16 return orig_old->is_Con(); 1.17 - } else if (old->is_Phi() || old->is_MachConstantBase()) { 1.18 + } else if (old->is_Phi()) { // Junk phi's 1.19 + return true; 1.20 + } else if (old->is_MachConstantBase()) { 1.21 return (orig_old->is_Con() && orig_old->is_MachConstant()); 1.22 } 1.23 return false; 1.24 @@ -522,11 +525,9 @@ 1.25 u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input 1.26 } 1.27 if (u != NodeSentinel) { // Junk Phi. Remove 1.28 - block->remove_node(j--); 1.29 + phi->replace_by(u); 1.30 + j -= yank_if_dead(phi, block, &value, ®nd); 1.31 phi_dex--; 1.32 - _cfg.unmap_node_from_block(phi); 1.33 - phi->replace_by(u); 1.34 - phi->disconnect_inputs(NULL, C); 1.35 continue; 1.36 } 1.37 // Note that if value[pidx] exists, then we merged no new values here