hotspot/src/share/vm/opto/rootnode.cpp
changeset 25913 81dbc151e91c
parent 7397 5b173b4ca846
child 32084 7743e6943cdf
equal deleted inserted replaced
25742:07bedc8d1893 25913:81dbc151e91c
    33 #include "opto/type.hpp"
    33 #include "opto/type.hpp"
    34 
    34 
    35 //------------------------------Ideal------------------------------------------
    35 //------------------------------Ideal------------------------------------------
    36 // Remove dead inputs
    36 // Remove dead inputs
    37 Node *RootNode::Ideal(PhaseGVN *phase, bool can_reshape) {
    37 Node *RootNode::Ideal(PhaseGVN *phase, bool can_reshape) {
       
    38   bool modified = false;
    38   for( uint i = 1; i < req(); i++ ) { // For all inputs
    39   for( uint i = 1; i < req(); i++ ) { // For all inputs
    39     // Check for and remove dead inputs
    40     // Check for and remove dead inputs
    40     if( phase->type(in(i)) == Type::TOP ) {
    41     if( phase->type(in(i)) == Type::TOP ) {
    41       del_req(i--);             // Delete TOP inputs
    42       del_req(i--);             // Delete TOP inputs
       
    43       modified = true;
    42     }
    44     }
    43   }
    45   }
    44 
    46 
    45   // I used to do tail-splitting in the Ideal graph here, but it does not
    47   // I used to do tail-splitting in the Ideal graph here, but it does not
    46   // work.  The tail-splitting forces values live into the Return to be
    48   // work.  The tail-splitting forces values live into the Return to be
    54   // eliminated very simple self-recursion recursions, but it's not worth it.
    56   // eliminated very simple self-recursion recursions, but it's not worth it.
    55   // Deep inlining of self-calls gets nearly all of the same benefits.
    57   // Deep inlining of self-calls gets nearly all of the same benefits.
    56   // If we want to get the rest of the win later, we should pattern match
    58   // If we want to get the rest of the win later, we should pattern match
    57   // simple recursive call trees to closed-form solutions.
    59   // simple recursive call trees to closed-form solutions.
    58 
    60 
    59   return NULL;                  // No further opportunities exposed
    61   return modified ? this : NULL;
    60 }
    62 }
    61 
    63 
    62 //=============================================================================
    64 //=============================================================================
    63 HaltNode::HaltNode( Node *ctrl, Node *frameptr ) : Node(TypeFunc::Parms) {
    65 HaltNode::HaltNode( Node *ctrl, Node *frameptr ) : Node(TypeFunc::Parms) {
    64   Node* top = Compile::current()->top();
    66   Node* top = Compile::current()->top();