src/share/vm/opto/loopnode.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
6862956 Cdiff src/share/vm/opto/loopnode.hpp
src/share/vm/opto/loopnode.hpp
Print this page
*** 440,449 ****
--- 440,452 ----
// ZERO for not pre-visited. EVEN for pre-visited but not post-visited.
// ODD for post-visited. Other bits are the pre-order number.
uint *_preorders;
uint _max_preorder;
+ const PhaseIdealLoop* _verify_me;
+ bool _verify_only;
+
// Allocate _preorders[] array
void allocate_preorders() {
_max_preorder = C->unique()+8;
_preorders = NEW_RESOURCE_ARRAY(uint, _max_preorder);
memset(_preorders, 0, sizeof(uint) * _max_preorder);
*** 495,504 ****
--- 498,513 ----
// Support for faster execution of get_late_ctrl()/dom_lca()
// when a node has many uses and dominator depth is deep.
Node_Array _dom_lca_tags;
void init_dom_lca_tags();
void clear_dom_lca_tags();
+
+ // Helper for debugging bad dominance relationships
+ bool verify_dominance(Node* n, Node* use, Node* LCA, Node* early);
+
+ Node* compute_lca_of_uses(Node* n, Node* early, bool verify = false);
+
// Inline wrapper for frequent cases:
// 1) only one use
// 2) a use is the same as the current LCA passed as 'n1'
Node *dom_lca_for_get_late_ctrl( Node *lca, Node *n, Node *tag ) {
assert( n->is_CFG(), "" );
*** 509,518 ****
--- 518,528 ----
n = dom_lca_for_get_late_ctrl_internal( lca, n, tag );
}
return find_non_split_ctrl(n);
}
Node *dom_lca_for_get_late_ctrl_internal( Node *lca, Node *n, Node *tag );
+
// true if CFG node d dominates CFG node n
bool is_dominator(Node *d, Node *n);
// Helper function for directing control inputs away from CFG split
// points.
*** 619,631 ****
// Insert loop into the existing loop tree. 'innermost' is a leaf of the
// loop tree, not the root.
IdealLoopTree *sort( IdealLoopTree *loop, IdealLoopTree *innermost );
// Place Data nodes in some loop nest
! void build_loop_early( VectorSet &visited, Node_List &worklist, Node_Stack &nstack, const PhaseIdealLoop *verify_me );
! void build_loop_late ( VectorSet &visited, Node_List &worklist, Node_Stack &nstack, const PhaseIdealLoop *verify_me );
! void build_loop_late_post ( Node* n, const PhaseIdealLoop *verify_me );
// Array of immediate dominance info for each CFG node indexed by node idx
private:
uint _idom_size;
Node **_idom; // Array of immediate dominators
--- 629,641 ----
// Insert loop into the existing loop tree. 'innermost' is a leaf of the
// loop tree, not the root.
IdealLoopTree *sort( IdealLoopTree *loop, IdealLoopTree *innermost );
// Place Data nodes in some loop nest
! void build_loop_early( VectorSet &visited, Node_List &worklist, Node_Stack &nstack );
! void build_loop_late ( VectorSet &visited, Node_List &worklist, Node_Stack &nstack );
! void build_loop_late_post ( Node* n );
// Array of immediate dominance info for each CFG node indexed by node idx
private:
uint _idom_size;
Node **_idom; // Array of immediate dominators
*** 660,680 ****
void recompute_dom_depth();
// Is safept not required by an outer loop?
bool is_deleteable_safept(Node* sfpt);
public:
// Dominators for the sea of nodes
void Dominators();
Node *dom_lca( Node *n1, Node *n2 ) const {
return find_non_split_ctrl(dom_lca_internal(n1, n2));
}
Node *dom_lca_internal( Node *n1, Node *n2 ) const;
// Compute the Ideal Node to Loop mapping
! PhaseIdealLoop( PhaseIterGVN &igvn, const PhaseIdealLoop *verify_me, bool do_split_ifs );
// True if the method has at least 1 irreducible loop
bool _has_irreducible_loops;
// Per-Node transform
virtual Node *transform( Node *a_node ) { return 0; }
--- 670,728 ----
void recompute_dom_depth();
// Is safept not required by an outer loop?
bool is_deleteable_safept(Node* sfpt);
+ // Perform verification that the graph is valid.
+ PhaseIdealLoop( PhaseIterGVN &igvn) :
+ PhaseTransform(Ideal_Loop),
+ _igvn(igvn),
+ _dom_lca_tags(C->comp_arena()),
+ _verify_me(NULL),
+ _verify_only(true) {
+ build_and_optimize(false);
+ }
+
+ // build the loop tree and perform any requested optimizations
+ void build_and_optimize(bool do_split_if);
+
public:
// Dominators for the sea of nodes
void Dominators();
Node *dom_lca( Node *n1, Node *n2 ) const {
return find_non_split_ctrl(dom_lca_internal(n1, n2));
}
Node *dom_lca_internal( Node *n1, Node *n2 ) const;
// Compute the Ideal Node to Loop mapping
! PhaseIdealLoop( PhaseIterGVN &igvn, bool do_split_ifs) :
! PhaseTransform(Ideal_Loop),
! _igvn(igvn),
! _dom_lca_tags(C->comp_arena()),
! _verify_me(NULL),
! _verify_only(false) {
! build_and_optimize(do_split_ifs);
! }
+ // Verify that verify_me made the same decisions as a fresh run.
+ PhaseIdealLoop( PhaseIterGVN &igvn, const PhaseIdealLoop *verify_me) :
+ PhaseTransform(Ideal_Loop),
+ _igvn(igvn),
+ _dom_lca_tags(C->comp_arena()),
+ _verify_me(verify_me),
+ _verify_only(false) {
+ build_and_optimize(false);
+ }
+
+ // Build and verify the loop tree without modifying the graph. This
+ // is useful to verify that all inputs properly dominate their uses.
+ static void verify(PhaseIterGVN& igvn) {
+ #ifdef ASSERT
+ PhaseIdealLoop v(igvn);
+ #endif
+ }
+
// True if the method has at least 1 irreducible loop
bool _has_irreducible_loops;
// Per-Node transform
virtual Node *transform( Node *a_node ) { return 0; }
src/share/vm/opto/loopnode.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File