< prev index next >

src/share/vm/opto/opaquenode.cpp

Print this page




  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "opto/opaquenode.hpp"
  27 #include "opto/phaseX.hpp"
  28 
  29 //=============================================================================
  30 // Do not allow value-numbering
  31 uint Opaque1Node::hash() const { return NO_HASH; }
  32 uint Opaque1Node::cmp( const Node &n ) const {
  33   return (&n == this);          // Always fail except on self
  34 }
  35 
  36 //------------------------------Identity---------------------------------------
  37 // If _major_progress, then more loop optimizations follow.  Do NOT remove
  38 // the opaque Node until no more loop ops can happen.  Note the timing of
  39 // _major_progress; it's set in the major loop optimizations THEN comes the
  40 // call to IterGVN and any chance of hitting this code.  Hence there's no
  41 // phase-ordering problem with stripping Opaque1 in IGVN followed by some
  42 // more loop optimizations that require it.
  43 Node *Opaque1Node::Identity( PhaseTransform *phase ) {
  44   return phase->C->major_progress() ? this : in(1);
  45 }
  46 
  47 //=============================================================================
  48 // A node to prevent unwanted optimizations.  Allows constant folding.  Stops
  49 // value-numbering, most Ideal calls or Identity functions.  This Node is
  50 // specifically designed to prevent the pre-increment value of a loop trip
  51 // counter from being live out of the bottom of the loop (hence causing the
  52 // pre- and post-increment values both being live and thus requiring an extra
  53 // temp register and an extra move).  If we "accidentally" optimize through
  54 // this kind of a Node, we'll get slightly pessimal, but correct, code.  Thus
  55 // it's OK to be slightly sloppy on optimizations here.
  56 
  57 // Do not allow value-numbering
  58 uint Opaque2Node::hash() const { return NO_HASH; }
  59 uint Opaque2Node::cmp( const Node &n ) const {
  60   return (&n == this);          // Always fail except on self
  61 }
  62 
  63 //=============================================================================
  64 
  65 uint ProfileBooleanNode::hash() const { return NO_HASH; }
  66 uint ProfileBooleanNode::cmp( const Node &n ) const {
  67   return (&n == this);
  68 }
  69 
  70 Node *ProfileBooleanNode::Ideal(PhaseGVN *phase, bool can_reshape) {
  71   if (can_reshape && _delay_removal) {
  72     _delay_removal = false;
  73     return this;
  74   } else {
  75     return NULL;
  76   }
  77 }
  78 
  79 Node *ProfileBooleanNode::Identity( PhaseTransform *phase ) {
  80   if (_delay_removal) {
  81     return this;
  82   } else {
  83     assert(_consumed, "profile should be consumed before elimination");
  84     return in(1);
  85   }
  86 }


  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "opto/opaquenode.hpp"
  27 #include "opto/phaseX.hpp"
  28 
  29 //=============================================================================
  30 // Do not allow value-numbering
  31 uint Opaque1Node::hash() const { return NO_HASH; }
  32 uint Opaque1Node::cmp( const Node &n ) const {
  33   return (&n == this);          // Always fail except on self
  34 }
  35 
  36 //------------------------------Identity---------------------------------------
  37 // If _major_progress, then more loop optimizations follow.  Do NOT remove
  38 // the opaque Node until no more loop ops can happen.  Note the timing of
  39 // _major_progress; it's set in the major loop optimizations THEN comes the
  40 // call to IterGVN and any chance of hitting this code.  Hence there's no
  41 // phase-ordering problem with stripping Opaque1 in IGVN followed by some
  42 // more loop optimizations that require it.
  43 Node* Opaque1Node::Identity(PhaseGVN* phase) {
  44   return phase->C->major_progress() ? this : in(1);
  45 }
  46 
  47 //=============================================================================
  48 // A node to prevent unwanted optimizations.  Allows constant folding.  Stops
  49 // value-numbering, most Ideal calls or Identity functions.  This Node is
  50 // specifically designed to prevent the pre-increment value of a loop trip
  51 // counter from being live out of the bottom of the loop (hence causing the
  52 // pre- and post-increment values both being live and thus requiring an extra
  53 // temp register and an extra move).  If we "accidentally" optimize through
  54 // this kind of a Node, we'll get slightly pessimal, but correct, code.  Thus
  55 // it's OK to be slightly sloppy on optimizations here.
  56 
  57 // Do not allow value-numbering
  58 uint Opaque2Node::hash() const { return NO_HASH; }
  59 uint Opaque2Node::cmp( const Node &n ) const {
  60   return (&n == this);          // Always fail except on self
  61 }
  62 
  63 //=============================================================================
  64 
  65 uint ProfileBooleanNode::hash() const { return NO_HASH; }
  66 uint ProfileBooleanNode::cmp( const Node &n ) const {
  67   return (&n == this);
  68 }
  69 
  70 Node *ProfileBooleanNode::Ideal(PhaseGVN *phase, bool can_reshape) {
  71   if (can_reshape && _delay_removal) {
  72     _delay_removal = false;
  73     return this;
  74   } else {
  75     return NULL;
  76   }
  77 }
  78 
  79 Node* ProfileBooleanNode::Identity(PhaseGVN* phase) {
  80   if (_delay_removal) {
  81     return this;
  82   } else {
  83     assert(_consumed, "profile should be consumed before elimination");
  84     return in(1);
  85   }
  86 }
< prev index next >