src/share/vm/opto/compile.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
6705887 Cdiff src/share/vm/opto/compile.cpp
src/share/vm/opto/compile.cpp
Print this page
*** 1906,1916 ****
case Op_CmpD3:
fpu.inc_double_count();
break;
case Op_Opaque1: // Remove Opaque Nodes before matching
case Op_Opaque2: // Remove Opaque Nodes before matching
! n->replace_by(n->in(1));
break;
case Op_CallStaticJava:
case Op_CallJava:
case Op_CallDynamicJava:
fpu.inc_java_call_count(); // Count java call site;
--- 1906,1916 ----
case Op_CmpD3:
fpu.inc_double_count();
break;
case Op_Opaque1: // Remove Opaque Nodes before matching
case Op_Opaque2: // Remove Opaque Nodes before matching
! n->subsume_by(n->in(1));
break;
case Op_CallStaticJava:
case Op_CallJava:
case Op_CallDynamicJava:
fpu.inc_java_call_count(); // Count java call site;
*** 1999,2034 ****
break;
}
#ifdef _LP64
case Op_CmpP:
! if( n->in(1)->Opcode() == Op_DecodeN ) {
Compile* C = Compile::current();
Node* in2 = NULL;
! if( n->in(2)->Opcode() == Op_DecodeN ) {
in2 = n->in(2)->in(1);
} else if ( n->in(2)->Opcode() == Op_ConP ) {
const Type* t = n->in(2)->bottom_type();
if (t == TypePtr::NULL_PTR) {
Node *in1 = n->in(1);
uint i = 0;
for (; i < in1->outcnt(); i++) {
if (in1->raw_out(i)->is_AddP())
break;
}
if (i >= in1->outcnt()) {
- // Don't replace CmpP(o ,null) if 'o' is used in AddP
- // to generate implicit NULL check.
in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR);
}
} else if (t->isa_oopptr()) {
in2 = ConNode::make(C, t->is_oopptr()->make_narrowoop());
}
}
if( in2 != NULL ) {
Node* cmpN = new (C, 3) CmpNNode(n->in(1)->in(1), in2);
! n->replace_by( cmpN );
}
}
#endif
case Op_ModI:
--- 1999,2044 ----
break;
}
#ifdef _LP64
case Op_CmpP:
! // Do this transformation here to preserve CmpPNode::sub() and
! // other TypePtr related Ideal optimizations (for example, ptr nullness).
! if( n->in(1)->is_DecodeN() ) {
Compile* C = Compile::current();
Node* in2 = NULL;
! if( n->in(2)->is_DecodeN() ) {
in2 = n->in(2)->in(1);
} else if ( n->in(2)->Opcode() == Op_ConP ) {
const Type* t = n->in(2)->bottom_type();
if (t == TypePtr::NULL_PTR) {
Node *in1 = n->in(1);
+ if (Matcher::clone_shift_expressions) {
+ // x86, ARM and friends can handle 2 adds in addressing mode.
+ // Decode a narrow oop and do implicit NULL check in address
+ // [R12 + narrow_oop_reg<<3 + offset]
+ in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR);
+ } else {
+ // Don't replace CmpP(o ,null) if 'o' is used in AddP
+ // to generate implicit NULL check on Sparc where
+ // narrow oops can't be used in address.
uint i = 0;
for (; i < in1->outcnt(); i++) {
if (in1->raw_out(i)->is_AddP())
break;
}
if (i >= in1->outcnt()) {
in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR);
}
+ }
} else if (t->isa_oopptr()) {
in2 = ConNode::make(C, t->is_oopptr()->make_narrowoop());
}
}
if( in2 != NULL ) {
Node* cmpN = new (C, 3) CmpNNode(n->in(1)->in(1), in2);
! n->subsume_by( cmpN );
}
}
#endif
case Op_ModI:
*** 2038,2054 ****
if (d) {
// Replace them with a fused divmod if supported
Compile* C = Compile::current();
if (Matcher::has_match_rule(Op_DivModI)) {
DivModINode* divmod = DivModINode::make(C, n);
! d->replace_by(divmod->div_proj());
! n->replace_by(divmod->mod_proj());
} else {
// replace a%b with a-((a/b)*b)
Node* mult = new (C, 3) MulINode(d, d->in(2));
Node* sub = new (C, 3) SubINode(d->in(1), mult);
! n->replace_by( sub );
}
}
}
break;
--- 2048,2064 ----
if (d) {
// Replace them with a fused divmod if supported
Compile* C = Compile::current();
if (Matcher::has_match_rule(Op_DivModI)) {
DivModINode* divmod = DivModINode::make(C, n);
! d->subsume_by(divmod->div_proj());
! n->subsume_by(divmod->mod_proj());
} else {
// replace a%b with a-((a/b)*b)
Node* mult = new (C, 3) MulINode(d, d->in(2));
Node* sub = new (C, 3) SubINode(d->in(1), mult);
! n->subsume_by( sub );
}
}
}
break;
*** 2059,2075 ****
if (d) {
// Replace them with a fused divmod if supported
Compile* C = Compile::current();
if (Matcher::has_match_rule(Op_DivModL)) {
DivModLNode* divmod = DivModLNode::make(C, n);
! d->replace_by(divmod->div_proj());
! n->replace_by(divmod->mod_proj());
} else {
// replace a%b with a-((a/b)*b)
Node* mult = new (C, 3) MulLNode(d, d->in(2));
Node* sub = new (C, 3) SubLNode(d->in(1), mult);
! n->replace_by( sub );
}
}
}
break;
--- 2069,2085 ----
if (d) {
// Replace them with a fused divmod if supported
Compile* C = Compile::current();
if (Matcher::has_match_rule(Op_DivModL)) {
DivModLNode* divmod = DivModLNode::make(C, n);
! d->subsume_by(divmod->div_proj());
! n->subsume_by(divmod->mod_proj());
} else {
// replace a%b with a-((a/b)*b)
Node* mult = new (C, 3) MulLNode(d, d->in(2));
Node* sub = new (C, 3) SubLNode(d->in(1), mult);
! n->subsume_by( sub );
}
}
}
break;
*** 2111,2121 ****
case Op_PackD:
if (n->req()-1 > 2) {
// Replace many operand PackNodes with a binary tree for matching
PackNode* p = (PackNode*) n;
Node* btp = p->binaryTreePack(Compile::current(), 1, n->req());
! n->replace_by(btp);
}
break;
default:
assert( !n->is_Call(), "" );
assert( !n->is_Mem(), "" );
--- 2121,2131 ----
case Op_PackD:
if (n->req()-1 > 2) {
// Replace many operand PackNodes with a binary tree for matching
PackNode* p = (PackNode*) n;
Node* btp = p->binaryTreePack(Compile::current(), 1, n->req());
! n->subsume_by(btp);
}
break;
default:
assert( !n->is_Call(), "" );
assert( !n->is_Mem(), "" );
src/share/vm/opto/compile.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File