21 * questions.
22 *
23 */
24
25 #ifndef SHARE_OPTO_LOOPNODE_HPP
26 #define SHARE_OPTO_LOOPNODE_HPP
27
28 #include "opto/cfgnode.hpp"
29 #include "opto/multnode.hpp"
30 #include "opto/phaseX.hpp"
31 #include "opto/subnode.hpp"
32 #include "opto/type.hpp"
33
34 class CmpNode;
35 class CountedLoopEndNode;
36 class CountedLoopNode;
37 class IdealLoopTree;
38 class LoopNode;
39 class Node;
40 class OuterStripMinedLoopEndNode;
41 class ShenandoahBarrierNode;
42 class ShenandoahWriteBarrierNode;
43 class PathFrequency;
44 class PhaseIdealLoop;
45 class CountedLoopReserveKit;
46 class VectorSet;
47 class Invariance;
48 struct small_cache;
49
50 //
51 // I D E A L I Z E D L O O P S
52 //
53 // Idealized loops are the set of loops I perform more interesting
54 // transformations on, beyond simple hoisting.
55
56 //------------------------------LoopNode---------------------------------------
57 // Simple loop header. Fall in path on left, loop-back path on right.
58 class LoopNode : public RegionNode {
59 // Size is bigger to hold the flags. However, the flags do not change
60 // the semantics so it does not appear in the hash & cmp functions.
61 virtual uint size_of() const { return sizeof(*this); }
62 protected:
621 bool is_inner() { return is_loop() && _child == NULL; }
622 bool is_counted() { return is_loop() && _head != NULL && _head->is_CountedLoop(); }
623
624 void remove_main_post_loops(CountedLoopNode *cl, PhaseIdealLoop *phase);
625
626 #ifndef PRODUCT
627 void dump_head( ) const; // Dump loop head only
628 void dump() const; // Dump this loop recursively
629 void verify_tree(IdealLoopTree *loop, const IdealLoopTree *parent) const;
630 #endif
631
632 };
633
634 // -----------------------------PhaseIdealLoop---------------------------------
635 // Computes the mapping from Nodes to IdealLoopTrees. Organizes IdealLoopTrees into a
636 // loop tree. Drives the loop-based transformations on the ideal graph.
637 class PhaseIdealLoop : public PhaseTransform {
638 friend class IdealLoopTree;
639 friend class SuperWord;
640 friend class CountedLoopReserveKit;
641 friend class ShenandoahBarrierNode;
642 friend class ShenandoahWriteBarrierNode;
643
644 // Pre-computed def-use info
645 PhaseIterGVN &_igvn;
646
647 // Head of loop tree
648 IdealLoopTree *_ltree_root;
649
650 // Array of pre-order numbers, plus post-visited bit.
651 // ZERO for not pre-visited. EVEN for pre-visited but not post-visited.
652 // ODD for post-visited. Other bits are the pre-order number.
653 uint *_preorders;
654 uint _max_preorder;
655
656 const PhaseIdealLoop* _verify_me;
657 bool _verify_only;
658
659 // Allocate _preorders[] array
660 void allocate_preorders() {
661 _max_preorder = C->unique()+8;
662 _preorders = NEW_RESOURCE_ARRAY(uint, _max_preorder);
|
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_OPTO_LOOPNODE_HPP
26 #define SHARE_OPTO_LOOPNODE_HPP
27
28 #include "opto/cfgnode.hpp"
29 #include "opto/multnode.hpp"
30 #include "opto/phaseX.hpp"
31 #include "opto/subnode.hpp"
32 #include "opto/type.hpp"
33
34 class CmpNode;
35 class CountedLoopEndNode;
36 class CountedLoopNode;
37 class IdealLoopTree;
38 class LoopNode;
39 class Node;
40 class OuterStripMinedLoopEndNode;
41 class PathFrequency;
42 class PhaseIdealLoop;
43 class CountedLoopReserveKit;
44 class VectorSet;
45 class Invariance;
46 struct small_cache;
47
48 //
49 // I D E A L I Z E D L O O P S
50 //
51 // Idealized loops are the set of loops I perform more interesting
52 // transformations on, beyond simple hoisting.
53
54 //------------------------------LoopNode---------------------------------------
55 // Simple loop header. Fall in path on left, loop-back path on right.
56 class LoopNode : public RegionNode {
57 // Size is bigger to hold the flags. However, the flags do not change
58 // the semantics so it does not appear in the hash & cmp functions.
59 virtual uint size_of() const { return sizeof(*this); }
60 protected:
619 bool is_inner() { return is_loop() && _child == NULL; }
620 bool is_counted() { return is_loop() && _head != NULL && _head->is_CountedLoop(); }
621
622 void remove_main_post_loops(CountedLoopNode *cl, PhaseIdealLoop *phase);
623
624 #ifndef PRODUCT
625 void dump_head( ) const; // Dump loop head only
626 void dump() const; // Dump this loop recursively
627 void verify_tree(IdealLoopTree *loop, const IdealLoopTree *parent) const;
628 #endif
629
630 };
631
632 // -----------------------------PhaseIdealLoop---------------------------------
633 // Computes the mapping from Nodes to IdealLoopTrees. Organizes IdealLoopTrees into a
634 // loop tree. Drives the loop-based transformations on the ideal graph.
635 class PhaseIdealLoop : public PhaseTransform {
636 friend class IdealLoopTree;
637 friend class SuperWord;
638 friend class CountedLoopReserveKit;
639 friend class ShenandoahBarrierC2Support;
640
641 // Pre-computed def-use info
642 PhaseIterGVN &_igvn;
643
644 // Head of loop tree
645 IdealLoopTree *_ltree_root;
646
647 // Array of pre-order numbers, plus post-visited bit.
648 // ZERO for not pre-visited. EVEN for pre-visited but not post-visited.
649 // ODD for post-visited. Other bits are the pre-order number.
650 uint *_preorders;
651 uint _max_preorder;
652
653 const PhaseIdealLoop* _verify_me;
654 bool _verify_only;
655
656 // Allocate _preorders[] array
657 void allocate_preorders() {
658 _max_preorder = C->unique()+8;
659 _preorders = NEW_RESOURCE_ARRAY(uint, _max_preorder);
|