< prev index next >

src/hotspot/share/opto/phaseX.cpp

Print this page

        

*** 769,778 **** --- 769,795 ---- } //============================================================================= + Node* PhaseGVN::apply_ideal(Node* k, bool can_reshape) { + Node* i = BarrierSet::barrier_set()->barrier_set_c2()->ideal_node(this, k, can_reshape); + if (i == NULL) { + i = k->Ideal(this, can_reshape); + } + return i; + } + + Node* PhaseGVN::apply_identity(Node* k) { + Node* i = BarrierSet::barrier_set()->barrier_set_c2()->identity_node(this, k); + if (i == k) { + i = k->Identity(this); + } + return i; + } + + //============================================================================= //------------------------------transform-------------------------------------- // Return a node which computes the same function as this node, but in a // faster or cheaper fashion. Node *PhaseGVN::transform( Node *n ) { return transform_no_reclaim(n);
*** 786,796 **** // Apply the Ideal call in a loop until it no longer applies Node *k = n; NOT_PRODUCT( uint loop_count = 0; ) while( 1 ) { ! Node *i = k->Ideal(this, /*can_reshape=*/false); if( !i ) break; assert( i->_idx >= k->_idx, "Idealize should return new nodes, use Identity to return old nodes" ); k = i; assert(loop_count++ < K, "infinite loop in PhaseGVN::transform"); } --- 803,813 ---- // Apply the Ideal call in a loop until it no longer applies Node *k = n; NOT_PRODUCT( uint loop_count = 0; ) while( 1 ) { ! Node *i = apply_ideal(k, /*can_reshape=*/false); if( !i ) break; assert( i->_idx >= k->_idx, "Idealize should return new nodes, use Identity to return old nodes" ); k = i; assert(loop_count++ < K, "infinite loop in PhaseGVN::transform"); }
*** 823,833 **** NOT_PRODUCT( set_progress(); ) return makecon(t); // Turn into a constant } // Now check for Identities ! Node *i = k->Identity(this); // Look for a nearby replacement if( i != k ) { // Found? Return replacement! NOT_PRODUCT( set_progress(); ) return i; } --- 840,850 ---- NOT_PRODUCT( set_progress(); ) return makecon(t); // Turn into a constant } // Now check for Identities ! Node *i = apply_identity(k); // Look for a nearby replacement if( i != k ) { // Found? Return replacement! NOT_PRODUCT( set_progress(); ) return i; }
*** 1212,1222 **** // Apply the Ideal call in a loop until it no longer applies Node* k = n; DEBUG_ONLY(dead_loop_check(k);) DEBUG_ONLY(bool is_new = (k->outcnt() == 0);) C->remove_modified_node(k); ! Node* i = k->Ideal(this, /*can_reshape=*/true); assert(i != k || is_new || i->outcnt() > 0, "don't return dead nodes"); #ifndef PRODUCT verify_step(k); if (i && VerifyOpto ) { if (!allow_progress()) { --- 1229,1239 ---- // Apply the Ideal call in a loop until it no longer applies Node* k = n; DEBUG_ONLY(dead_loop_check(k);) DEBUG_ONLY(bool is_new = (k->outcnt() == 0);) C->remove_modified_node(k); ! Node* i = apply_ideal(k, /*can_reshape=*/true); assert(i != k || is_new || i->outcnt() > 0, "don't return dead nodes"); #ifndef PRODUCT verify_step(k); if (i && VerifyOpto ) { if (!allow_progress()) {
*** 1254,1264 **** } DEBUG_ONLY(dead_loop_check(k);) // Try idealizing again DEBUG_ONLY(is_new = (k->outcnt() == 0);) C->remove_modified_node(k); ! i = k->Ideal(this, /*can_reshape=*/true); assert(i != k || is_new || (i->outcnt() > 0), "don't return dead nodes"); #ifndef PRODUCT verify_step(k); if (i && VerifyOpto) { set_progress(); --- 1271,1281 ---- } DEBUG_ONLY(dead_loop_check(k);) // Try idealizing again DEBUG_ONLY(is_new = (k->outcnt() == 0);) C->remove_modified_node(k); ! i = apply_ideal(k, /*can_reshape=*/true); assert(i != k || is_new || (i->outcnt() > 0), "don't return dead nodes"); #ifndef PRODUCT verify_step(k); if (i && VerifyOpto) { set_progress();
*** 1296,1306 **** subsume_node(k, con); // Everybody using k now uses con return con; } // Now check for Identities ! i = k->Identity(this); // Look for a nearby replacement if (i != k) { // Found? Return replacement! NOT_PRODUCT(set_progress();) add_users_to_worklist(k); subsume_node(k, i); // Everybody using k now uses i return i; --- 1313,1323 ---- subsume_node(k, con); // Everybody using k now uses con return con; } // Now check for Identities ! i = apply_identity(k); // Look for a nearby replacement if (i != k) { // Found? Return replacement! NOT_PRODUCT(set_progress();) add_users_to_worklist(k); subsume_node(k, i); // Everybody using k now uses i return i;
*** 1374,1384 **** i++; } assert(!(i < imax), "sanity"); } } else { ! BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(_worklist, in); } if (ReduceFieldZeroing && dead->is_Load() && i == MemNode::Memory && in->is_Proj() && in->in(0) != NULL && in->in(0)->is_Initialize()) { // A Load that directly follows an InitializeNode is // going away. The Stores that follow are candidates --- 1391,1401 ---- i++; } assert(!(i < imax), "sanity"); } } else { ! BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(this, in); } if (ReduceFieldZeroing && dead->is_Load() && i == MemNode::Memory && in->is_Proj() && in->in(0) != NULL && in->in(0)->is_Initialize()) { // A Load that directly follows an InitializeNode is // going away. The Stores that follow are candidates
*** 1650,1659 **** --- 1667,1683 ---- if (u->Opcode() == Op_LoadP && ut->isa_instptr()) { _worklist.push(u); } } } + + if (use->is_ShenandoahBarrier()) { + Node* cmp = use->find_out_with(Op_CmpP); + if (cmp != NULL) { + _worklist.push(cmp); + } + } } } /** * Remove the speculative part of all types that we know of
*** 1799,1808 **** --- 1823,1851 ---- if (u->Opcode() == Op_LoadP && ut->isa_instptr() && ut != type(u)) { worklist.push(u); } } } + if (m->is_ShenandoahBarrier()) { + for (DUIterator_Fast i2max, i2 = m->fast_outs(i2max); i2 < i2max; i2++) { + Node* p = m->fast_out(i2); + if (p->Opcode() == Op_CmpP) { + if(p->bottom_type() != type(p)) { + worklist.push(p); + } + } else if (p->Opcode() == Op_AddP) { + for (DUIterator_Fast i3max, i3 = p->fast_outs(i3max); i3 < i3max; i3++) { + Node* q = p->fast_out(i3); + if (q->is_Load()) { + if(q->bottom_type() != type(q)) { + worklist.push(q); + } + } + } + } + } + } } } } }
*** 2059,2068 **** --- 2102,2115 ---- } break; default: break; } + if (UseShenandoahGC) { + // TODO: Should we call this for ZGC as well? + BarrierSet::barrier_set()->barrier_set_c2()->enqueue_useful_gc_barrier(igvn, old); + } } } //-------------------------------replace_by-----------------------------------
< prev index next >