Mercurial > hg > truffle
comparison src/share/vm/opto/loopnode.hpp @ 2445:08eb13460b3a
7004535: Clone loop predicate during loop unswitch
Summary: Clone loop predicate for clonned loops
Reviewed-by: never
author | kvn |
---|---|
date | Sat, 02 Apr 2011 10:54:15 -0700 |
parents | 9dc311b8473e |
children | 3af54845df98 |
comparison
equal
deleted
inserted
replaced
2444:07acc51c1d2a | 2445:08eb13460b3a |
---|---|
704 PhaseTransform(Ideal_Loop), | 704 PhaseTransform(Ideal_Loop), |
705 _igvn(igvn), | 705 _igvn(igvn), |
706 _dom_lca_tags(arena()), // Thread::resource_area | 706 _dom_lca_tags(arena()), // Thread::resource_area |
707 _verify_me(NULL), | 707 _verify_me(NULL), |
708 _verify_only(true) { | 708 _verify_only(true) { |
709 build_and_optimize(false, false); | 709 build_and_optimize(false); |
710 } | 710 } |
711 | 711 |
712 // build the loop tree and perform any requested optimizations | 712 // build the loop tree and perform any requested optimizations |
713 void build_and_optimize(bool do_split_if, bool do_loop_pred); | 713 void build_and_optimize(bool do_split_if); |
714 | 714 |
715 public: | 715 public: |
716 // Dominators for the sea of nodes | 716 // Dominators for the sea of nodes |
717 void Dominators(); | 717 void Dominators(); |
718 Node *dom_lca( Node *n1, Node *n2 ) const { | 718 Node *dom_lca( Node *n1, Node *n2 ) const { |
719 return find_non_split_ctrl(dom_lca_internal(n1, n2)); | 719 return find_non_split_ctrl(dom_lca_internal(n1, n2)); |
720 } | 720 } |
721 Node *dom_lca_internal( Node *n1, Node *n2 ) const; | 721 Node *dom_lca_internal( Node *n1, Node *n2 ) const; |
722 | 722 |
723 // Compute the Ideal Node to Loop mapping | 723 // Compute the Ideal Node to Loop mapping |
724 PhaseIdealLoop( PhaseIterGVN &igvn, bool do_split_ifs, bool do_loop_pred) : | 724 PhaseIdealLoop( PhaseIterGVN &igvn, bool do_split_ifs) : |
725 PhaseTransform(Ideal_Loop), | 725 PhaseTransform(Ideal_Loop), |
726 _igvn(igvn), | 726 _igvn(igvn), |
727 _dom_lca_tags(arena()), // Thread::resource_area | 727 _dom_lca_tags(arena()), // Thread::resource_area |
728 _verify_me(NULL), | 728 _verify_me(NULL), |
729 _verify_only(false) { | 729 _verify_only(false) { |
730 build_and_optimize(do_split_ifs, do_loop_pred); | 730 build_and_optimize(do_split_ifs); |
731 } | 731 } |
732 | 732 |
733 // Verify that verify_me made the same decisions as a fresh run. | 733 // Verify that verify_me made the same decisions as a fresh run. |
734 PhaseIdealLoop( PhaseIterGVN &igvn, const PhaseIdealLoop *verify_me) : | 734 PhaseIdealLoop( PhaseIterGVN &igvn, const PhaseIdealLoop *verify_me) : |
735 PhaseTransform(Ideal_Loop), | 735 PhaseTransform(Ideal_Loop), |
736 _igvn(igvn), | 736 _igvn(igvn), |
737 _dom_lca_tags(arena()), // Thread::resource_area | 737 _dom_lca_tags(arena()), // Thread::resource_area |
738 _verify_me(verify_me), | 738 _verify_me(verify_me), |
739 _verify_only(false) { | 739 _verify_only(false) { |
740 build_and_optimize(false, false); | 740 build_and_optimize(false); |
741 } | 741 } |
742 | 742 |
743 // Build and verify the loop tree without modifying the graph. This | 743 // Build and verify the loop tree without modifying the graph. This |
744 // is useful to verify that all inputs properly dominate their uses. | 744 // is useful to verify that all inputs properly dominate their uses. |
745 static void verify(PhaseIterGVN& igvn) { | 745 static void verify(PhaseIterGVN& igvn) { |
828 // Create a new if above the uncommon_trap_if_pattern for the predicate to be promoted | 828 // Create a new if above the uncommon_trap_if_pattern for the predicate to be promoted |
829 ProjNode* create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, | 829 ProjNode* create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, |
830 Deoptimization::DeoptReason reason); | 830 Deoptimization::DeoptReason reason); |
831 void register_control(Node* n, IdealLoopTree *loop, Node* pred); | 831 void register_control(Node* n, IdealLoopTree *loop, Node* pred); |
832 | 832 |
833 // Find a good location to insert a predicate | 833 // Clone loop predicates to cloned loops (peeled, unswitched) |
834 static ProjNode* clone_predicate(ProjNode* predicate_proj, Node* new_entry, | |
835 Deoptimization::DeoptReason reason, | |
836 PhaseIdealLoop* loop_phase, | |
837 PhaseIterGVN* igvn); | |
838 static ProjNode* move_predicate(ProjNode* predicate_proj, Node* new_entry, | |
839 Deoptimization::DeoptReason reason, | |
840 PhaseIdealLoop* loop_phase, | |
841 PhaseIterGVN* igvn); | |
842 static Node* clone_loop_predicates(Node* old_entry, Node* new_entry, | |
843 bool move_predicates, | |
844 PhaseIdealLoop* loop_phase, | |
845 PhaseIterGVN* igvn); | |
846 Node* clone_loop_predicates(Node* old_entry, Node* new_entry); | |
847 Node* move_loop_predicates(Node* old_entry, Node* new_entry); | |
848 | |
849 void eliminate_loop_predicates(Node* entry); | |
850 static Node* skip_loop_predicates(Node* entry); | |
851 | |
852 // Find a good location to insert a predicate | |
834 static ProjNode* find_predicate_insertion_point(Node* start_c, Deoptimization::DeoptReason reason); | 853 static ProjNode* find_predicate_insertion_point(Node* start_c, Deoptimization::DeoptReason reason); |
835 // Find a predicate | 854 // Find a predicate |
836 static Node* find_predicate(Node* entry); | 855 static Node* find_predicate(Node* entry); |
837 // Construct a range check for a predicate if | 856 // Construct a range check for a predicate if |
838 BoolNode* rc_predicate(Node* ctrl, | 857 BoolNode* rc_predicate(Node* ctrl, |