src/share/vm/opto/subnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/subnode.cpp	Mon Nov 12 10:52:09 2012
--- new/src/share/vm/opto/subnode.cpp	Mon Nov 12 10:52:09 2012

*** 1076,1095 **** --- 1076,1085 ---- uint BoolNode::cmp( const Node &n ) const { const BoolNode *b = (const BoolNode *)&n; // Cast up return (_test._test == b->_test._test); } //------------------------------clone_cmp-------------------------------------- // Clone a compare/bool tree static Node *clone_cmp( Node *cmp, Node *cmp1, Node *cmp2, PhaseGVN *gvn, BoolTest::mask test ) { Node *ncmp = cmp->clone(); ncmp->set_req(1,cmp1); ncmp->set_req(2,cmp2); ncmp = gvn->transform( ncmp ); return new (gvn->C) BoolNode( ncmp, test ); } //-------------------------------make_predicate-------------------------------- Node* BoolNode::make_predicate(Node* test_value, PhaseGVN* phase) { if (test_value->is_Con()) return test_value; if (test_value->is_Bool()) return test_value; Compile* C = phase->C;
*** 1214,1268 **** --- 1204,1213 ---- phase->type( cmp1->in(2) )->higher_equal(TypeInt::SYMINT) ) { Node *ncmp = phase->transform( new (phase->C) CmpINode(cmp1->in(2),cmp2)); return new (phase->C) BoolNode( ncmp, _test.commute() ); } // The transformation below is not valid for either signed or unsigned // comparisons due to wraparound concerns at MAX_VALUE and MIN_VALUE. // This transformation can be resurrected when we are able to // make inferences about the range of values being subtracted from // (or added to) relative to the wraparound point. // // // Remove +/-1's if possible. // // "X <= Y-1" becomes "X < Y" // // "X+1 <= Y" becomes "X < Y" // // "X < Y+1" becomes "X <= Y" // // "X-1 < Y" becomes "X <= Y" // // Do not this to compares off of the counted-loop-end. These guys are // // checking the trip counter and they want to use the post-incremented // // counter. If they use the PRE-incremented counter, then the counter has // // to be incremented in a private block on a loop backedge. // if( du && du->cnt(this) && du->out(this)[0]->Opcode() == Op_CountedLoopEnd ) // return NULL; // #ifndef PRODUCT // // Do not do this in a wash GVN pass during verification. // // Gets triggered by too many simple optimizations to be bothered with // // re-trying it again and again. // if( !phase->allow_progress() ) return NULL; // #endif // // Not valid for unsigned compare because of corner cases in involving zero. // // For example, replacing "X-1 <u Y" with "X <=u Y" fails to throw an // // exception in case X is 0 (because 0-1 turns into 4billion unsigned but // // "0 <=u Y" is always true). // if( cmp->Opcode() == Op_CmpU ) return NULL; // int cmp2_op = cmp2->Opcode(); // if( _test._test == BoolTest::le ) { // if( cmp1_op == Op_AddI && // phase->type( cmp1->in(2) ) == TypeInt::ONE ) // return clone_cmp( cmp, cmp1->in(1), cmp2, phase, BoolTest::lt ); // else if( cmp2_op == Op_AddI && // phase->type( cmp2->in(2) ) == TypeInt::MINUS_1 ) // return clone_cmp( cmp, cmp1, cmp2->in(1), phase, BoolTest::lt ); // } else if( _test._test == BoolTest::lt ) { // if( cmp1_op == Op_AddI && // phase->type( cmp1->in(2) ) == TypeInt::MINUS_1 ) // return clone_cmp( cmp, cmp1->in(1), cmp2, phase, BoolTest::le ); // else if( cmp2_op == Op_AddI && // phase->type( cmp2->in(2) ) == TypeInt::ONE ) // return clone_cmp( cmp, cmp1, cmp2->in(1), phase, BoolTest::le ); // } return NULL; } //------------------------------Value------------------------------------------ // Simplify a Bool (convert condition codes to boolean (1 or 0)) node,

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