src/share/vm/opto/ifnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/ifnode.cpp	Thu May 15 17:09:28 2014
--- new/src/share/vm/opto/ifnode.cpp	Thu May 15 17:09:27 2014

*** 236,249 **** --- 236,249 ---- } Node* predicate_c = NULL; Node* predicate_x = NULL; bool counted_loop = r->is_CountedLoop(); - Node *region_c = new (igvn->C) RegionNode(req_c + 1); Node *phi_c = con1; uint len = r->req(); - Node *region_x = new (igvn->C) RegionNode(len - req_c); Node *phi_x = PhiNode::make_blank(region_x, phi); for (uint i = 1, i_c = 1, i_x = 1; i < len; i++) { if (phi->in(i) == con1) { region_c->init_req( i_c++, r ->in(i) ); if (r->in(i) == predicate_proj)
*** 270,280 **** --- 270,280 ---- igvn->register_new_node_with_optimizer( region_c ); igvn->register_new_node_with_optimizer( region_x ); // Prevent the untimely death of phi_x. Currently he has no uses. He is // about to get one. If this only use goes away, then phi_x will look dead. // However, he will be picking up some more uses down below. - Node *hook = new (igvn->C) Node(4); hook->init_req(0, phi_x); hook->init_req(1, phi_c); phi_x = phase->transform( phi_x ); // Make the compare
*** 282,331 **** --- 282,331 ---- Node *cmp_x = cmp->clone(); cmp_x->set_req(1,phi_x); cmp_x->set_req(2,con2); cmp_x = phase->transform(cmp_x); // Make the bool - Node *b_c = phase->transform(new (igvn->C) BoolNode(cmp_c,b->_test._test)); - Node *b_x = phase->transform(new (igvn->C) BoolNode(cmp_x,b->_test._test)); // Make the IfNode - IfNode *iff_c = new (igvn->C) IfNode(region_c,b_c,iff->_prob,iff->_fcnt); igvn->set_type_bottom(iff_c); igvn->_worklist.push(iff_c); hook->init_req(2, iff_c); - IfNode *iff_x = new (igvn->C) IfNode(region_x,b_x,iff->_prob, iff->_fcnt); igvn->set_type_bottom(iff_x); igvn->_worklist.push(iff_x); hook->init_req(3, iff_x); // Make the true/false arms - Node *iff_c_t = phase->transform(new (igvn->C) IfTrueNode (iff_c)); - Node *iff_c_f = phase->transform(new (igvn->C) IfFalseNode(iff_c)); if (predicate_c != NULL) { assert(predicate_x == NULL, "only one predicate entry expected"); // Clone loop predicates to each path iff_c_t = igvn->clone_loop_predicates(predicate_c, iff_c_t, !counted_loop); iff_c_f = igvn->clone_loop_predicates(predicate_c, iff_c_f, !counted_loop); } - Node *iff_x_t = phase->transform(new (igvn->C) IfTrueNode (iff_x)); - Node *iff_x_f = phase->transform(new (igvn->C) IfFalseNode(iff_x)); if (predicate_x != NULL) { assert(predicate_c == NULL, "only one predicate entry expected"); // Clone loop predicates to each path iff_x_t = igvn->clone_loop_predicates(predicate_x, iff_x_t, !counted_loop); iff_x_f = igvn->clone_loop_predicates(predicate_x, iff_x_f, !counted_loop); } // Merge the TRUE paths - Node *region_s = new (igvn->C) RegionNode(3); igvn->_worklist.push(region_s); region_s->init_req(1, iff_c_t); region_s->init_req(2, iff_x_t); igvn->register_new_node_with_optimizer( region_s ); // Merge the FALSE paths - Node *region_f = new (igvn->C) RegionNode(3); igvn->_worklist.push(region_f); region_f->init_req(1, iff_c_f); region_f->init_req(2, iff_x_f); igvn->register_new_node_with_optimizer( region_f );
*** 436,446 **** --- 436,446 ---- // Now remove the bogus extra edges used to keep things alive igvn->remove_dead_node( hook ); // Must return either the original node (now dead) or a new node // (Do not return a top here, since that would break the uniqueness of top.) - return new (igvn->C) ConINode(TypeInt::ZERO); } //------------------------------is_range_check--------------------------------- // Return 0 if not a range check. Return 1 if a range check and set index and // offset. Return 2 if we had to negate the test. Index is NULL if the check
*** 539,558 **** --- 539,558 ---- Node *cmp = bol->in(1); // Compute a new check Node *new_add = gvn->intcon(off_lo); if( index ) { - new_add = off_lo ? gvn->transform(new (gvn->C) AddINode( index, new_add )) : index; } Node *new_cmp = (flip == 1) - ? new (gvn->C) CmpUNode( new_add, range ) - : new (gvn->C) CmpUNode( range, new_add ); new_cmp = gvn->transform(new_cmp); // See if no need to adjust the existing check if( new_cmp == cmp ) return; // Else, adjust existing check - Node *new_bol = gvn->transform( new (gvn->C) BoolNode( new_cmp, bol->as_Bool()->_test._test ) ); igvn->rehash_node_delayed( iff ); iff->set_req_X( 1, new_bol, igvn ); } //------------------------------up_one_dom-------------------------------------
*** 726,738 **** --- 726,738 ---- dom_bool->_test._test != BoolTest::ne && dom_bool->_test._test != BoolTest::eq) { int bound = failtype->_hi - failtype->_lo + 1; if (failtype->_hi != max_jint && failtype->_lo != min_jint && bound > 1) { // Merge the two compares into a single unsigned compare by building (CmpU (n - lo) hi) BoolTest::mask cond = fail->as_Proj()->_con ? BoolTest::lt : BoolTest::ge; - Node* adjusted = phase->transform(new (phase->C) SubINode(n, phase->intcon(failtype->_lo))); - Node* newcmp = phase->transform(new (phase->C) CmpUNode(adjusted, phase->intcon(bound))); - Node* newbool = phase->transform(new (phase->C) BoolNode(newcmp, cond)); phase->is_IterGVN()->replace_input_of(dom_iff, 1, phase->intcon(ctrl->as_Proj()->_con)); phase->hash_delete(this); set_req(1, newbool); return this; }
*** 1001,1011 **** --- 1001,1011 ---- // Replace dominated IfNode dominated_by( prev_dom, igvn ); // Must return either the original node (now dead) or a new node // (Do not return a top here, since that would break the uniqueness of top.) - return new (phase->C) ConINode(TypeInt::ZERO); } //------------------------------dominated_by----------------------------------- void IfNode::dominated_by( Node *prev_dom, PhaseIterGVN *igvn ) { igvn->hash_delete(this); // Remove self to prevent spurious V-N
*** 1097,1115 **** --- 1097,1115 ---- if( bt.is_canonical() ) return NULL; // Flip test to be canonical. Requires flipping the IfFalse/IfTrue and // cloning the IfNode. - Node* new_b = phase->transform( new (phase->C) BoolNode(b->in(1), bt.negate()) ); if( !new_b->is_Bool() ) return NULL; b = new_b->as_Bool(); PhaseIterGVN *igvn = phase->is_IterGVN(); assert( igvn, "Test is not canonical in parser?" ); // The IF node never really changes, but it needs to be cloned - iff = new (phase->C) IfNode( iff->in(0), b, 1.0-iff->_prob, iff->_fcnt); Node *prior = igvn->hash_find_insert(iff); if( prior ) { igvn->remove_dead_node(iff); iff = (IfNode*)prior;
*** 1118,1129 **** --- 1118,1129 ---- igvn->set_type_bottom(iff); } igvn->_worklist.push(iff); // Now handle projections. Cloning not required. - Node* new_if_f = (Node*)(new (phase->C) IfFalseNode( iff )); - Node* new_if_t = (Node*)(new (phase->C) IfTrueNode ( iff )); igvn->register_new_node_with_optimizer(new_if_f); igvn->register_new_node_with_optimizer(new_if_t); // Flip test, so flip trailing control igvn->replace_node(old_if_f, new_if_t);

src/share/vm/opto/ifnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File