561 return yank_if_dead(old, current_block, &value, ®nd);
562 }
563
564 int yank_if_dead( Node *old, Block *current_block, Node_List *value, Node_List *regnd ) {
565 return yank_if_dead_recurse(old, old, current_block, value, regnd);
566 }
567 int yank_if_dead_recurse(Node *old, Node *orig_old, Block *current_block,
568 Node_List *value, Node_List *regnd);
569 int yank( Node *old, Block *current_block, Node_List *value, Node_List *regnd );
570 int elide_copy( Node *n, int k, Block *current_block, Node_List &value, Node_List ®nd, bool can_change_regs );
571 int use_prior_register( Node *copy, uint idx, Node *def, Block *current_block, Node_List &value, Node_List ®nd );
572 bool may_be_copy_of_callee( Node *def ) const;
573
574 // If nreg already contains the same constant as val then eliminate it
575 bool eliminate_copy_of_constant(Node* val, Node* n,
576 Block *current_block, Node_List& value, Node_List ®nd,
577 OptoReg::Name nreg, OptoReg::Name nreg2);
578 // Extend the node to LRG mapping
579 void add_reference( const Node *node, const Node *old_node);
580
581 private:
582
583 static int _final_loads, _final_stores, _final_copies, _final_memoves;
584 static double _final_load_cost, _final_store_cost, _final_copy_cost, _final_memove_cost;
585 static int _conserv_coalesce, _conserv_coalesce_pair;
586 static int _conserv_coalesce_trie, _conserv_coalesce_quad;
587 static int _post_alloc;
588 static int _lost_opp_pp_coalesce, _lost_opp_cflow_coalesce;
589 static int _used_cisc_instructions, _unused_cisc_instructions;
590 static int _allocator_attempts, _allocator_successes;
591
592 #ifndef PRODUCT
593 static uint _high_pressure, _low_pressure;
594
595 void dump() const;
596 void dump( const Node *n ) const;
597 void dump( const Block * b ) const;
598 void dump_degree_lists() const;
599 void dump_simplified() const;
600 void dump_lrg( uint lidx, bool defs_only) const;
|
561 return yank_if_dead(old, current_block, &value, ®nd);
562 }
563
564 int yank_if_dead( Node *old, Block *current_block, Node_List *value, Node_List *regnd ) {
565 return yank_if_dead_recurse(old, old, current_block, value, regnd);
566 }
567 int yank_if_dead_recurse(Node *old, Node *orig_old, Block *current_block,
568 Node_List *value, Node_List *regnd);
569 int yank( Node *old, Block *current_block, Node_List *value, Node_List *regnd );
570 int elide_copy( Node *n, int k, Block *current_block, Node_List &value, Node_List ®nd, bool can_change_regs );
571 int use_prior_register( Node *copy, uint idx, Node *def, Block *current_block, Node_List &value, Node_List ®nd );
572 bool may_be_copy_of_callee( Node *def ) const;
573
574 // If nreg already contains the same constant as val then eliminate it
575 bool eliminate_copy_of_constant(Node* val, Node* n,
576 Block *current_block, Node_List& value, Node_List ®nd,
577 OptoReg::Name nreg, OptoReg::Name nreg2);
578 // Extend the node to LRG mapping
579 void add_reference( const Node *node, const Node *old_node);
580
581 // Record the first use of a def in the block for a register.
582 class RegDefUse {
583 Node* _def;
584 Node* _first_use;
585 public:
586 RegDefUse() : _def(NULL), _first_use(NULL) { }
587 Node* def() const { return _def; }
588 Node* first_use() const { return _first_use; }
589
590 void update(Node* def, Node* use) {
591 if (_def != def) {
592 _def = def;
593 _first_use = use;
594 }
595 }
596 void clear() {
597 _def = NULL;
598 _first_use = NULL;
599 }
600 };
601 typedef GrowableArray<RegDefUse> RegToDefUseMap;
602 int possibly_merge_multidef(Node *n, uint k, Block *block, RegToDefUseMap& reg2defuse);
603
604 // Merge nodes that are a part of a multidef lrg and produce the same value within a block.
605 void merge_multidefs();
606
607 private:
608
609 static int _final_loads, _final_stores, _final_copies, _final_memoves;
610 static double _final_load_cost, _final_store_cost, _final_copy_cost, _final_memove_cost;
611 static int _conserv_coalesce, _conserv_coalesce_pair;
612 static int _conserv_coalesce_trie, _conserv_coalesce_quad;
613 static int _post_alloc;
614 static int _lost_opp_pp_coalesce, _lost_opp_cflow_coalesce;
615 static int _used_cisc_instructions, _unused_cisc_instructions;
616 static int _allocator_attempts, _allocator_successes;
617
618 #ifndef PRODUCT
619 static uint _high_pressure, _low_pressure;
620
621 void dump() const;
622 void dump( const Node *n ) const;
623 void dump( const Block * b ) const;
624 void dump_degree_lists() const;
625 void dump_simplified() const;
626 void dump_lrg( uint lidx, bool defs_only) const;
|