< prev index next >

src/hotspot/share/opto/loopnode.hpp

Print this page




 863   void build_loop_tree();
 864   int build_loop_tree_impl( Node *n, int pre_order );
 865   // Insert loop into the existing loop tree.  'innermost' is a leaf of the
 866   // loop tree, not the root.
 867   IdealLoopTree *sort( IdealLoopTree *loop, IdealLoopTree *innermost );
 868 
 869   // Place Data nodes in some loop nest
 870   void build_loop_early( VectorSet &visited, Node_List &worklist, Node_Stack &nstack );
 871   void build_loop_late ( VectorSet &visited, Node_List &worklist, Node_Stack &nstack );
 872   void build_loop_late_post_work(Node* n, bool pinned);
 873   void build_loop_late_post(Node* n);
 874   void verify_strip_mined_scheduling(Node *n, Node* least);
 875 
 876   // Array of immediate dominance info for each CFG node indexed by node idx
 877 private:
 878   uint _idom_size;
 879   Node **_idom;                  // Array of immediate dominators
 880   uint *_dom_depth;              // Used for fast LCA test
 881   GrowableArray<uint>* _dom_stk; // For recomputation of dom depth
 882 




































 883 public:
 884   Node* idom_no_update(Node* d) const {
 885     return idom_no_update(d->_idx);
 886   }
 887 
 888   Node* idom_no_update(uint didx) const {
 889     assert(didx < _idom_size, "oob");
 890     Node* n = _idom[didx];
 891     assert(n != NULL,"Bad immediate dominator info.");
 892     while (n->in(0) == NULL) { // Skip dead CFG nodes
 893       n = (Node*)(((intptr_t)_nodes[n->_idx]) & ~1);
 894       assert(n != NULL,"Bad immediate dominator info.");
 895     }
 896     return n;
 897   }
 898 
 899   Node *idom(Node* d) const {
 900     return idom(d->_idx);
 901   }
 902 


 906     return n;
 907   }
 908 
 909   uint dom_depth(Node* d) const {
 910     guarantee(d != NULL, "Null dominator info.");
 911     guarantee(d->_idx < _idom_size, "");
 912     return _dom_depth[d->_idx];
 913   }
 914   void set_idom(Node* d, Node* n, uint dom_depth);
 915   // Locally compute IDOM using dom_lca call
 916   Node *compute_idom( Node *region ) const;
 917   // Recompute dom_depth
 918   void recompute_dom_depth();
 919 
 920   // Is safept not required by an outer loop?
 921   bool is_deleteable_safept(Node* sfpt);
 922 
 923   // Replace parallel induction variable (parallel to trip counter)
 924   void replace_parallel_iv(IdealLoopTree *loop);
 925 
 926   // Perform verification that the graph is valid.
 927   PhaseIdealLoop( PhaseIterGVN &igvn) :
 928     PhaseTransform(Ideal_Loop),
 929     _igvn(igvn),
 930     _verify_me(NULL),
 931     _verify_only(true),
 932     _dom_lca_tags(arena()) { // Thread::resource_area
 933     build_and_optimize(LoopOptsVerify);
 934   }
 935 
 936   // build the loop tree and perform any requested optimizations
 937   void build_and_optimize(LoopOptsMode mode);
 938 
 939   // Dominators for the sea of nodes
 940   void Dominators();
 941   Node *dom_lca( Node *n1, Node *n2 ) const {
 942     return find_non_split_ctrl(dom_lca_internal(n1, n2));
 943   }
 944   Node *dom_lca_internal( Node *n1, Node *n2 ) const;
 945 
 946   // Compute the Ideal Node to Loop mapping
 947   PhaseIdealLoop(PhaseIterGVN &igvn, LoopOptsMode mode) :
 948     PhaseTransform(Ideal_Loop),
 949     _igvn(igvn),
 950     _verify_me(NULL),
 951     _verify_only(false),
 952     _dom_lca_tags(arena()) { // Thread::resource_area
 953     build_and_optimize(mode);
 954   }
 955 
 956   // Verify that verify_me made the same decisions as a fresh run.
 957   PhaseIdealLoop(PhaseIterGVN &igvn, const PhaseIdealLoop *verify_me) :
 958     PhaseTransform(Ideal_Loop),
 959     _igvn(igvn),
 960     _verify_me(verify_me),
 961     _verify_only(false),
 962     _dom_lca_tags(arena()) { // Thread::resource_area
 963     build_and_optimize(LoopOptsVerify);
 964   }
 965 
 966   // Build and verify the loop tree without modifying the graph.  This
 967   // is useful to verify that all inputs properly dominate their uses.
 968   static void verify(PhaseIterGVN& igvn) {
 969 #ifdef ASSERT

 970     PhaseIdealLoop v(igvn);
 971 #endif
 972   }
 973 





 974   // True if the method has at least 1 irreducible loop
 975   bool _has_irreducible_loops;
 976 
 977   // Per-Node transform
 978   virtual Node *transform( Node *a_node ) { return 0; }
 979 
 980   bool is_counted_loop(Node* x, IdealLoopTree*& loop);
 981   IdealLoopTree* create_outer_strip_mined_loop(BoolNode *test, Node *cmp, Node *init_control,
 982                                                IdealLoopTree* loop, float cl_prob, float le_fcnt,
 983                                                Node*& entry_control, Node*& iffalse);
 984 
 985   Node* exact_limit( IdealLoopTree *loop );
 986 
 987   // Return a post-walked LoopNode
 988   IdealLoopTree *get_loop( Node *n ) const {
 989     // Dead nodes have no loop, so return the top level loop instead
 990     if (!has_node(n))  return _ltree_root;
 991     assert(!has_ctrl(n), "");
 992     return (IdealLoopTree*)_nodes[n->_idx];
 993   }




 863   void build_loop_tree();
 864   int build_loop_tree_impl( Node *n, int pre_order );
 865   // Insert loop into the existing loop tree.  'innermost' is a leaf of the
 866   // loop tree, not the root.
 867   IdealLoopTree *sort( IdealLoopTree *loop, IdealLoopTree *innermost );
 868 
 869   // Place Data nodes in some loop nest
 870   void build_loop_early( VectorSet &visited, Node_List &worklist, Node_Stack &nstack );
 871   void build_loop_late ( VectorSet &visited, Node_List &worklist, Node_Stack &nstack );
 872   void build_loop_late_post_work(Node* n, bool pinned);
 873   void build_loop_late_post(Node* n);
 874   void verify_strip_mined_scheduling(Node *n, Node* least);
 875 
 876   // Array of immediate dominance info for each CFG node indexed by node idx
 877 private:
 878   uint _idom_size;
 879   Node **_idom;                  // Array of immediate dominators
 880   uint *_dom_depth;              // Used for fast LCA test
 881   GrowableArray<uint>* _dom_stk; // For recomputation of dom depth
 882 
 883   // Perform verification that the graph is valid.
 884   PhaseIdealLoop( PhaseIterGVN &igvn) :
 885     PhaseTransform(Ideal_Loop),
 886     _igvn(igvn),
 887     _verify_me(NULL),
 888     _verify_only(true),
 889     _dom_lca_tags(arena()) { // Thread::resource_area
 890     build_and_optimize(LoopOptsVerify);
 891   }
 892 
 893   // build the loop tree and perform any requested optimizations
 894   void build_and_optimize(LoopOptsMode mode);
 895 
 896   // Dominators for the sea of nodes
 897   void Dominators();
 898 
 899   // Compute the Ideal Node to Loop mapping
 900   PhaseIdealLoop(PhaseIterGVN &igvn, LoopOptsMode mode) :
 901     PhaseTransform(Ideal_Loop),
 902     _igvn(igvn),
 903     _verify_me(NULL),
 904     _verify_only(false),
 905     _dom_lca_tags(arena()) { // Thread::resource_area
 906     build_and_optimize(mode);
 907   }
 908 
 909   // Verify that verify_me made the same decisions as a fresh run.
 910   PhaseIdealLoop(PhaseIterGVN &igvn, const PhaseIdealLoop *verify_me) :
 911     PhaseTransform(Ideal_Loop),
 912     _igvn(igvn),
 913     _verify_me(verify_me),
 914     _verify_only(false),
 915     _dom_lca_tags(arena()) { // Thread::resource_area
 916     build_and_optimize(LoopOptsVerify);
 917   }
 918 
 919 public:
 920   Node* idom_no_update(Node* d) const {
 921     return idom_no_update(d->_idx);
 922   }
 923 
 924   Node* idom_no_update(uint didx) const {
 925     assert(didx < _idom_size, "oob");
 926     Node* n = _idom[didx];
 927     assert(n != NULL,"Bad immediate dominator info.");
 928     while (n->in(0) == NULL) { // Skip dead CFG nodes
 929       n = (Node*)(((intptr_t)_nodes[n->_idx]) & ~1);
 930       assert(n != NULL,"Bad immediate dominator info.");
 931     }
 932     return n;
 933   }
 934 
 935   Node *idom(Node* d) const {
 936     return idom(d->_idx);
 937   }
 938 


 942     return n;
 943   }
 944 
 945   uint dom_depth(Node* d) const {
 946     guarantee(d != NULL, "Null dominator info.");
 947     guarantee(d->_idx < _idom_size, "");
 948     return _dom_depth[d->_idx];
 949   }
 950   void set_idom(Node* d, Node* n, uint dom_depth);
 951   // Locally compute IDOM using dom_lca call
 952   Node *compute_idom( Node *region ) const;
 953   // Recompute dom_depth
 954   void recompute_dom_depth();
 955 
 956   // Is safept not required by an outer loop?
 957   bool is_deleteable_safept(Node* sfpt);
 958 
 959   // Replace parallel induction variable (parallel to trip counter)
 960   void replace_parallel_iv(IdealLoopTree *loop);
 961 















 962   Node *dom_lca( Node *n1, Node *n2 ) const {
 963     return find_non_split_ctrl(dom_lca_internal(n1, n2));
 964   }
 965   Node *dom_lca_internal( Node *n1, Node *n2 ) const;
 966 




















 967   // Build and verify the loop tree without modifying the graph.  This
 968   // is useful to verify that all inputs properly dominate their uses.
 969   static void verify(PhaseIterGVN& igvn) {
 970 #ifdef ASSERT
 971     ResourceMark rm;
 972     PhaseIdealLoop v(igvn);
 973 #endif
 974   }
 975 
 976   static void optimize(PhaseIterGVN &igvn, LoopOptsMode mode) {
 977     ResourceMark rm;
 978     PhaseIdealLoop v(igvn, mode);
 979   }
 980 
 981   // True if the method has at least 1 irreducible loop
 982   bool _has_irreducible_loops;
 983 
 984   // Per-Node transform
 985   virtual Node *transform( Node *a_node ) { return 0; }
 986 
 987   bool is_counted_loop(Node* x, IdealLoopTree*& loop);
 988   IdealLoopTree* create_outer_strip_mined_loop(BoolNode *test, Node *cmp, Node *init_control,
 989                                                IdealLoopTree* loop, float cl_prob, float le_fcnt,
 990                                                Node*& entry_control, Node*& iffalse);
 991 
 992   Node* exact_limit( IdealLoopTree *loop );
 993 
 994   // Return a post-walked LoopNode
 995   IdealLoopTree *get_loop( Node *n ) const {
 996     // Dead nodes have no loop, so return the top level loop instead
 997     if (!has_node(n))  return _ltree_root;
 998     assert(!has_ctrl(n), "");
 999     return (IdealLoopTree*)_nodes[n->_idx];
1000   }


< prev index next >