909 // The invariants on this call are subtle. If in doubt, read the 910 // treatise in node.cpp above the default implemention AND TEST WITH 911 // +VerifyIterativeGVN! 912 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 913 914 // Some nodes have specific Ideal subgraph transformations only if they are 915 // unique users of specific nodes. Such nodes should be put on IGVN worklist 916 // for the transformations to happen. 917 bool has_special_unique_user() const; 918 919 // Skip Proj and CatchProj nodes chains. Check for Null and Top. 920 Node* find_exact_control(Node* ctrl); 921 922 // Check if 'this' node dominates or equal to 'sub'. 923 bool dominates(Node* sub, Node_List &nlist); 924 925 protected: 926 bool remove_dead_region(PhaseGVN *phase, bool can_reshape); 927 public: 928 929 // Idealize graph, using DU info. Done after constant propagation 930 virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); 931 932 // See if there is valid pipeline info 933 static const Pipeline *pipeline_class(); 934 virtual const Pipeline *pipeline() const; 935 936 // Compute the latency from the def to this instruction of the ith input node 937 uint latency(uint i); 938 939 // Hash & compare functions, for pessimistic value numbering 940 941 // If the hash function returns the special sentinel value NO_HASH, 942 // the node is guaranteed never to compare equal to any other node. 943 // If we accidentally generate a hash with value NO_HASH the node 944 // won't go into the table and we'll lose a little optimization. 945 enum { NO_HASH = 0 }; 946 virtual uint hash() const; 947 virtual uint cmp( const Node &n ) const; 948 949 // Operation appears to be iteratively computed (such as an induction variable) 950 // It is possible for this operation to return false for a loop-varying 951 // value, if it appears (by local graph inspection) to be computed by a simple conditional. 952 bool is_iteratively_computed(); 953 954 // Determine if a node is Counted loop induction variable. 955 // The method is defined in loopnode.cpp. 956 const Node* is_loop_iv() const; 957 958 // Return a node with opcode "opc" and same inputs as "this" if one can 959 // be found; Otherwise return NULL; 960 Node* find_similar(int opc); 961 962 // Return the unique control out if only one. Null if none or more than one. 963 Node* unique_ctrl_out(); 964 965 //----------------- Code Generation 966 967 // Ideal register class for Matching. Zero means unmatched instruction 968 // (these are cloned instead of converted to machine nodes). 969 virtual uint ideal_reg() const; 970 971 static const uint NotAMachineReg; // must be > max. machine register 972 973 // Do we Match on this edge index or not? Generally false for Control 974 // and true for everything else. Weird for calls & returns. 975 virtual uint match_edge(uint idx) const; 976 977 // Register class output is returned in 978 virtual const RegMask &out_RegMask() const; 979 // Register class input is expected in 980 virtual const RegMask &in_RegMask(uint) const; 981 // Should we clone rather than spill this instruction? 982 bool rematerialize() const; 983 984 // Return JVM State Object if this Node carries debug info, or NULL otherwise | 909 // The invariants on this call are subtle. If in doubt, read the 910 // treatise in node.cpp above the default implemention AND TEST WITH 911 // +VerifyIterativeGVN! 912 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 913 914 // Some nodes have specific Ideal subgraph transformations only if they are 915 // unique users of specific nodes. Such nodes should be put on IGVN worklist 916 // for the transformations to happen. 917 bool has_special_unique_user() const; 918 919 // Skip Proj and CatchProj nodes chains. Check for Null and Top. 920 Node* find_exact_control(Node* ctrl); 921 922 // Check if 'this' node dominates or equal to 'sub'. 923 bool dominates(Node* sub, Node_List &nlist); 924 925 protected: 926 bool remove_dead_region(PhaseGVN *phase, bool can_reshape); 927 public: 928 929 // See if there is valid pipeline info 930 static const Pipeline *pipeline_class(); 931 virtual const Pipeline *pipeline() const; 932 933 // Compute the latency from the def to this instruction of the ith input node 934 uint latency(uint i); 935 936 // Hash & compare functions, for pessimistic value numbering 937 938 // If the hash function returns the special sentinel value NO_HASH, 939 // the node is guaranteed never to compare equal to any other node. 940 // If we accidentally generate a hash with value NO_HASH the node 941 // won't go into the table and we'll lose a little optimization. 942 enum { NO_HASH = 0 }; 943 virtual uint hash() const; 944 virtual uint cmp( const Node &n ) const; 945 946 // Operation appears to be iteratively computed (such as an induction variable) 947 // It is possible for this operation to return false for a loop-varying 948 // value, if it appears (by local graph inspection) to be computed by a simple conditional. 949 bool is_iteratively_computed(); 950 951 // Determine if a node is Counted loop induction variable. 952 // The method is defined in loopnode.cpp. 953 const Node* is_loop_iv() const; 954 955 // Return a node with opcode "opc" and same inputs as "this" if one can 956 // be found; Otherwise return NULL; 957 Node* find_similar(int opc); 958 959 // Return the unique control out if only one. Null if none or more than one. 960 Node* unique_ctrl_out(); 961 962 // Set control or add control as precedence edge 963 void ensure_control_or_add_prec(Node* c); 964 //----------------- Code Generation 965 966 // Ideal register class for Matching. Zero means unmatched instruction 967 // (these are cloned instead of converted to machine nodes). 968 virtual uint ideal_reg() const; 969 970 static const uint NotAMachineReg; // must be > max. machine register 971 972 // Do we Match on this edge index or not? Generally false for Control 973 // and true for everything else. Weird for calls & returns. 974 virtual uint match_edge(uint idx) const; 975 976 // Register class output is returned in 977 virtual const RegMask &out_RegMask() const; 978 // Register class input is expected in 979 virtual const RegMask &in_RegMask(uint) const; 980 // Should we clone rather than spill this instruction? 981 bool rematerialize() const; 982 983 // Return JVM State Object if this Node carries debug info, or NULL otherwise |