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

src/share/vm/opto/subnode.cpp

Print this page



  74         phase->eqv(in(1)->in(2)->in(1),in(2)) )
  75       return in(1)->in(1);
  76   }
  77 
  78   return ( phase->type( in(2) )->higher_equal( zero ) ) ? in(1) : this;
  79 }
  80 
  81 //------------------------------Value------------------------------------------
  82 // A subtract node differences it's two inputs.
  83 const Type *SubNode::Value( PhaseTransform *phase ) const {
  84   const Node* in1 = in(1);
  85   const Node* in2 = in(2);
  86   // Either input is TOP ==> the result is TOP
  87   const Type* t1 = (in1 == this) ? Type::TOP : phase->type(in1);
  88   if( t1 == Type::TOP ) return Type::TOP;
  89   const Type* t2 = (in2 == this) ? Type::TOP : phase->type(in2);
  90   if( t2 == Type::TOP ) return Type::TOP;
  91 
  92   // Not correct for SubFnode and AddFNode (must check for infinity)
  93   // Equal?  Subtract is zero
  94   if (phase->eqv_uncast(in1, in2))  return add_id();
  95 
  96   // Either input is BOTTOM ==> the result is the local BOTTOM
  97   if( t1 == Type::BOTTOM || t2 == Type::BOTTOM )
  98     return bottom_type();
  99 
 100   return sub(t1,t2);            // Local flavor of type subtraction
 101 
 102 }
 103 
 104 //=============================================================================
 105 
 106 //------------------------------Helper function--------------------------------
 107 static bool ok_to_convert(Node* inc, Node* iv) {
 108     // Do not collapse (x+c0)-y if "+" is a loop increment, because the
 109     // "-" is loop invariant and collapsing extends the live-range of "x"
 110     // to overlap with the "+", forcing another register to be used in
 111     // the loop.
 112     // This test will be clearer with '&&' (apply DeMorgan's rule)
 113     // but I like the early cutouts that happen here.
 114     const PhiNode *phi;



  74         phase->eqv(in(1)->in(2)->in(1),in(2)) )
  75       return in(1)->in(1);
  76   }
  77 
  78   return ( phase->type( in(2) )->higher_equal( zero ) ) ? in(1) : this;
  79 }
  80 
  81 //------------------------------Value------------------------------------------
  82 // A subtract node differences it's two inputs.
  83 const Type *SubNode::Value( PhaseTransform *phase ) const {
  84   const Node* in1 = in(1);
  85   const Node* in2 = in(2);
  86   // Either input is TOP ==> the result is TOP
  87   const Type* t1 = (in1 == this) ? Type::TOP : phase->type(in1);
  88   if( t1 == Type::TOP ) return Type::TOP;
  89   const Type* t2 = (in2 == this) ? Type::TOP : phase->type(in2);
  90   if( t2 == Type::TOP ) return Type::TOP;
  91 
  92   // Not correct for SubFnode and AddFNode (must check for infinity)
  93   // Equal?  Subtract is zero
  94   if (in1->eqv_uncast(in2))  return add_id();
  95 
  96   // Either input is BOTTOM ==> the result is the local BOTTOM
  97   if( t1 == Type::BOTTOM || t2 == Type::BOTTOM )
  98     return bottom_type();
  99 
 100   return sub(t1,t2);            // Local flavor of type subtraction
 101 
 102 }
 103 
 104 //=============================================================================
 105 
 106 //------------------------------Helper function--------------------------------
 107 static bool ok_to_convert(Node* inc, Node* iv) {
 108     // Do not collapse (x+c0)-y if "+" is a loop increment, because the
 109     // "-" is loop invariant and collapsing extends the live-range of "x"
 110     // to overlap with the "+", forcing another register to be used in
 111     // the loop.
 112     // This test will be clearer with '&&' (apply DeMorgan's rule)
 113     // but I like the early cutouts that happen here.
 114     const PhiNode *phi;


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