33 // Stops value-numbering, Ideal calls or Identity functions.
34 class Opaque1Node : public Node {
35 virtual uint hash() const ; // { return NO_HASH; }
36 virtual uint cmp( const Node &n ) const;
37 public:
38 Opaque1Node( Compile* C, Node *n ) : Node(0,n) {
39 // Put it on the Macro nodes list to removed during macro nodes expansion.
40 init_flags(Flag_is_macro);
41 C->add_macro_node(this);
42 }
43 // Special version for the pre-loop to hold the original loop limit
44 // which is consumed by range check elimination.
45 Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {
46 // Put it on the Macro nodes list to removed during macro nodes expansion.
47 init_flags(Flag_is_macro);
48 C->add_macro_node(this);
49 }
50 Node* original_loop_limit() { return req()==3 ? in(2) : NULL; }
51 virtual int Opcode() const;
52 virtual const Type *bottom_type() const { return TypeInt::INT; }
53 virtual Node *Identity( PhaseTransform *phase );
54 };
55
56 //------------------------------Opaque2Node------------------------------------
57 // A node to prevent unwanted optimizations. Allows constant folding. Stops
58 // value-numbering, most Ideal calls or Identity functions. This Node is
59 // specifically designed to prevent the pre-increment value of a loop trip
60 // counter from being live out of the bottom of the loop (hence causing the
61 // pre- and post-increment values both being live and thus requiring an extra
62 // temp register and an extra move). If we "accidentally" optimize through
63 // this kind of a Node, we'll get slightly pessimal, but correct, code. Thus
64 // it's OK to be slightly sloppy on optimizations here.
65 class Opaque2Node : public Node {
66 virtual uint hash() const ; // { return NO_HASH; }
67 virtual uint cmp( const Node &n ) const;
68 public:
69 Opaque2Node( Compile* C, Node *n ) : Node(0,n) {
70 // Put it on the Macro nodes list to removed during macro nodes expansion.
71 init_flags(Flag_is_macro);
72 C->add_macro_node(this);
73 }
92 // Once parsing is over, the node goes away (during IGVN).
93 // It is used to override branch frequencies from MDO (see has_injected_profile in parse2.cpp).
94 class ProfileBooleanNode : public Node {
95 uint _false_cnt;
96 uint _true_cnt;
97 bool _consumed;
98 bool _delay_removal;
99 virtual uint hash() const ; // { return NO_HASH; }
100 virtual uint cmp( const Node &n ) const;
101 public:
102 ProfileBooleanNode(Node *n, uint false_cnt, uint true_cnt) : Node(0, n),
103 _false_cnt(false_cnt), _true_cnt(true_cnt), _delay_removal(true), _consumed(false) {}
104
105 uint false_count() const { return _false_cnt; }
106 uint true_count() const { return _true_cnt; }
107
108 void consume() { _consumed = true; }
109
110 virtual int Opcode() const;
111 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
112 virtual Node *Identity(PhaseTransform *phase);
113 virtual const Type *bottom_type() const { return TypeInt::BOOL; }
114 };
115
116 #endif // SHARE_VM_OPTO_OPAQUENODE_HPP
117
|
33 // Stops value-numbering, Ideal calls or Identity functions.
34 class Opaque1Node : public Node {
35 virtual uint hash() const ; // { return NO_HASH; }
36 virtual uint cmp( const Node &n ) const;
37 public:
38 Opaque1Node( Compile* C, Node *n ) : Node(0,n) {
39 // Put it on the Macro nodes list to removed during macro nodes expansion.
40 init_flags(Flag_is_macro);
41 C->add_macro_node(this);
42 }
43 // Special version for the pre-loop to hold the original loop limit
44 // which is consumed by range check elimination.
45 Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {
46 // Put it on the Macro nodes list to removed during macro nodes expansion.
47 init_flags(Flag_is_macro);
48 C->add_macro_node(this);
49 }
50 Node* original_loop_limit() { return req()==3 ? in(2) : NULL; }
51 virtual int Opcode() const;
52 virtual const Type *bottom_type() const { return TypeInt::INT; }
53 virtual Node* Identity(PhaseGVN* phase);
54 };
55
56 //------------------------------Opaque2Node------------------------------------
57 // A node to prevent unwanted optimizations. Allows constant folding. Stops
58 // value-numbering, most Ideal calls or Identity functions. This Node is
59 // specifically designed to prevent the pre-increment value of a loop trip
60 // counter from being live out of the bottom of the loop (hence causing the
61 // pre- and post-increment values both being live and thus requiring an extra
62 // temp register and an extra move). If we "accidentally" optimize through
63 // this kind of a Node, we'll get slightly pessimal, but correct, code. Thus
64 // it's OK to be slightly sloppy on optimizations here.
65 class Opaque2Node : public Node {
66 virtual uint hash() const ; // { return NO_HASH; }
67 virtual uint cmp( const Node &n ) const;
68 public:
69 Opaque2Node( Compile* C, Node *n ) : Node(0,n) {
70 // Put it on the Macro nodes list to removed during macro nodes expansion.
71 init_flags(Flag_is_macro);
72 C->add_macro_node(this);
73 }
92 // Once parsing is over, the node goes away (during IGVN).
93 // It is used to override branch frequencies from MDO (see has_injected_profile in parse2.cpp).
94 class ProfileBooleanNode : public Node {
95 uint _false_cnt;
96 uint _true_cnt;
97 bool _consumed;
98 bool _delay_removal;
99 virtual uint hash() const ; // { return NO_HASH; }
100 virtual uint cmp( const Node &n ) const;
101 public:
102 ProfileBooleanNode(Node *n, uint false_cnt, uint true_cnt) : Node(0, n),
103 _false_cnt(false_cnt), _true_cnt(true_cnt), _delay_removal(true), _consumed(false) {}
104
105 uint false_count() const { return _false_cnt; }
106 uint true_count() const { return _true_cnt; }
107
108 void consume() { _consumed = true; }
109
110 virtual int Opcode() const;
111 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
112 virtual Node* Identity(PhaseGVN* phase);
113 virtual const Type *bottom_type() const { return TypeInt::BOOL; }
114 };
115
116 #endif // SHARE_VM_OPTO_OPAQUENODE_HPP
117
|