163 int _inst_mem_id; // Instance memory id (node index of the memory Phi)
164 int _inst_id; // Instance id of the memory slice.
165 const int _inst_index; // Alias index of the instance memory slice.
166 // Array elements references have the same alias_idx but different offset.
167 const int _inst_offset; // Offset of the instance memory slice.
168 // Size is bigger to hold the _adr_type field.
169 virtual uint hash() const; // Check the type
170 virtual bool cmp( const Node &n ) const;
171 virtual uint size_of() const { return sizeof(*this); }
172
173 // Determine if CMoveNode::is_cmove_id can be used at this join point.
174 Node* is_cmove_id(PhaseTransform* phase, int true_path);
175 bool wait_for_region_igvn(PhaseGVN* phase);
176 bool is_data_loop(RegionNode* r, Node* uin, const PhaseGVN* phase);
177
178 static Node* clone_through_phi(Node* root_phi, const Type* t, uint c, PhaseIterGVN* igvn);
179 static Node* merge_through_phi(Node* root_phi, PhaseIterGVN* igvn);
180
181 bool must_wait_for_region_in_irreducible_loop(PhaseGVN* phase) const;
182
183 bool is_split_through_mergemem_terminating() const;
184
185 public:
186 // Node layout (parallels RegionNode):
187 enum { Region, // Control input is the Phi's region.
188 Input // Input values are [1..len)
189 };
190
191 PhiNode( Node *r, const Type *t, const TypePtr* at = nullptr,
192 const int imid = -1,
193 const int iid = TypeOopPtr::InstanceTop,
194 const int iidx = Compile::AliasIdxTop,
195 const int ioffs = Type::OffsetTop )
196 : TypeNode(t,r->req()),
197 _adr_type(at),
198 _inst_mem_id(imid),
199 _inst_id(iid),
200 _inst_index(iidx),
201 _inst_offset(ioffs)
202 {
238 int is_diamond_phi() const;
239 bool try_clean_memory_phi(PhaseIterGVN* igvn);
240 virtual int Opcode() const;
241 virtual bool pinned() const { return in(0) != nullptr; }
242 virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }
243
244 void set_inst_mem_id(int inst_mem_id) { _inst_mem_id = inst_mem_id; }
245 int inst_mem_id() const { return _inst_mem_id; }
246 int inst_id() const { return _inst_id; }
247 int inst_index() const { return _inst_index; }
248 int inst_offset() const { return _inst_offset; }
249 bool is_same_inst_field(const Type* tp, int mem_id, int id, int index, int offset) {
250 return type()->basic_type() == tp->basic_type() &&
251 inst_mem_id() == mem_id &&
252 inst_id() == id &&
253 inst_index() == index &&
254 inst_offset() == offset &&
255 type()->higher_equal(tp);
256 }
257
258 virtual const Type* Value(PhaseGVN* phase) const;
259 virtual Node* Identity(PhaseGVN* phase);
260 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
261 virtual const RegMask &out_RegMask() const;
262 virtual const RegMask &in_RegMask(uint) const;
263 #ifndef PRODUCT
264 virtual void dump_spec(outputStream *st) const;
265 #endif
266 #ifdef ASSERT
267 void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
268 void verify_adr_type(bool recursive = false) const;
269 #else //ASSERT
270 void verify_adr_type(bool recursive = false) const {}
271 #endif //ASSERT
272
273 const TypeTuple* collect_types(PhaseGVN* phase) const;
274 };
275
276 //------------------------------GotoNode---------------------------------------
277 // GotoNodes perform direct branches.
431 static IfNode* make_with_same_profile(IfNode* if_node_profile, Node* ctrl, Node* bol);
432
433 virtual int Opcode() const;
434 virtual bool pinned() const { return true; }
435 virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
436 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
437 virtual const Type* Value(PhaseGVN* phase) const;
438 virtual int required_outcnt() const { return 2; }
439 virtual const RegMask &out_RegMask() const;
440 Node* fold_compares(PhaseIterGVN* phase);
441 static Node* up_one_dom(Node* curr, bool linear_only = false);
442 bool is_zero_trip_guard() const;
443 Node* dominated_by(Node* prev_dom, PhaseIterGVN* igvn, bool pin_array_access_nodes);
444 ProjNode* uncommon_trap_proj(CallStaticJavaNode*& call, Deoptimization::DeoptReason reason = Deoptimization::Reason_none) const;
445
446 // Takes the type of val and filters it through the test represented
447 // by if_proj and returns a more refined type if one is produced.
448 // Returns null is it couldn't improve the type.
449 static const TypeInt* filtered_int_type(PhaseGVN* phase, Node* val, Node* if_proj);
450
451 AssertionPredicateType assertion_predicate_type() const {
452 return _assertion_predicate_type;
453 }
454
455 #ifndef PRODUCT
456 virtual void dump_spec(outputStream *st) const;
457 #endif
458
459 bool same_condition(const Node* dom, PhaseIterGVN* igvn) const;
460 };
461
462 class RangeCheckNode : public IfNode {
463 private:
464 int is_range_check(Node*& range, Node*& index, jint& offset);
465
466 public:
467 RangeCheckNode(Node* control, Node* bol, float p, float fcnt) : IfNode(control, bol, p, fcnt) {
468 init_class_id(Class_RangeCheck);
469 }
470
714 virtual int Opcode() const;
715 virtual bool pinned() const { return true; };
716 virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
717 virtual const Type* Value(PhaseGVN* phase) const;
718 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
719 virtual int required_outcnt() const { return 2; }
720 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const { }
721 virtual uint size(PhaseRegAlloc *ra_) const { return 0; }
722 #ifndef PRODUCT
723 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
724 #endif
725 };
726
727 //------------------------------BlackholeNode----------------------------
728 // Blackhole all arguments. This node would survive through the compiler
729 // the effects on its arguments, and would be finally matched to nothing.
730 class BlackholeNode : public MultiNode {
731 public:
732 BlackholeNode(Node* ctrl) : MultiNode(1) {
733 init_req(TypeFunc::Control, ctrl);
734 }
735 virtual int Opcode() const;
736 virtual uint ideal_reg() const { return 0; } // not matched in the AD file
737 virtual const Type* bottom_type() const { return TypeTuple::MEMBAR; }
738
739 const RegMask &in_RegMask(uint idx) const {
740 // Fake the incoming arguments mask for blackholes: accept all registers
741 // and all stack slots. This would avoid any redundant register moves
742 // for blackhole inputs.
743 return RegMask::All;
744 }
745 #ifndef PRODUCT
746 virtual void format(PhaseRegAlloc* ra, outputStream* st) const;
747 #endif
748 };
749
750
751 #endif // SHARE_OPTO_CFGNODE_HPP
|
163 int _inst_mem_id; // Instance memory id (node index of the memory Phi)
164 int _inst_id; // Instance id of the memory slice.
165 const int _inst_index; // Alias index of the instance memory slice.
166 // Array elements references have the same alias_idx but different offset.
167 const int _inst_offset; // Offset of the instance memory slice.
168 // Size is bigger to hold the _adr_type field.
169 virtual uint hash() const; // Check the type
170 virtual bool cmp( const Node &n ) const;
171 virtual uint size_of() const { return sizeof(*this); }
172
173 // Determine if CMoveNode::is_cmove_id can be used at this join point.
174 Node* is_cmove_id(PhaseTransform* phase, int true_path);
175 bool wait_for_region_igvn(PhaseGVN* phase);
176 bool is_data_loop(RegionNode* r, Node* uin, const PhaseGVN* phase);
177
178 static Node* clone_through_phi(Node* root_phi, const Type* t, uint c, PhaseIterGVN* igvn);
179 static Node* merge_through_phi(Node* root_phi, PhaseIterGVN* igvn);
180
181 bool must_wait_for_region_in_irreducible_loop(PhaseGVN* phase) const;
182
183 bool can_push_inline_types_down(PhaseGVN* phase, bool can_reshape, ciInlineKlass*& inline_klass);
184 InlineTypeNode* push_inline_types_down(PhaseGVN* phase, bool can_reshape, ciInlineKlass* inline_klass);
185
186 bool is_split_through_mergemem_terminating() const;
187
188 public:
189 // Node layout (parallels RegionNode):
190 enum { Region, // Control input is the Phi's region.
191 Input // Input values are [1..len)
192 };
193
194 PhiNode( Node *r, const Type *t, const TypePtr* at = nullptr,
195 const int imid = -1,
196 const int iid = TypeOopPtr::InstanceTop,
197 const int iidx = Compile::AliasIdxTop,
198 const int ioffs = Type::OffsetTop )
199 : TypeNode(t,r->req()),
200 _adr_type(at),
201 _inst_mem_id(imid),
202 _inst_id(iid),
203 _inst_index(iidx),
204 _inst_offset(ioffs)
205 {
241 int is_diamond_phi() const;
242 bool try_clean_memory_phi(PhaseIterGVN* igvn);
243 virtual int Opcode() const;
244 virtual bool pinned() const { return in(0) != nullptr; }
245 virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; }
246
247 void set_inst_mem_id(int inst_mem_id) { _inst_mem_id = inst_mem_id; }
248 int inst_mem_id() const { return _inst_mem_id; }
249 int inst_id() const { return _inst_id; }
250 int inst_index() const { return _inst_index; }
251 int inst_offset() const { return _inst_offset; }
252 bool is_same_inst_field(const Type* tp, int mem_id, int id, int index, int offset) {
253 return type()->basic_type() == tp->basic_type() &&
254 inst_mem_id() == mem_id &&
255 inst_id() == id &&
256 inst_index() == index &&
257 inst_offset() == offset &&
258 type()->higher_equal(tp);
259 }
260
261 bool can_be_inline_type() const {
262 return EnableValhalla && _type->isa_instptr() && _type->is_instptr()->can_be_inline_type();
263 }
264
265 Node* try_push_inline_types_down(PhaseGVN* phase, bool can_reshape);
266 DEBUG_ONLY(bool can_push_inline_types_down(PhaseGVN* phase);)
267
268 virtual const Type* Value(PhaseGVN* phase) const;
269 virtual Node* Identity(PhaseGVN* phase);
270 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
271 virtual const RegMask &out_RegMask() const;
272 virtual const RegMask &in_RegMask(uint) const;
273 #ifndef PRODUCT
274 virtual void dump_spec(outputStream *st) const;
275 #endif
276 #ifdef ASSERT
277 void verify_adr_type(VectorSet& visited, const TypePtr* at) const;
278 void verify_adr_type(bool recursive = false) const;
279 #else //ASSERT
280 void verify_adr_type(bool recursive = false) const {}
281 #endif //ASSERT
282
283 const TypeTuple* collect_types(PhaseGVN* phase) const;
284 };
285
286 //------------------------------GotoNode---------------------------------------
287 // GotoNodes perform direct branches.
441 static IfNode* make_with_same_profile(IfNode* if_node_profile, Node* ctrl, Node* bol);
442
443 virtual int Opcode() const;
444 virtual bool pinned() const { return true; }
445 virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
446 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
447 virtual const Type* Value(PhaseGVN* phase) const;
448 virtual int required_outcnt() const { return 2; }
449 virtual const RegMask &out_RegMask() const;
450 Node* fold_compares(PhaseIterGVN* phase);
451 static Node* up_one_dom(Node* curr, bool linear_only = false);
452 bool is_zero_trip_guard() const;
453 Node* dominated_by(Node* prev_dom, PhaseIterGVN* igvn, bool pin_array_access_nodes);
454 ProjNode* uncommon_trap_proj(CallStaticJavaNode*& call, Deoptimization::DeoptReason reason = Deoptimization::Reason_none) const;
455
456 // Takes the type of val and filters it through the test represented
457 // by if_proj and returns a more refined type if one is produced.
458 // Returns null is it couldn't improve the type.
459 static const TypeInt* filtered_int_type(PhaseGVN* phase, Node* val, Node* if_proj);
460
461 bool is_flat_array_check(PhaseTransform* phase, Node** array = nullptr);
462
463 AssertionPredicateType assertion_predicate_type() const {
464 return _assertion_predicate_type;
465 }
466
467 #ifndef PRODUCT
468 virtual void dump_spec(outputStream *st) const;
469 #endif
470
471 bool same_condition(const Node* dom, PhaseIterGVN* igvn) const;
472 };
473
474 class RangeCheckNode : public IfNode {
475 private:
476 int is_range_check(Node*& range, Node*& index, jint& offset);
477
478 public:
479 RangeCheckNode(Node* control, Node* bol, float p, float fcnt) : IfNode(control, bol, p, fcnt) {
480 init_class_id(Class_RangeCheck);
481 }
482
726 virtual int Opcode() const;
727 virtual bool pinned() const { return true; };
728 virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; }
729 virtual const Type* Value(PhaseGVN* phase) const;
730 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
731 virtual int required_outcnt() const { return 2; }
732 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const { }
733 virtual uint size(PhaseRegAlloc *ra_) const { return 0; }
734 #ifndef PRODUCT
735 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
736 #endif
737 };
738
739 //------------------------------BlackholeNode----------------------------
740 // Blackhole all arguments. This node would survive through the compiler
741 // the effects on its arguments, and would be finally matched to nothing.
742 class BlackholeNode : public MultiNode {
743 public:
744 BlackholeNode(Node* ctrl) : MultiNode(1) {
745 init_req(TypeFunc::Control, ctrl);
746 init_class_id(Class_Blackhole);
747 }
748 virtual int Opcode() const;
749 virtual uint ideal_reg() const { return 0; } // not matched in the AD file
750 virtual const Type* bottom_type() const { return TypeTuple::MEMBAR; }
751
752 const RegMask &in_RegMask(uint idx) const {
753 // Fake the incoming arguments mask for blackholes: accept all registers
754 // and all stack slots. This would avoid any redundant register moves
755 // for blackhole inputs.
756 return RegMask::All;
757 }
758 #ifndef PRODUCT
759 virtual void format(PhaseRegAlloc* ra, outputStream* st) const;
760 #endif
761 };
762
763
764 #endif // SHARE_OPTO_CFGNODE_HPP
|