comparison src/share/vm/opto/postaloc.cpp @ 13012:f01788f13696

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
author adlertz
date Fri, 25 Oct 2013 10:13:40 +0200
parents 650868c062a9
children de6a9e811145
comparison
equal deleted inserted replaced
12975:0d1661d63d70 13012:f01788f13696
95 95
96 #ifdef ASSERT 96 #ifdef ASSERT
97 static bool expected_yanked_node(Node *old, Node *orig_old) { 97 static bool expected_yanked_node(Node *old, Node *orig_old) {
98 // This code is expected only next original nodes: 98 // This code is expected only next original nodes:
99 // - load from constant table node which may have next data input nodes: 99 // - load from constant table node which may have next data input nodes:
100 // MachConstantBase, Phi, MachTemp, MachSpillCopy 100 // MachConstantBase, MachTemp, MachSpillCopy
101 // - Phi nodes that are considered Junk
101 // - load constant node which may have next data input nodes: 102 // - load constant node which may have next data input nodes:
102 // MachTemp, MachSpillCopy 103 // MachTemp, MachSpillCopy
103 // - MachSpillCopy 104 // - MachSpillCopy
104 // - MachProj and Copy dead nodes 105 // - MachProj and Copy dead nodes
105 if (old->is_MachSpillCopy()) { 106 if (old->is_MachSpillCopy()) {
110 return (old == orig_old); 111 return (old == orig_old);
111 } else if (old->is_Copy()) { // Dead copy of a callee-save value 112 } else if (old->is_Copy()) { // Dead copy of a callee-save value
112 return (old == orig_old); 113 return (old == orig_old);
113 } else if (old->is_MachTemp()) { 114 } else if (old->is_MachTemp()) {
114 return orig_old->is_Con(); 115 return orig_old->is_Con();
115 } else if (old->is_Phi() || old->is_MachConstantBase()) { 116 } else if (old->is_Phi()) { // Junk phi's
117 return true;
118 } else if (old->is_MachConstantBase()) {
116 return (orig_old->is_Con() && orig_old->is_MachConstant()); 119 return (orig_old->is_Con() && orig_old->is_MachConstant());
117 } 120 }
118 return false; 121 return false;
119 } 122 }
120 #endif 123 #endif
520 Node *x = phi->in(k); 523 Node *x = phi->in(k);
521 if( phi != x && u != x ) // Found a different input 524 if( phi != x && u != x ) // Found a different input
522 u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input 525 u = u ? NodeSentinel : x; // Capture unique input, or NodeSentinel for 2nd input
523 } 526 }
524 if (u != NodeSentinel) { // Junk Phi. Remove 527 if (u != NodeSentinel) { // Junk Phi. Remove
525 block->remove_node(j--); 528 phi->replace_by(u);
529 j -= yank_if_dead(phi, block, &value, &regnd);
526 phi_dex--; 530 phi_dex--;
527 _cfg.unmap_node_from_block(phi);
528 phi->replace_by(u);
529 phi->disconnect_inputs(NULL, C);
530 continue; 531 continue;
531 } 532 }
532 // Note that if value[pidx] exists, then we merged no new values here 533 // Note that if value[pidx] exists, then we merged no new values here
533 // and the phi is useless. This can happen even with the above phi 534 // and the phi is useless. This can happen even with the above phi
534 // removal for complex flows. I cannot keep the better known value here 535 // removal for complex flows. I cannot keep the better known value here