< prev index next >

src/share/vm/opto/addnode.cpp

Print this page

        

*** 50,60 **** return (uintptr_t)in(1) + (uintptr_t)in(2) + Opcode(); } //------------------------------Identity--------------------------------------- // If either input is a constant 0, return the other input. ! Node *AddNode::Identity( PhaseTransform *phase ) { const Type *zero = add_id(); // The additive identity if( phase->type( in(1) )->higher_equal( zero ) ) return in(2); if( phase->type( in(2) )->higher_equal( zero ) ) return in(1); return this; } --- 50,60 ---- return (uintptr_t)in(1) + (uintptr_t)in(2) + Opcode(); } //------------------------------Identity--------------------------------------- // If either input is a constant 0, return the other input. ! Node* AddNode::Identity(PhaseGVN* phase) { const Type *zero = add_id(); // The additive identity if( phase->type( in(1) )->higher_equal( zero ) ) return in(2); if( phase->type( in(2) )->higher_equal( zero ) ) return in(1); return this; }
*** 202,212 **** } //------------------------------Value----------------------------------------- // An add node sums it's two _in. If one input is an RSD, we must mixin // the other input's symbols. ! const Type *AddNode::Value( PhaseTransform *phase ) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); if( t1 == Type::TOP ) return Type::TOP; if( t2 == Type::TOP ) return Type::TOP; --- 202,212 ---- } //------------------------------Value----------------------------------------- // An add node sums it's two _in. If one input is an RSD, we must mixin // the other input's symbols. ! const Type* AddNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); if( t1 == Type::TOP ) return Type::TOP; if( t2 == Type::TOP ) return Type::TOP;
*** 324,334 **** } //------------------------------Identity--------------------------------------- // Fold (x-y)+y OR y+(x-y) into x ! Node *AddINode::Identity( PhaseTransform *phase ) { if( in(1)->Opcode() == Op_SubI && phase->eqv(in(1)->in(2),in(2)) ) { return in(1)->in(1); } else if( in(2)->Opcode() == Op_SubI && phase->eqv(in(2)->in(2),in(1)) ) { return in(2)->in(1); --- 324,334 ---- } //------------------------------Identity--------------------------------------- // Fold (x-y)+y OR y+(x-y) into x ! Node* AddINode::Identity(PhaseGVN* phase) { if( in(1)->Opcode() == Op_SubI && phase->eqv(in(1)->in(2),in(2)) ) { return in(1)->in(1); } else if( in(2)->Opcode() == Op_SubI && phase->eqv(in(2)->in(2),in(1)) ) { return in(2)->in(1);
*** 441,451 **** } //------------------------------Identity--------------------------------------- // Fold (x-y)+y OR y+(x-y) into x ! Node *AddLNode::Identity( PhaseTransform *phase ) { if( in(1)->Opcode() == Op_SubL && phase->eqv(in(1)->in(2),in(2)) ) { return in(1)->in(1); } else if( in(2)->Opcode() == Op_SubL && phase->eqv(in(2)->in(2),in(1)) ) { return in(2)->in(1); --- 441,451 ---- } //------------------------------Identity--------------------------------------- // Fold (x-y)+y OR y+(x-y) into x ! Node* AddLNode::Identity(PhaseGVN* phase) { if( in(1)->Opcode() == Op_SubL && phase->eqv(in(1)->in(2),in(2)) ) { return in(1)->in(1); } else if( in(2)->Opcode() == Op_SubL && phase->eqv(in(2)->in(2),in(1)) ) { return in(2)->in(1);
*** 559,569 **** //============================================================================= //------------------------------Identity--------------------------------------- // If one input is a constant 0, return the other input. ! Node *AddPNode::Identity( PhaseTransform *phase ) { return ( phase->type( in(Offset) )->higher_equal( TypeX_ZERO ) ) ? in(Address) : this; } //------------------------------Idealize--------------------------------------- Node *AddPNode::Ideal(PhaseGVN *phase, bool can_reshape) { --- 559,569 ---- //============================================================================= //------------------------------Identity--------------------------------------- // If one input is a constant 0, return the other input. ! Node* AddPNode::Identity(PhaseGVN* phase) { return ( phase->type( in(Offset) )->higher_equal( TypeX_ZERO ) ) ? in(Address) : this; } //------------------------------Idealize--------------------------------------- Node *AddPNode::Ideal(PhaseGVN *phase, bool can_reshape) {
*** 657,667 **** } return tp->add_offset(txoffset); } //------------------------------Value------------------------------------------ ! const Type *AddPNode::Value( PhaseTransform *phase ) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(Address) ); const Type *t2 = phase->type( in(Offset) ); if( t1 == Type::TOP ) return Type::TOP; if( t2 == Type::TOP ) return Type::TOP; --- 657,667 ---- } return tp->add_offset(txoffset); } //------------------------------Value------------------------------------------ ! const Type* AddPNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(Address) ); const Type *t2 = phase->type( in(Offset) ); if( t1 == Type::TOP ) return Type::TOP; if( t2 == Type::TOP ) return Type::TOP;
*** 731,741 **** return idx > Base; } //============================================================================= //------------------------------Identity--------------------------------------- ! Node *OrINode::Identity( PhaseTransform *phase ) { // x | x => x if (phase->eqv(in(1), in(2))) { return in(1); } --- 731,741 ---- return idx > Base; } //============================================================================= //------------------------------Identity--------------------------------------- ! Node* OrINode::Identity(PhaseGVN* phase) { // x | x => x if (phase->eqv(in(1), in(2))) { return in(1); }
*** 772,782 **** return TypeInt::make( r0->get_con() | r1->get_con() ); } //============================================================================= //------------------------------Identity--------------------------------------- ! Node *OrLNode::Identity( PhaseTransform *phase ) { // x | x => x if (phase->eqv(in(1), in(2))) { return in(1); } --- 772,782 ---- return TypeInt::make( r0->get_con() | r1->get_con() ); } //============================================================================= //------------------------------Identity--------------------------------------- ! Node* OrLNode::Identity(PhaseGVN* phase) { // x | x => x if (phase->eqv(in(1), in(2))) { return in(1); }
< prev index next >