Mercurial > hg > truffle
comparison src/share/vm/opto/loopnode.hpp @ 8048:8b3da8d14c93
7197327: 40% regression on 8 b41 comp 8 b40 on specjvm2008.mpegaudio on oob
Summary: Add support for expensive nodes.
Reviewed-by: kvn
author | roland |
---|---|
date | Tue, 12 Feb 2013 12:56:11 +0100 |
parents | b9a9ed0f8eeb |
children | 3b9368710f08 |
comparison
equal
deleted
inserted
replaced
8047:1e5e28bac299 | 8048:8b3da8d14c93 |
---|---|
261 Node *init_trip() const { Node *tmp = phi (); return (tmp && tmp->req()==3) ? tmp->in(1) : NULL; } | 261 Node *init_trip() const { Node *tmp = phi (); return (tmp && tmp->req()==3) ? tmp->in(1) : NULL; } |
262 int stride_con() const; | 262 int stride_con() const; |
263 bool stride_is_con() const { Node *tmp = stride (); return (tmp != NULL && tmp->is_Con()); } | 263 bool stride_is_con() const { Node *tmp = stride (); return (tmp != NULL && tmp->is_Con()); } |
264 BoolTest::mask test_trip() const { return in(TestValue)->as_Bool()->_test._test; } | 264 BoolTest::mask test_trip() const { return in(TestValue)->as_Bool()->_test._test; } |
265 CountedLoopNode *loopnode() const { | 265 CountedLoopNode *loopnode() const { |
266 // The CountedLoopNode that goes with this CountedLoopEndNode may | |
267 // have been optimized out by the IGVN so be cautious with the | |
268 // pattern matching on the graph | |
269 if (phi() == NULL) { | |
270 return NULL; | |
271 } | |
266 Node *ln = phi()->in(0); | 272 Node *ln = phi()->in(0); |
267 assert( ln->Opcode() == Op_CountedLoop, "malformed loop" ); | 273 if (ln->is_CountedLoop() && ln->as_CountedLoop()->loopexit() == this) { |
268 return (CountedLoopNode*)ln; } | 274 return (CountedLoopNode*)ln; |
275 } | |
276 return NULL; | |
277 } | |
269 | 278 |
270 #ifndef PRODUCT | 279 #ifndef PRODUCT |
271 virtual void dump_spec(outputStream *st) const; | 280 virtual void dump_spec(outputStream *st) const; |
272 #endif | 281 #endif |
273 }; | 282 }; |
596 public: | 605 public: |
597 bool has_node( Node* n ) const { return _nodes[n->_idx] != NULL; } | 606 bool has_node( Node* n ) const { return _nodes[n->_idx] != NULL; } |
598 // check if transform created new nodes that need _ctrl recorded | 607 // check if transform created new nodes that need _ctrl recorded |
599 Node *get_late_ctrl( Node *n, Node *early ); | 608 Node *get_late_ctrl( Node *n, Node *early ); |
600 Node *get_early_ctrl( Node *n ); | 609 Node *get_early_ctrl( Node *n ); |
610 Node *get_early_ctrl_for_expensive(Node *n, Node* earliest); | |
601 void set_early_ctrl( Node *n ); | 611 void set_early_ctrl( Node *n ); |
602 void set_subtree_ctrl( Node *root ); | 612 void set_subtree_ctrl( Node *root ); |
603 void set_ctrl( Node *n, Node *ctrl ) { | 613 void set_ctrl( Node *n, Node *ctrl ) { |
604 assert( !has_node(n) || has_ctrl(n), "" ); | 614 assert( !has_node(n) || has_ctrl(n), "" ); |
605 assert( ctrl->in(0), "cannot set dead control node" ); | 615 assert( ctrl->in(0), "cannot set dead control node" ); |
902 bool loop_predication_impl(IdealLoopTree *loop); | 912 bool loop_predication_impl(IdealLoopTree *loop); |
903 | 913 |
904 // Helper function to collect predicate for eliminating the useless ones | 914 // Helper function to collect predicate for eliminating the useless ones |
905 void collect_potentially_useful_predicates(IdealLoopTree *loop, Unique_Node_List &predicate_opaque1); | 915 void collect_potentially_useful_predicates(IdealLoopTree *loop, Unique_Node_List &predicate_opaque1); |
906 void eliminate_useless_predicates(); | 916 void eliminate_useless_predicates(); |
917 | |
918 // Change the control input of expensive nodes to allow commoning by | |
919 // IGVN when it is guaranteed to not result in a more frequent | |
920 // execution of the expensive node. Return true if progress. | |
921 bool process_expensive_nodes(); | |
922 | |
923 // Check whether node has become unreachable | |
924 bool is_node_unreachable(Node *n) const { | |
925 return !has_node(n) || n->is_unreachable(_igvn); | |
926 } | |
907 | 927 |
908 // Eliminate range-checks and other trip-counter vs loop-invariant tests. | 928 // Eliminate range-checks and other trip-counter vs loop-invariant tests. |
909 void do_range_check( IdealLoopTree *loop, Node_List &old_new ); | 929 void do_range_check( IdealLoopTree *loop, Node_List &old_new ); |
910 | 930 |
911 // Create a slow version of the loop by cloning the loop | 931 // Create a slow version of the loop by cloning the loop |
1041 void set_created_loop_node() { _created_loop_node = true; } | 1061 void set_created_loop_node() { _created_loop_node = true; } |
1042 bool created_loop_node() { return _created_loop_node; } | 1062 bool created_loop_node() { return _created_loop_node; } |
1043 void register_new_node( Node *n, Node *blk ); | 1063 void register_new_node( Node *n, Node *blk ); |
1044 | 1064 |
1045 #ifdef ASSERT | 1065 #ifdef ASSERT |
1046 void dump_bad_graph(Node* n, Node* early, Node* LCA); | 1066 void dump_bad_graph(const char* msg, Node* n, Node* early, Node* LCA); |
1047 #endif | 1067 #endif |
1048 | 1068 |
1049 #ifndef PRODUCT | 1069 #ifndef PRODUCT |
1050 void dump( ) const; | 1070 void dump( ) const; |
1051 void dump( IdealLoopTree *loop, uint rpo_idx, Node_List &rpo_list ) const; | 1071 void dump( IdealLoopTree *loop, uint rpo_idx, Node_List &rpo_list ) const; |